Book Deep-Read · Software Engineering at Google · Chapter 14

Larger Testing

Software Engineering at Google · Ch 14 · Larger Testing · Joseph Graves · 2020

中文 →

What is this chapter about?

The maps, email and search you use every day are dozens of programs calling each other. Engineers check each small part on its own — but every part can pass and the whole thing can still break once it's put together. This chapter is about how to check the assembled whole without letting those checks grind everyone to a halt.

An analogy

When a car is built, every bolt and tire is inspected at the factory: that's the "parts check". But nobody hands over a car without a test drive. Was something assembled wrong? Was the spec sheet filled in wrong? Does it shake on the highway? Only driving the whole car tells you. A test drive costs far more than checking a bolt, takes longer, and can be thrown off by weather and traffic — so you can't do one every time you tighten a bolt.

Why the old world was hard

Checking only the parts misses several kinds of trouble: the stand-in for a partner program behaves differently from the real one; the program is fine but its settings file is wrong — Google says that is the number-one cause of its major outages; everything works until millions of people show up at once; and users always find uses nobody imagined. Yet whole-car tests are slow, pass one day and fail the next, and span several teams, so when one breaks nobody knows who should fix it, and it gets abandoned.

The core intuition

What it buys you / how to choose

Parts checks are the foundation; whole-car tests fill the gaps, each covering a different kind of risk. The key is that every whole-car test has a clear owner and says plainly what broke, or people simply skip it. The honest cost: these tests take money and people to build, need constant upkeep, and get harder to maintain the bigger they are.

Remember it in one line

Every part passing doesn't mean the car drives: larger tests buy realism, but they must be kept small and owned, or they're just an expensive ornament.

Want the fidelity spectrum, the shapes a system under test can take, how record/replay lets a large test spawn small ones, why A/B diff tests are Google's most common large test, and how to fight slowness and flakiness? → Switch to Deep read