Reviewing The art of Unit Testing with Examples in .NET, by Roy Osherove

From time to time I like to spend some time reading up on a subject that’s work related. Today I’ve finished the art of unit testing, with examples in .NET, by Roy Osherove:

The art of unit testing with examples in .NET

Unit testing has become an important aspect of software development and as a developer I should be able to write good and maintainable unit tests. To be able to do so, I need to understand the basic concepts about unit testing and that’s why I bought this book.

Personally I think the book did a good job in explaining the basic concepts of Unit Testing:

  • Why unit testing
  • Fakes: Mocks and stubs
  • How to design code for unit testing
  • Why and how to use mocking frameworks
  • Best practices on how to organise your unit tests / integration tests
  • Trustworthy, maintainable and readable tests

However, there were also some points I found somewhat irritating:

  • Roy Osherove is also designed Typemock Isolator, a commercial mocking framework. Throughout the book you’ll notice a bit too much commercial sales about his product.
  • I had the feeling that some things were repeated multiple times throughout the book

The book is a great introduction into unit testing, and it’s clearly written. The book doesn’t go into technical depth, which makes it an easy and fast to read book. However don’t expect you’ll be able to just write all sorts of unit tests for real world applications after you’ve read this book. You’ll understand the basic unit-testing concepts and have a changed mindset towards unit testing. From that point on, it’ll be by practical learning experience. I’ll let you know within a year how that’s going 🙂

I would rate this book 3,5 out of 5.


By Robbin Cremers Posted in Books