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.
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.
Turn an API promise into testable evidence
Build explicit oracles for a fictional library API and state what an offline test actually establishes.
Start learningTest HTTP responses as structured contracts
Combine method, status, headers, representation, and state effect into a coherent expectation.
Start learningTest JSON boundaries and representation choices
Distinguish parsing, structural validation, and domain validation with deliberately small boundary cases.
Start learningWrite assertions that explain the broken promise
Choose exact, partial, ordered, and unordered comparisons deliberately rather than snapshotting everything.
Start learningBuild isolated fixtures and deterministic tests
Control state, clocks, identifiers, and dependencies without using configured services.
Start learningVerify error contracts and unchanged state
Test useful, stable failure information without leaking internal details or treating every error as equivalent.
Start learning