Skip to main content

Checkpoint: Test & Repair

intermediate20 min readLesson 104 of 143

Prove the debugging loop: diagnose failures from evidence, write the regression test, and fix the cause.

This checkpoint compresses the repair workflow into runnable form: each challenge hands you evidence (a test failure, a stack trace pattern, a spy's call log) and grades whether your diagnosis and fix are correct — the same reasoning you'll do in a real editor with a real broken app.

The habit being graded

Testing is not a module you finish; it is a reflex you keep. The checkpoint's broken code asks you to reproduce before theorizing, to write the failing test before the fix, and to leave the test behind as documentation. That sequence — red, green, commit — is the whole discipline in three moves, and it is what your teammates will silently judge you on.

The method under the pressure

Debugging has a shape: make it fail on demand, bisect the difference between "works" and "does not", form one hypothesis at a time, and let evidence — not hope — choose the next move. Every broken snippet in this checkpoint follows that shape. If you find yourself changing three things at once, stop: that is guessing, and guessing is how two bugs are born from one.

Leave the tests behind. A fix without a regression test is a rumor; the next person to touch this code (you, in three months) needs proof it stays fixed.