CodePark/ questions / Contract & end-to-end tests
START PRACTICINGPRACTICE
Backend question · Backend testing › Contract & end-to-end tests

What is the main advantage of consumer-driven contract tests over end-to-end tests that run all services together?

They give fast, isolated feedback on API compatibility for each service without deploying the whole system

Contract tests give fast, isolated feedback on API compatibility. They check that requests and responses match what each consumer relies on. Each side is tested on its own, so the tests are fast, and they show which service broke the agreement.

They do not "prove the whole business flow works across all services": they don't test whole user journeys. They also don't "replace the provider's own functional tests", because they don't check business logic. And "they need no running provider at all, on either side" is wrong: provider verification does run against the real provider.