liveBook · Manning

Test layer

As explained in Build High Value Software Systems

A level in a testing strategy that checks software for a particular class of failures at a characteristic speed and scope.

A test layer is a containment zone: it defines how far a defect can travel before detection. Match the layer to the risk and the cost of finding a failure late, rather than aiming for coverage alone. section 5.3 section 5.9

Match the containment zone to the failure being protected against:

  • Unit tests check business rules, calculations, transformations, and invariants in milliseconds. section 5.3
  • Integration tests check collaboration across boundaries—such as persistence, API contracts, and authentication—in seconds. section 5.3
  • End-to-end tests protect critical user journeys in minutes; production may reveal failures hours or days later. section 5.3

Choosing a layer by risk

For a login-to-calculation journey, test authentication and database behavior at the integration layer, calculation rules with unit tests, and only the critical customer-visible flow end to end. section 5.3

Figure 5.2 Comparing the standard testing pyramid with a Lean interpretation of the same structure. The Lean view keeps the same shape but changes the intent.

The pyramid keeps its familiar shape but shifts the emphasis from test distribution to each layer’s containment role. section 5.3

How Build High Value Software Systems covers it

How deep it goes
Distinguishes unit, integration, end-to-end, and production detection by scope and timing.
Examples
Uses business calculations, authentication, database retrieval, critical user journeys, and logging utilities as risk-assessment cases.
What you can do after
Evaluate failure impact and likelihood to choose which layer should protect each behavior.
How it connects
Links risk assessment with unit testing, integration testing, end-to-end testing, and the testing pyramid.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build High Value Software Systems. The section links point to the parts of the book it draws on.