← All posts
LinkedIn
  • #Micro-frontends
  • #Architecture
  • #Frontend
  • #Leadership

Contract Testing: Make the Coupling Explicit

When something breaks after a deploy, the usual suspects are:

  • A field that got renamed
  • A response shape that quietly changed
  • An event payload no one updated the consumer about

This happens at every kind of boundary:

  • A frontend consuming a backend API
  • A micro frontend relying on a shared service
  • A product team using a component from a design system
  • An app depending on a shared library

We call these integration bugs. They're not.

They're ownership gaps — places where two teams shared an assumption instead of an agreement.

This is where contract testing fits in. Not as a testing strategy. As an architectural boundary tool.

Here's how it works:

The consumer (whatever depends on the other side) defines a contract — what it expects to receive.
The provider (whatever is on the other end) runs that contract as part of its own CI.
If the provider breaks the contract, it knows before it ships.

No big integration test suite. No shared staging environment dependencies. No "works on my machine" coordination calls.

Each team stays autonomous. The contract is the coordination mechanism.

The real shift isn't technical. It's organizational.

Contract testing forces teams to make their coupling explicit — to own the interface, not just the implementation. And when you make coupling explicit, you can govern it, evolve it, and break it on purpose instead of by accident.

Most teams skip this. They rely on e2e tests to catch what contracts should have prevented.

The result: slow feedback loops, flaky test suites, and integration bugs that only show up in production.

Testing across boundaries isn't a QA concern.
It's an architectural decision about how teams agree to change.

Slides

  1. Most boundary bugs aren't integration bugs. They're broken assumptions nobody wrote down.
  2. Every component that depends on another makes promises. The question is whether anyone is checking them.
  3. Implicit coupling: "We assumed they'd send that field." Explicit agreement: "We tested that they do."
  4. Contract testing doesn't test behavior. It tests the boundary between two teams.
  5. Consumer defines what it needs. Provider proves it delivers. Both stay independent.
  6. Contract testing replaces implicit coupling with explicit agreements. That's not a testing decision — it's an architectural one.
See more on LinkedIn ↗