I recently finished reading Test-Driven Development in Microsoft .NET. What with both authors working on the open source NUnit project and James Newkirk being the lead, this book had a lot of hype to live up to. I’m satisfied to say that it lived up to most of it.
The first few chapters introduce Test-Driven Development and why you should use it. There is a detailed example of both developing new code using TDD and refactoring existing code. The examples are good because they are different, but I personally don’t think it is enough for someone new to TDD. For that I would recommend Test Driven Development: By Example by Kent Beck.
The heart of the book is the example that is carried through the book, developing access to a music database through web services. This allows the authors to tie in difficult testing concepts such as using TDD with a database and web services, as well as a short chapter on UI testing. James and Alexei also cover using the Fit program for creating end-user tests. While I think it is important to test the system as a whole, I’m not sure if Fit is the way to go, and that would be my only complaint with the book. But they do provide a good introduction to using it.
The authors also show the use of patterns fairly heavily. The classic Design Patterns and the Patterns of Enterprise Application Architecture are covered. This helps to integrate solid software development practices with TDD and show how and when introducing patterns is appropriate during the process.
Another thing to remember is that while the examples in the book are certainly a very good way to use Test-Driven Development, they are not the only way. There are other approaches and methods to testing. For example, in the book James Newkirk avoided all use of mock objects due to personal preference. The book is a guide, not the gospel.
If you have some experience using TDD, this book will take you to the next level. It covers the hard stuff that all previous examples have skipped. If you’re brand-spanking new to TDD, do yourself a favor and read Kent Beck’s book and follow along with the examples first.
This Blog Hosted On: http://www.DotNetJunkies.com/