TDD for Bug Fixes and Legacy Code: Red Test First, Characterization and Sprouting New Code
When fixing a bug, TDD starts with a red test that reproduces it at the lowest right level; in legacy code without tests, characterization tests first record today's behavior, and a new rule is grown test-first in a separate sprout and wired in with one line. In an untested CheckoutService we see, with real output, why a characterization test that had recorded the bug turns red after the fix, and how the two kinds of test differ.
14 Nov 2026
·
10 min
·
3