Attention: We are retiring the ASP.NET Community Blogs. Learn more >

New Unit Testing Books

I picked up a couple of new books recently that cover testing topics related to development.

1. Pragmatic Unit Testing - In C# with NUnit [Andrew Hunt and David Thomas]
Some of you might recognize the authors of this book if you've read "The Pragmatic Programmer". This book has served as my introduction to Unit Testing and I'm glad I chose to read this book first. It introduces you to NUnit and explains how to use the NUnit libraries (NUnit.Framework, NUnit.Core, etc.) to create test classes and test methods. It also introduces you to the NUnit GUI and the NUnit command line ways of testing those classes and methods once you've written them. Beyond using NUnit though, I really appreciate how this book helps you realize that there's much more to unit testing than just using NUnit. In chapter 4 they take you through the RIGHT BICEP concept and then in the next chapter take you through the CORRECT concept (both RIGHT BICEP and CORRECT are acronyms that stand for a particular series of checks to put your code through, just like ACID is to transactions). So far I'm about 70 pages through this book which believe it or not, is about half-way. I'll report back on what the second half of the book covers and how it further improves your knowledge of unit testing.

2. Test-Driven Development in Microsoft .NET [James W. Newkirk and Alexei A. Vorontsov]
I've been seeing this book endorsed all over the place, so I thought I'd give it a try. I haven't begun reading it yet but, glancing at the table of contents it looks like it should be a fun read. Especially after I've finished book #1. There's an NUnit primer including as an appendix but, I'm thinking I won't need it after finishing book #1. This book looks to get deeper into unit testing and steps outside the realm of simple examples to cover ASP.NET Web Services, transactions and other common development situations. I'll post again once I've read this book with my opinion/review.

These two books definitely seem like a good one-two punch if you're looking to learn about unit testing. The first book explains exactly what unit testing is, and how to do it with NUnit, while the second book assumes you're familiar with NUnit and goes through some more advanced unit testing scenarios.

4 Comments

  • Are you relatively new to unit testing? I've been debating whether to buy the Pragmatic Unit Testing book because I'm afraid it would be a little too basic. Any thoughts?

  • Hi Darrell,

    I would say yes, I'm pretty new to unit testing. I'd read over the concepts before but never done any real hands-on unit testing. I've found the Pragmatic Unit Testing book not only to be a good introduction to unit testing but, also a good kick-start on using NUnit and how to conceptually approach developing unit tests for your code. In other words, it provides some brain-teaser type exercises and practices so that you actually come away thinking more like a unit tester, rather than just a coder/developer.

  • Cool, maybe I'll check it out! Thanks for the rundown. :)

  • Hi All,

    I am planning to purchase buy a hard copy of book "Pragmatic Unit Testing in C#" using NUnit 2.4.
    I have e copy of this book and found to be useful to know basic concepts. Presently I am performing unit testing in my project.

    Regards,
    Jyoti
    Bangalore, India

Comments have been disabled for this content.