Subcapability 04 of 05 · Software Engineering & Architecture

Testing Strategy

Test Pyramid with Consumer-Driven Contracts via Pact and Mutation Testing that build genuine confidence to change production code and eliminate the fear ceremony that slows every release.

What is at stake

The pipeline always breaks for a different reason. Tests hold up CI for hours before showing a result. When a bug reaches production, the question is why the test did not catch it. And the answer is always: the test that would have caught this case was never written. The testing strategy grew by accumulation, without criteria for where each type of test adds the most value.

What it is, in practice

High test coverage in a report does not mean real confidence to change. A team with 80% coverage that still fears deploying on Friday has a testing strategy problem, not a coverage problem. Tests concentrated in the wrong pyramid layer provide apparent safety with slow feedback. Fragile tests that break from implementation changes that do not affect behavior create false alarms the team learns to ignore. When the pipeline is always broken, the pipeline stops being a reliable signal.

How we work

Measurable gains

What changes in the result when this subcapability matures.

Frequently asked questions

What is the difference between the Test Pyramid and the Testing Trophy?

The Test Pyramid emphasizes unit tests at the base because they are fast and isolated. The Testing Trophy, proposed by Kent C. Dodds, shifts weight to integration tests because in many modern applications the real failure happens at component boundaries, not in the isolated logic of a function. The choice between them depends on where real defects in your system appear most frequently.

Is TDD worth it for all types of code?

TDD delivers the most value in complex business logic where the test guides design and the interface. In infrastructure code, configuration or simple glue code, the cost of maintaining the test-first cycle exceeds the benefit of emergent design. The right question is: where does interface clarity matter most? At those points, TDD justifies the cost.

What is Consumer-Driven Contract Testing and when to use it?

Consumer-Driven Contract Testing formalizes what each service consumer expects from its API in a versioned contract. The provider continuously verifies that it meets those contracts without needing an integrated environment. The pattern solves the specific microservices risk: a provider change that breaks the consumer being discovered only in the integration environment or in production.

How does Mutation Testing differ from code coverage?

Code coverage measures how many lines the test executes. Mutation Testing measures whether the test would detect a real failure. The framework introduces small mutations in the code (operator swap, condition removal) and verifies whether any test fails. A surviving mutant indicates that the line is executed by the test but the incorrect behavior would not be detected.

How to convince the team that slow CI tests are a strategy problem?

With the cost in engineering time: a 90-minute CI in a team of 20 people making 5 commits a day consumes 150 hours per week waiting for feedback. Part of that cost disappears when the pyramid distribution is corrected, with unit tests in seconds covering most cases and E2E restricted to critical flows. The time-saved-per-week data is the argument that closes the discussion.

Want clarity on where to invest first?

A complete technology capability assessment with an evolution roadmap connected to financial result.