liveBook · Manning

Contract testing

Contract testing is a software testing technique that verifies whether interacting components conform to an agreed interface, message, or behavioral contract.

How 4 Manning books explain it

Contract Testing in Action

A software testing technique that verifies compatibility between a service provider and its consumers through an agreed contract of requests and responses.

How it is used
Protects connected systems from incompatible request and response changes before deployment, especially across microservices.
How deep it goes
Explains consumer contract generation and provider verification workflows, while deferring detailed implementation and storage approaches.
Examples
Uses a User API, web and mobile consumers, renamed fullName fields, mock providers, shared brokers, and GraphQL services.
What you can do after
Apply it via Pact to generate consumer contracts, verify providers, publish results, and gate compatible deployments.

Read how Contract Testing in Action explains contract testing →

Secure APIs

Contract testing is a testing approach that verifies an API implementation conforms to an agreed API contract or specification.

How it is used
Uses an API specification to verify that server behavior remains compliant and to detect drift during security testing.
How deep it goes
Explains drift, generated fuzz cases, checks, and security findings, but stops short of business-layer coverage.
Examples
Uses orphan endpoints, undocumented parameters, pagination limits, Schemathesis commands, and malformed payload failures as concrete examples.
What you can do after
Diagnose API drift and implementation weaknesses by running Schemathesis checks against an OpenAPI specification.

Read how Secure APIs explains contract testing →

Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform

A contract test verifies that an integration between components conforms to an agreed interface or behavioral contract.

How it is used
Enforces agreements between infrastructure modules so dependency changes do not silently break downstream configuration.
How deep it goes
Defines static input-output comparison, demonstrates assertions, and places tests in a release workflow without detailing runtime behavior.
Examples
Uses a network facade, expected network name and CIDR range, pytest fixtures, and a database module consuming a network ID.
What you can do after
Diagnose dependency mismatches before deployment and preserve module integrations during changes or tool migrations.

Read how Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform explains contract testing →

Effective Platform Engineering

A contract test verifies that an implementation conforms to the interface or behavioral contract expected by its consumers.

How it is used
Protects reliability and trust as platform teams and consumers evolve independently.
How deep it goes
Defines platform-consumer boundaries and executable architectural checks, but stops short of a full contract-test implementation.
Examples
Uses platform-team boundaries, repository-datastore separation, layered API access, and cloud-specific API isolation.
What you can do after
Apply it via fitness functions to detect incorrect layer access and make platform evolution more predictable.

Read how Effective Platform Engineering explains contract testing →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.