October 2013
Intermediate to advanced
368 pages
9h 20m
English
Tests still come first in your approach to legacy code. You will need to write tests to characterize existing behavior, even though these tests cover code already written. You will also test-drive any new code you write.
You’ll likely realize that writing tests after the fact (something I refer to as Test-After Development [TAD]) requires considerably more effort than had you created the code using TDD. The primary reason is that programmers don’t structure their code to be easily tested if they’re not worried about testing it. The second reason is that when test-driving, you should be continually factoring toward smaller, more reusable elements that make the crafting of new tests and code easier.
Testing the ...