One of the things I really liked about this book was its scope. Unlike a lot of programming books that focus on a single tool or only on the code, Johansen does a great job of guiding the reader through the concept of test-driven development from multiple angles. The way the book is structured makes test-driven development feel like less like a buzzword and more like a logical design choice. He even goes as far as to explain some of the pitfalls of TDD:
Writing unit tests is not always easy. In particular, writing good unit tests takes practice, and can be challenging. The benefits listed in Section 1.5, Benefits of Unit Tests all assume that unit tests are implemented following best practices. If you write bad unit tests, you might find that you gain none of the benefits, and instead are stuck with a bunch of tests that are time-consuming and hard to maintain. In order to write truly great unit tests, the code you’re testing needs to be testable. If you ever find yourself retrofitting a test suite onto an existing application that was not written with testing in mind, you’ll invariably discover that parts of the application will be challenging, if not impossible, to test. As it turns out, testing units in isolation helps expose too tightly coupled code and promotes separation of concerns. Throughout this book I will show you, through examples, characteristics of testable code and good unit tests that allow you to harness the benefits of unit testing and test-driven development.