BOOKS DEEP-READ · CONTINUOUS DELIVERY · CH 3

Continuous Integration

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

中文 →

What is this chapter about?

Software isn't written by one person. It's a dozen or fifty people changing the same pile of stuff at the same time. Which raises the question: if everyone works separately, how does it all come back together? That's what Chapter 3 of Continuous Delivery is about — and its answer is slightly counter-intuitive: don't save it up. Merge every day.

An analogy

Five people are co-writing a book, a few chapters each. Option one: everyone writes alone for three months, then you spend the last week stitching it together. You can picture how that goes — a character dies in chapter three and is alive again in chapter seven. Nobody can tell you in advance how painful that stitching week will be, because nobody knows how many contradictions are buried in there.

Option two: every day before going home, each writer folds their day's pages into the one shared manuscript, and the whole thing gets read start to finish right then. If it doesn't read straight, everyone stops and fixes it. Now each batch of contradictions is only one day's worth — small enough to settle on the spot. Continuous integration is option two.

Why the old way is hard

So why do people save it up? Because merging is annoying, and saving it up feels more productive — finish the thing in front of you first. But contradictions don't disappear because you're not looking at them; they just grow quietly in the dark. Worse: under option one the manuscript can't be assembled and can't be handed over for most of its life. Only in the short window after stitching is it any good — and you never know how long the stitching will take.

The core idea

This chapter wants to flip that default: the manuscript should read straight and be deliverable at any moment, breaking occasionally and getting fixed at once. Two rules do it.

First: everyone folds their changes into the single shared version every day, and folding it in triggers an automatic read-through of the whole thing. Second, and this is the part most teams can't manage: the moment that check fails, everyone stops what they're doing and fixes it, and nobody adds anything new until it's fixed. It's the factory line where anyone who spots a defect can pull the cord and halt everything — sounds like lost output, but it's exactly because you can afford to stop that defects never travel all the way to the customer. And if it can't be fixed, there's a fallback: go back to yesterday's version, the one that worked.

What you get

Software goes from "broken most of the time" to "working most of the time," and when something does break, the suspects are just the last small step. The honest cost: this takes a whole team holding a discipline for years — it's a habit, not something you get by installing a tool. Once people get used to ignoring that red light, the whole thing decays into a dashboard nobody reads.

Remember one thing

Rather than saving up three months and merging once, painfully: merge every day, and check the whole thing right after every merge. If the check fails, everyone stops and fixes it first. The default state of software should be "it works."

Want the actual practices, time budgets, comparison tables and diagrams? → Switch to the deep read