liveBook · Manning

Contract testing

As explained in Vibe Engineering

A testing technique in which a service consumer's expected requests and responses are checked against a service provider's actual behavior.

Contract testing protects service boundaries from silent API drift. A consumer records the requests it sends and responses it expects; the provider verifies that it still delivers them. section 8.5.2

Parser and rendering service

A content management system sends {"markup":"# Hello"} to a rendering service and expects {"html":"<h1>Hello</h1>"}. The contract fails if a change adds, removes, reformats, or changes the meaning of response fields. section 8.5.2

Use the boundary contract to:

  • Catch provider changes that break consumers before deployment. section 8.5.2
  • Coordinate expectations between services, teams, or a current implementation and future AI-generated changes. section 8.5.2
  • Distinguish boundary verification from integration and end-to-end tests, which validate complete system behavior. section 8.5.3

How Vibe Engineering covers it

How deep it goes
Explains consumer-provider expectations through a worked request-response example and identifies breaking changes, without detailing test implementation.
Examples
Uses a content management system, rendering service, markup request, and expected HTML response.
What it assumes
Assumes service boundaries and request-response APIs while distinguishing boundary checks from whole-system tests.
What you can do after
Apply it via Pact-style contracts to detect incompatible provider changes before dependent services silently break.
How it connects
Connects service contracts with Design by Contract, unit testing, integration testing, and end-to-end testing.

Also explained in

Compare how 7 books explain contract testing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.