Engineering Practice
Contract testing: multiple-choice review
Six questions that cut across the whole unit. Each one mirrors a decision you actually make on a platform of services that deploy independently — not a definition to recite, but a tradeoff to weigh under real coupling.
Confirm you can connect the failure of e2e at scale, consumer-driven recording, provider verification, the can-i-deploy gate, and the limits — the synthesis the individual lessons built toward.
Why does a shared end-to-end environment's reliability degrade as a platform adds services, and what does that imply about the fix?
A provider returns 40 fields; a consumer reads 4. Why is recording only those 4 (matched by type) the right scope for a consumer-driven contract?
During provider verification, the provider adds three new fields to a response the consumer's pact never mentions, but also renames one field the consumer reads. What is the verification outcome?
An interaction's `given` is 'a price with id 42 exists', but the provider team never wrote a handler for that state. Verification fails. How should a senior read this failure?
A consumer's new pact is verified green against the provider's latest CI build, the pipeline is all green, so it deploys — and prod errors immediately. What was the wrong question, and what asks the right one?
Every contract passes, yet the provider returned a structurally-perfect `amount_cents: -500` for a refund and checkout charged a negative balance. What does this reveal about contract testing's place in the strategy?
The unit’s through-line is one pipeline of decisions: e2e collapses because a shared environment’s health is the product of every service’s uptime, so push compatibility down to a per-edge test; the consumer records actual usage by type into a pact; the provider verifies by replaying each interaction against the real service, checking the minimal expected shape with provider states seeding the data; can-i-deploy turns the verification matrix into a deploy gate by crossing your git-SHA version against what’s actually deployed; and the hard limit — contracts test shape, never semantics — is why a thin layer of real e2e smoke tests survives. Every wrong answer here is a real team’s wrong turn.