Glossary term
What is contract test? Meaning for developers
In Backend in Depth
A test that checks the shape of requests and responses between two systems. A rename then cannot break the other side without a warning.
Learn it properly · Backend in DepthLesson 11: Testing an API: Unit, Integration and ContractWhere to spend your testing effort in a backend, testing against a real database, and contract tests between the frontend and the API.In Testing From Zero
A test that checks two parts of a system agree on the shape of their messages.
Learn it properly · Testing From ZeroLesson 3: Integration and API TestsTesting an Express API in-process, test database strategies, contracts, webhooks and queues.In API Design
A test that calls the real API and checks the response against the written contract to catch drift.
Learn it properly · API DesignLesson 7: Documenting APIs: OpenAPI, Contracts and TestingWrite an OpenAPI file, generate docs, validate requests and responses against it, contract tests and mock servers.