BOOKS DEEP-READ · CONTINUOUS DELIVERY · CH 9

Testing Non-Functional Requirements

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

中文 →

What is this chapter about?

The moment concert tickets go on sale, the app spins and then tells you the system is busy. The features are all there — the button works, the order flow works — it simply cannot take that many people at once. Chapter 9 of Continuous Delivery is about that family of requirements: fast enough, sturdy enough, not trivially hackable. And about turning them into something a machine checks every day, rather than something you discover on launch day.

An analogy first

A building has two kinds of requirements. One kind is how many rooms there are and whether the kitchen works — you can see at a glance whether it was done. The other kind is how many people the floor can hold, how well it blocks sound, how long it survives a fire. The second kind cannot be added during decoration; it was settled the day the foundation was poured. And to verify it you have to actually put a hundred people on that floor — reading the blueprint is not enough. This chapter is about verifying software's second kind.

Why the old world struggled

The hard part is not the testing. It is that these requirements are usually written as a sentence nobody can judge: the system should be fast, it should support a lot of users. With no way to say whether you met it, the work slides to the very end — a few people clicking around the week before launch, or simply letting real users find out. By the time it fails, the cause usually sits in the deepest structure, and fixing it means redoing the foundation.

The core idea

The chapter's method is two plain steps.

One: pin the sentence down. "Should be fast" becomes "with a thousand people ordering at once, ninety-five out of a hundred see a result within 0.8 seconds, and it holds for a full hour". Now it is not a wish; it is a question with an answer.

Two: take the scripts you already have and run thousands of copies. The previous chapter already produced scripts where a machine walks through the ordering flow by itself. Load testing needs no new suite: run the same scripts in parallel, by the thousand, and watch where the system starts to crawl and where it falls over. The machine runs it on a schedule and turns the light red when it fails — no different in kind from any other test.

The biggest trap

The rehearsal room is not the venue. Few companies pay for a second full set of machines just for load tests, so a team measures one small box and multiplies by thirty. But the small box holds a hundred thousand rows where production holds a billion; on the small box everything sits in cache, in production it has to go to disk. That multiplication is almost always wrong. The book's stance is refreshingly plain: the closer the environment is to production, the more the numbers mean. When it is not close, use it to ask "did we get slower than last week" — never to promise "here is what we can take".

The honest cost: these tests are slow and expensive — tens of minutes per round, and a whole set of machines — so they must not sit in the path of every single commit.

Remember this

Turn "fast enough" and "sturdy enough" into a sentence with numbers that can be judged right or wrong, reuse your existing test scripts to make it a pipeline stage that can go red — and remember that a shrunken environment shows you trends, never promises.

Want the capacity-knee curve, the injector architecture and the trade-off tables? → Switch to the deep read