Contract test
A test of agreed messages between a consumer and a provider at an application interface.
Check the shared interface expectation
A contract test checks whether messages between applications conform to the agreed interface contract. Consumer and provider can be tested separately. Consumer-driven contracts capture interactions actually needed and verify them against the provider too.
In a fictional example, a report view needs orderId and status from a job response. The test checks the agreed response for this case; relevant error cases belong in it when the consumer relies on them. A simulated provider alone, without verification against the provider, does not confirm the real interface. A contract test also proves neither correct job storage nor effective access isolation nor the complete user workflow. Complementary checks are needed for those.
Sources
Related terms
- APIAn API defines how software can use functions or data offered by other software.
- MicroservicesAn architecture of bounded services intended to evolve, operate and deploy as independently as practical.
- Backward compatibilityA new version continues supporting agreed existing usage without requiring changes to existing consumers.
- Breaking changeA change that prevents previously supported consumers or uses from working as agreed.
- Test coverageThe share of an explicitly defined set, such as executable statements or requirements, that has been tested.
- LinterA tool that examines code for particular problems using configured rules.
Your project with ASES
Describe your project to us. We will get back to you with an initial assessment.