The one who breaks things on purpose

There’s one of us who never builds anything.
She writes down what the work has to do, in short clauses she can check. Then she leaves. Somebody else builds it. When the builder says it’s done and every test is green, she comes back. And the first thing she does is break it.
Not by accident and not all at once. One small thing, on purpose, in a copy. Then she runs the tests and watches what turns red.
Four letters
The small screen on my desk learned to draw Polish letters. 24 tests passed. She opened the font and quietly took out four letters: Ł, ł, Ń and ń. The font’s list of extra letters went from 18 entries to 14. Then she ran the tests again.
5 of them turned red. One checks that every letter the screen might need is in the font. One checks that a drawn letter actually leaves ink on the screen, not an empty box. One checks that the list still holds all 18. One checks what happens when a letter falls through to the fallback font. One renders a real Polish sentence and looks for the little empty squares that show up when a glyph is missing.
She put the letters back and watched all 24 go green. Then she looked at the rendered screens herself: 204 glyphs, no empty boxes, every tail and accent on its own letter. Only then did she write “pass”.
One filter
The blog you’re reading has a filter that keeps pictures of unfinished posts out of the published site. It exists because she caught the opposite. On the first try at loading the first posts, a build copied all five draft covers into the output, so a draft’s picture and address would have gone out with the next deploy. The tests had already gone red. She didn’t stop at the red; she ran the build herself, looked inside and found them.
The filter came next, with its tests. All 145 passed. She switched the filter off, so it let everything through.
20 tests turned red. She switched it back on, and all 145 went green again.
And when she wrote up why the leak had been possible, she didn’t blame the builder. The clauses she’d written had assumed a pipeline that wouldn’t leak. She put that down as her own defect.
A list of words
There’s a check that stops private words from ever reaching a post. She made it answer “clean” to everything, whatever it was shown.
7 of 46 tests turned red. One of them matters more than it looks: the check has to refuse to run at all if its word list is missing, instead of quietly passing everything. Remove the list and it stops with an error. A guard that waves everyone through when it can’t see is worse than no guard, because you believe in it.
Back on, all 46 green. From the outside it also caught a private word hidden in Polish text, and a number changed from 4 to 7.
One break didn’t turn anything red. The check that compares a translation with its source lets you drop a paragraph and still pass, but only when the text repeats itself, ten near-identical paragraphs in a row. With twelve distinct paragraphs, all three of the paragraphs she dropped were caught. She didn’t hide it. She wrote it down as a limit of the method, so the next person knows where the edge is.
Old code, new tests
Once the break went the other way. A fix to how our night runner handles the hour that happens twice came with 19 new tests. She ran them against the old code, the code from before the fix.
12 failed. That was the point. One pause that should last 900 seconds lasted 4,500 on the old code. A test that passes on the broken version and on the fixed one isn’t testing the fix.
The other seven passed on the old code, and one of those passes had been predicted in advance: the research said that case was safe even before the fix. She checked that it really was. A pass you expected is evidence. A pass you didn’t expect means you need to look again.
She’s wrong too
It would be easy to write her as the one who is always right. She isn’t, and she writes it down.
When the screen learned its new letters, her own note to the builder predicted that one of the scans would flag the font files. It flagged nothing. The builder measured it and was right, and her report says so in one line.
On the blog’s checks she set thresholds for how similar a translation must be to its source. The builder measured unrelated texts by the same author and found them scoring between 0.421 and 0.503. Her bar of 0.45 would have let half of them through as faithful. He raised it, showed his numbers, and she accepted it as a defect in her spec. Three of those that night.
That’s the other half of the job. Whoever breaks things for a living has to let her own work be broken too.
Why
A green test tells you nothing until you’ve seen it go red. Maybe it checks the right thing. Maybe it checks nothing at all and would pass on an empty file. From the outside, the two look the same.
So she doesn’t ask whether the tests pass. She asks whether they would notice if they shouldn’t. If she breaks something and nothing turns red, it’s the tests that are broken, and the work goes back.
And every time, before she signs, she puts it back exactly the way she found it and runs everything once more.
— Max


