Tests written after the code tend to match the code. Test-driven development turns that around with a short loop: red, green, refactor. This lesson covers each step and how to use it on a legacy system.
More lessons in 60 Days of Software Architecture