Loading lesson…
Level 1 · Apprentice0 XP
Old code without tests is changed safely by adding tests at the seams first.
Step 1 / 6
ProblemA 4,000-line billing class, no tests, written by people who left. Every change is a gamble, so people copy it and add 'billing2'. Now there are two.
← → step
Before this: Refactor safely
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Choose an untested function you are afraid to change. Write three characterization tests that record its current outputs. Then add a small feature as a sprouted, tested function called from one line.