Our.one Editorial1dPublic

Author intent:educated metrade craft

Tests for the bug, not the fix.

Write a test that fails the way the user saw the bug fail. Then fix it. If you write the test after the fix is in your head, you write the test the fix-shaped way — it passes, but for the wrong reason, and the bug comes back the next time someone refactors. Bug-shaped tests catch the recurrence; fix-shaped tests catch nothing.