Chapter 11Practice 7: Specify Behaviors with Tests

Tests provide immediate feedback so you can see if anything you do adversely affects any other part of the system, and if it does you can automatically roll back those changes and let life move merrily along. Having independent verification of code through unit tests immediately flushes out any logic errors. A whole class of elusive bugs that kept many of us up late at night, bleary eyed, staring at our debuggers, are caught by our unit tests and aren’t introduced into code so they don’t have to be found later and removed.

Developers get instant feedback about what works and what doesn’t, and this changes the whole dynamic of software development. With instant feedback, you can figure things ...