Loading lesson…
Level 1 · Apprentice0 XP
Tests are code too. Make them short, clear and fast, or nobody will trust them.
Step 1 / 6
ProblemA 90-line test with five mocks fails after a harmless rename. Nobody knows what it was checking, so someone deletes it. The safety net now has a hole.
← → step
Before this: DRY, KISS and YAGNI
🛠️ 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.Rewrite one long, unclear test into two or three short tests, each with a sentence as its name and clear arrange, act, assert blocks. Replace a real clock or random value with one you control.