consumer-driven contract testing
A contract-testing approach in which each consumer records the requests and responses it depends on, and the provider verifies it still satisfies all of them.
In more detail
It protects the fields and statuses real callers use rather than every detail of the implementation, so providers can change freely inside those promises. Tools such as Pact record consumer expectations and replay them against the provider.
Related terms
- contract testing — Testing that an API’s real behaviour matches its written contract, and that its callers only rely on what the contract promises.
- mock — A test double that stands in for a real dependency and checks that the code under test calls it in the expected way.
Taught in
- Mocking Dependencies — Modern API Architecture: REST, GraphQL & gRPC
- Contract Testing — Modern API Architecture: REST, GraphQL & gRPC