API Testing / Basic: trustworthy API observations

API Testing β€” Basic: trustworthy API observations

Build explicit contracts, request/response assertions, JSON boundaries, isolated fixtures, and safe error evidence.

6 lessons Β· No account required

What you will learn

  • Separate a business requirement, a protocol contract, and a test oracle.
  • Design observable positive and negative cases without contacting an API.
  • Distinguish HTTP semantics from a service-specific business result.
  • Normalize header names while preserving values whose syntax matters.
  1. Turn an API promise into testable evidence

    Build explicit oracles for a fictional library API and state what an offline test actually establishes.

    Start learning
  2. Test HTTP responses as structured contracts

    Combine method, status, headers, representation, and state effect into a coherent expectation.

    Start learning
  3. Test JSON boundaries and representation choices

    Distinguish parsing, structural validation, and domain validation with deliberately small boundary cases.

    Start learning
  4. Write assertions that explain the broken promise

    Choose exact, partial, ordered, and unordered comparisons deliberately rather than snapshotting everything.

    Start learning
  5. Build isolated fixtures and deterministic tests

    Control state, clocks, identifiers, and dependencies without using configured services.

    Start learning
  6. Verify error contracts and unchanged state

    Test useful, stable failure information without leaking internal details or treating every error as equivalent.

    Start learning
Back to course