contract-testing

Contract-first API development: the contract is the source of truth across DESIGN → DISTILL → DELIVER.

When to use

Entry contract

Exit contract

Invariants

Why this shape

Coupling tests to a live downstream service makes the suite fragile and non-deterministic. Publishing a contract lets consumer and provider evolve independently while guaranteeing interoperability at the boundary.

« Consumer-driven contracts let the consumer specify what it needs from a provider. » — Newman, S., Building Microservices, 2nd ed., 2021.

Allowed customisation

See also