Scrivio Interview library
LeadershipPrincipal7 min read · updated 12 November 2026

Over several years, your company moved from a shared integration environment to contract tests between 200 services. What did you gain and lose, and how do you keep the contract system healthy?

We gained independent deployments, much faster feedback on breaking changes, and an end to teams fighting over a shared environment. We lost some confidence in end-to-end behaviour, so a small end-to-end smoke suite is still needed for real wiring and critical journeys. The contract system itself decays: contracts go stale when consumers stop using fields, and over-specified contracts get copied without review. Keeping it healthy takes a well-run broker, deployment checks, clear ownership, regular removal of unused contracts, and measuring incidents caused by integration breaks to show whether contracts still work.

Why this question is asked

Moving 200 services from a shared integration environment to contract tests is one of the larger changes an engineering organisation can make to how it ships software, and several years later is the right time to judge it honestly. Interviewers ask this retrospective question at the most senior level because it tests whether we can see both sides of a decision we probably championed, and whether we know that a testing system, like any system, needs maintenance. In this answer, we will go through what was gained, what was lost and how we compensate, how a contract system decays over time, and the practices and metrics that keep it healthy.

1What We Gained

The biggest gain is independent deployment. In the shared environment days, a release meant deploying into a crowded environment, waiting for a long suite, and coordinating with teams whose changes were in the same batch. With contracts and a deployment gate, a team can deploy whenever its own pipeline and the broker say its version is compatible with what is running. Deployment frequency typically rises several times over, and lead time drops from days to hours.

Feedback also became faster and clearer. A breaking change is found in the provider's pipeline within minutes, with the name of the consumer that would break and the exact interaction, instead of days later as a vague failure in a shared environment. And a whole class of conflict disappeared: no more broken environments blocking 40 teams, no more test data trampled by another team, no more arguments about whose deployment broke staging.

2What We Lost and How We Compensate

We lost some confidence in end-to-end behaviour. Contracts check that each pair of services agrees on the shape of their interactions. They do not check that a journey across six services produces the right business result, that the real deployed configuration, URLs, certificates and permissions, is correct, or that timeouts and retries interact well under real latency. The shared environment, for all its problems, exercised those things by accident.

So we keep a small end-to-end smoke suite for the critical journeys, such as sign-up, checkout and payment, run against a deployed environment after deployment, and we invest in what replaced the accidental coverage: good observability with distributed tracing in production, synthetic monitoring of critical journeys, and progressive delivery with canary releases and fast rollback. We also lost the shared environment as a place for exploratory and manual testing, which some teams missed; ephemeral environments created on demand filled that gap.

Shared integration environment versus contract tests, years later
AspectShared environmentContract tests
DeploymentBatched, coordinatedIndependent, gated by the broker
Feedback on a breaking changeDays, vagueMinutes, names the consumer
Environment conflictsConstantRare
Confidence in whole journeysModerate, by accidentNeeds a smoke suite and monitoring
Real wiring and configExercisedNot covered; smoke tests and canaries
Maintenance burdenEnvironment upkeepContract hygiene and ownership
The trade: much faster, independent delivery for a deliberate investment in end-to-end checks and contract hygiene.

3How the Contract System Decays

A contract system looks healthy for the first year and then slowly decays if nobody looks after it. The first kind of decay is staleness. A consumer stops reading a field, or stops calling an endpoint altogether, but its contract still mentions it. The provider remains blocked from removing that field, for no reason. Multiply by 200 services and providers carry years of fields that nobody uses, simply because contracts say so.

The second kind is copying. A new consumer team copies an existing team's contract as a starting point, without reviewing it. The copy includes fields the new consumer never reads, exact values instead of type matchers, and provider states that no longer make sense. Over-specified contracts make providers' builds fail on harmless changes, and teams start to see contract tests as an obstacle rather than a safety net.

The third is ownership drift. Teams reorganise, services change hands, and contracts end up with no clear owner. A failing verification then goes to a team that does not know the consumer, and the quickest fix, disabling the verification or adding an exception, wins. Each of these decays is small, but together they erode trust in the system the same way flaky tests erode trust in a build.

4Keeping the System Healthy

The broker is the centre of the system and must be run like production infrastructure, with backups, access control and an owning team, because every deployment depends on it. Deployment checks stay mandatory for every service; an exception process exists for emergencies, but each exception is logged and reviewed.

