BOOK DEEP READ · CONTINUOUS DELIVERY · CH 8

Automated Acceptance Testing

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

中文 →

What is this chapter about?

You tap a button, pay, and a confirmation message arrives — someone has to check that the whole chain actually works. The previous chapter's gate only inspected parts: every small piece looks fine on its own. This chapter is about the next gate: assemble the whole machine, run it end to end, and see whether the thing the user actually wanted got built.

An analogy

Think of the final walkthrough on a new apartment. Testing the concrete mix and measuring the rebar — that's parts inspection. The walkthrough is something else: you open every tap to see if water comes out, flip every switch to see if the light turns on, close every door to see if it locks. Every part can pass and the toilet still won't flush, and then nobody can live there.

Here's the counterintuitive bit: the walkthrough checklist is most valuable not on move-in day, but before construction starts. The moment you write it down, both sides discover that "enclosed balcony" meant two different things. Fixing that now costs one sentence; fixing it after the walls are up means knocking walls down.

Why the old world was hard

This job used to be done by people: a room full of them working through a checklist by hand. The trouble is that every change means, in principle, redoing the entire checklist — you touched the payment button, so who can promise signup still works? A manual pass takes days, so the team ships less often; shipping less often piles up more changes, and more changes make trouble more likely. That's the same loop from two chapters ago.

People also get tired doing repetitive checks. They skip. They think "it was fine last time, it's probably fine now." The most tedious work is exactly the work least suited to humans.

How this chapter fixes it

First, write the checklist as something a machine can run — in the language of the business. "A new customer places an order; once payment succeeds, they should receive a confirmation email." That one sentence is both the requirement and the test. Writing it with the customer, the analyst, the developer and the tester in the room is where the vague bits surface.

Second — and this is the real craft of the chapter — separate "what to check" from "how to click it." The thousands of checklist items only say "log in, place an order, pay." One separate layer underneath is the only place that knows where the login button lives and what it's called. Move the button and you change one line in that bottom layer; the thousands of items above don't change at all. Teams whose acceptance tests grow too expensive to keep almost always skipped this cut.

Third, if you can avoid going through the screen, avoid it. Driving the screen is slow and gets tripped by tiny layout tweaks. Talking to the system directly, behind the screen, does the same job ten times faster and far more steadily.

What you get

The main payoff is that people dare to change the code: rerun the whole business flow, see all green, and you'll press the release button. Its real identity isn't "a bug-finding tool" — it's a safety net that makes people willing to move.

It does have a cost: checks like these are inherently slow and expensive, tens of minutes a round at best, so they must always be the minority — most checking belongs at the cheaper gate before this one.

One line to remember

Acceptance tests don't answer "is the code correct?" — they answer "did the thing the user asked for actually get built?" And whether you can afford to keep them depends entirely on whether you separated what to check from how to click it.

Want the actual layering, why record-and-playback is a trap, and whether thousands of end-to-end tests can really run? → Switch to the deep read