Repaso
EspaƱol
TestingAdvancedTST-10

What problem does consumer-driven contract testing (e.g. Pact) solve?

Options

  1. It runs load tests against the deployed service
  2. It checks providers still meet their consumers' needs (Correct option)
  3. It compares UI screenshots to find the changes
  4. It tests the database migrations of a service

Answer

Verifying that a provider API still satisfies what its consumers expect, without running full end-to-end environments

Why

Service A (consumer) calls service B (provider). If B renames a field, A breaks, and maybe nobody notices until production.

With contract tests, A records exactly which requests it sends and which response fields it needs (the contract). B's CI verifies that it still satisfies every consumer's contract.

It catches breaking API changes early without a full environment of all services.

Remember

Contract tests = provider checks it still meets consumers' expectations.

Key terms

Practice this question in Repaso