liveBook · Manning

Chapter 5: Testing as waste prevention

What you will learn in chapter 5 of Build High Value Software Systems

The chapter introduction shows how tests can either prevent rework or create waste, depending on the risks they protect and the costs they impose.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The chapter introduction shows how tests can either prevent rework or create waste, depending on the risks they protect and the costs they impose.

Key terms: risk, rework, value, confidence, internal structure, business outcomes, mocks, overproduced test, flaky test, red builds

5.1 Value-add versus wasteful testing

This section distinguishes tests that protect valuable behavior from tests that create waste, using test-suite flow and a payment-processor refactor to show the difference.

Key terms: value, real risk, defect, behavior, every commit, overproduction, waiting, motion, overprocessing, inventory

5.2 Tests as design constraints

This section explains how tests written before implementation constrain design and prevent defects more cheaply than tests added afterward.

Key terms: upstream prevention, downstream detection, building quality in, test-first, design constraint, behavior, AI, unit tests, implementation policing, contracts

5.3 Structuring test layers around risk

This section explains how to place tests in layers according to the failures they can contain, the value at risk, and the cost of detecting defects late.

Key terms: risk, impact, probability, detection time, unit tests, integration tests, end-to-end tests, containment zones, testing pyramid, high-probability logic failures

5.4 Identifying flaky tests as flow-blocking defects

Defines flaky tests and explains how their unreliable results turn test failures into ambiguous signals that disrupt development flow.

Key terms: flaky test, nondeterministic test, feedback loop, red builds, defect

5.4.1 When signals lose meaning

This section shows how a flaky test can erode trust in CI failures, change developer behavior, and create waste beyond the cost of reruns.

Key terms: red builds, flaky tests, Andon cord, expiration worker, pending, flaky, Waiting, Motion, Overprocessing, Inventory

5.4.2 Flow metrics

This section uses flow metrics to show how flaky tests and waiting extend delivery time, encourage batching, and reveal opportunities to improve the system.

Key terms: lead time, cycle time, activity time, touch time, flakiness, single-piece flow, batching, variability, activity ratio, Gemba

5.5 Inflating coverage without protecting value

This section shows why high test coverage can still create waste, and how to direct AI-generated tests toward business contracts rather than implementation details.

Key terms: structural exploration, path coverage, business value, overproduction, business contract, pin the wiring, pricing rule, flow damage, value filter, risk model

5.6 Deciding what not to automate

Automation is valuable when it shortens feedback loops and catches defects before they travel further.

Key terms: automation, feedback loops, defects

5.6.1 Waste elimination and creation

This section shows how to decide whether a test is worth automating by comparing the waste it prevents with the waste it creates.

Key terms: automation, waste, flow, inventory, meaningful contracts, checkout service, payment gateway, deterministic, business logic, overautomation

5.6.2 Automation as a value stream

This section treats CI automation as a value stream whose stages should protect meaningful risks without creating avoidable delays.

Key terms: CI pipeline, value stream, deployable, verified artifact, granularity, layer, known risk, meaningful failures, bottleneck

5.7 Coverage metrics: Expose risk, not inflate confidence

This section shows why high code coverage can coexist with unprotected business behavior and how to use coverage to find meaningful testing gaps.

Key terms: code coverage, business contract, test protected intent, coverage, high-impact modules, value lens, blind spots

5.8 Exercise: Expose and reduce one source of testing waste

This exercise uses a real commit to make testing waste visible, remove one source of it, and measure the effect.

Key terms: cycle time, activity time, activity ratio, waiting, flaky tests, meaningful value, automated checks, concrete intervention, testing waste, red builds

5.9 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 4: Writing Lean code Chapter 6: Flow in your development cycle →

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.