dev-tools

Contract Testing

Contract testing verifies that two services which talk to each other — say a frontend and an API, or two microservices — agree on the shape of their interaction, without spinning up both in a full integration environment. The "consumer" records its expectations (this endpoint, these fields, these types) as a contract; the "provider" then runs a test proving it still satisfies that contract. Tools like Pact broker these contracts between teams. The value is catching breaking API changes at build time instead of in production: if the provider renames a field the consumer depends on, the provider's contract test fails before deploy. For SaaS builders with separate frontend/backend or multiple services, this fills the gap between fast-but-shallow unit tests and slow-but-brittle end-to-end tests — you get integration confidence without the flakiness of standing up every dependency. It pairs closely with API versioning: contracts make it obvious, in CI, exactly which consumers a change would break.

Related terms

More Dev Tools terms