BOOKS DEEP-READ · CONTINUOUS DELIVERY · CH 4

Implementing a Testing Strategy

Continuous Delivery · Ch 4 · Jez Humble & David Farley · 2010

中文 →

What is this chapter about?

Before any app update ships, somebody has to confirm it isn't broken. The catch: there are thousands of things to confirm — who confirms them, and when? Chapter 4 of Continuous Delivery doesn't answer "test more." It answers: split "testing" into several completely different jobs, and give each one to different people at different moments.

An analogy

Putting up a building involves three kinds of checking. First: the bricklayer runs a spirit level over each stretch of wall — takes seconds, and tells you exactly which brick is off. Second: once a floor is capped, someone walks it and checks the water and the wiring — slower, but it catches what no single brick could reveal. Third: when the building is done you bring in a veteran inspector for two days, and he opens the cupboard you never thought to open and says "you can't turn around in this doorway carrying luggage."

All three are necessary, and their economics are wildly different. The scary part is that many teams only have the third one — nobody levelled a wall for eighteen storeys, and when the inspector says "it started leaning at floor three," you're in demolition territory.

Why the old world was hard

The old default: programmers finish, throw it over the wall to a separate test team, and in the last few days everyone works through a checklist of a few hundred items by hand. Three things follow inevitably. One, feedback is far too late — the problem was planted three weeks ago, and whoever wrote it has long forgotten what they were thinking. Two, the cost only climbs — more features means a longer checklist, while releases are supposed to get faster. Three, the work can't be banked — you'll click through it all again next round, and nobody can say which items got skipped.

The core idea

The chapter re-sorts testing by two questions: is this check trying to help the team not get it wrong, or trying to find out what's wrong with the thing already built? And does it care about business correctness, or technical soundness? Two by two, that's four kinds of work.

Once you sort them, the crucial dividing line appears by itself: checks that are identical every time and answer yes-or-no go to machines, which run them thousands of times a day; checks that need curiosity and experience to "find the problem nobody thought of" stay with people. Getting those two backwards is what's actually wrong with most teams: the machines idle while humans click through the checklist again.

So how do you divide it up

The machine's half needs layering of its own: do lots of the small fast checks (thousands, done in minutes, and a red one tells you which brick), keep the slow whole-system checks few and precious (dozens, covering "can a user actually get their money out") — because whole-system checks are slow, expensive, and every so often fail for no reason at all; pile up enough of them and nobody believes any of them.

The human half is the mirror image: hand off all the clicking-through-a-checklist, and spend the reclaimed time wandering the product like a real user to see what falls out — a machine only ever checks the handful of things you wrote down in advance.

One honest cost: automated tests are code too — they must be written and fed. Written badly, they cry wolf daily, slow everyone down, and end up ignored by the whole team.

One line to remember

Testing isn't the last step before release; it's a bundle of different jobs running from day one. Give the repeatable ones to machines and do many small ones rather than a few big ones; leave the imaginative ones to people — you need both, and neither can stand in for the other.

Want the quadrants, the ratios, the comparison tables and the pipeline diagram? → Switch to the deep read