Ownership is explicit: every consumer and provider in the broker maps to an owning team, kept in sync with the service catalogue, and verification failures are routed to the provider team with the consumer team's contact. New contracts are reviewed like code, with the guideline that a contract states only the fields the consumer reads, with type matchers rather than exact values.

Unused contracts are removed regularly. The broker knows which consumer versions are deployed in which environments, so providers verify only contracts from versions that are actually deployed or released, and contracts from old versions drop out on their own. For fields, a periodic review compares contracts with what consumers actually read, using code search or runtime data, and removes the ones nobody uses. A quarterly report of the oldest unverified, unowned or never-changed contracts gives teams a short list to clean up.

Step throughQuarterly contract health review
  1. Export broker dataContracts, versions, owners, verification history
  2. Every contract has an owning team?
    YesCheck usageNoAssign an owner from the service catalogue
  3. Consumer version still deployed?
    YesCheck fields against real usageNoDrop from verification
  4. Remove fields and interactions nobody readsUnblocks provider changes
  5. Report trends to engineering leadershipUnowned, stale and exception counts

5 steps in order. Play them, or step through them one at a time.

5Measuring Whether Contracts Still Work

The final test of the system is outcomes. I would track incidents whose root cause was an integration break between services, such as a renamed field, a changed event format or an incompatible status code, and look at each one: was the interaction covered by a contract, and if so, why did the contract not catch it? Gaps found this way, perhaps an event stream never covered or a contract that matched too loosely, are fed back into the standard.

Alongside incidents, I would watch deployment frequency and lead time, the number of deployment gate exceptions, verification failure rates per provider, and the age of contracts. If integration incidents stay low while deployments stay frequent, contracts are doing their job. If exceptions and disabled verifications creep up, the system is decaying and needs attention before the incidents follow.

6Follow-up questions

Would you go back to a shared integration environment?

No, but I would not pretend contracts cover everything either. The right end state is contracts for interface compatibility, a small smoke suite and synthetic monitoring for journeys, and progressive delivery with good observability to catch what testing cannot. A shared environment as the main gate would bring back batching and conflicts.

How do you stop contract tests from slowing providers down?

Keep contracts minimal and loosely matched, use pending contracts so new expectations do not immediately block providers, verify only deployed or released consumer versions, and make verification part of the normal test stage with good caching. A provider that spends a lot of time on contract failures usually has over-specified or stale contracts, which the health review fixes.

What is the single most important practice for long-term health?

Clear ownership. Almost every form of decay, stale contracts, unreviewed copies, disabled verifications, comes from contracts that nobody feels responsible for. When every contract has an owning team and failures reach the right people quickly, the other practices are easy to sustain.

7Conclusion

In this answer, we looked back at several years of contract testing between 200 services. We gained independent deployments, fast and precise feedback on breaking changes, and an end to environment conflicts, and we lost some end-to-end confidence, which a small smoke suite, monitoring and progressive delivery make up for. Contract systems decay through stale contracts, unreviewed copies and ownership drift, so we keep them healthy with a well-run broker, mandatory deployment checks, explicit ownership, regular removal of unused contracts and fields, and by measuring integration incidents to see whether contracts still catch what they should.

What to say in the interviewAbout 100 seconds aloud

Open with

Looking back, the main gain was independent deployment. Teams deploy when their pipeline and the broker say they're compatible, instead of batching into a crowded shared environment, so deployment frequency went up and lead time went down a lot.

Then, if they want more

Feedback is also faster and clearer: a breaking change fails the provider's pipeline in minutes and names the consumer, instead of a vague staging failure days later, and the constant fights over a broken shared environment went away. What we lost is some end-to-end confidence.

Contracts check the shape of each pairwise interaction, not whether a journey across six services gives the right result, and not real deployed configuration, so we kept a small smoke suite for critical journeys and leaned on tracing, synthetic monitoring and canary releases. The contract system itself decays if it's not maintained.

Contracts go stale when consumers stop using fields, which blocks providers for nothing; new teams copy contracts without review, so they're over-specified with exact values; and ownership drifts after reorganisations, so failing verifications get disabled.

To keep it healthy, I run the broker as production infrastructure, keep the can-i-deploy gate mandatory with logged exceptions, map every pacticipant to an owning team, review contracts like code, verify only deployed or released consumer versions, and do a quarterly cleanup of unused fields and unowned contracts.

And I measure integration incidents, checking for each one why contracts didn't catch it, plus gate exceptions and lead time.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Over several years, your company moved from a shared integration environment to contract...": https://scrivio-interview-library.netlify.app/java/test-strategy/444cc34c37/