The Art of Unit Testing: With Examples in .Net

The Art of Unit Testing: With Examples in .Net by Roy Osherove is a great book I’ve read a couple of weeks ago, and of which I would like to write a few words.

Before we start I should state that I had no previous experience with unit testing, and as such, in some aspects, I might be stating the obvious.

As with the first remark I got when picking up the book from the draft, no, it is not a problem that the examples are in C# (some VB.NET on rare occasions). Even if this was my first time I was exposed to C# I can state that is quite readable, and verbose enough so the principles applied in this book can be further on expanded with other languages. There are some chapters and subchapters you may want to skip due to being .NET specific, but ~80% of the book is pretty much language/platform neutral.

The testing framework used in the book is based on the xUnit architecture, the most widespread unit testing architecture; from languages like C++ to PHP.

Aside from the unit testing aspect of it, the book does a good job at promoting better decoupling strategies, applying proper design patterns and making the working code altogether more maintainable.

The book also has an entire chapter dedicated to people who would like to bring TDD in their company, and different strategies for succeeding in this goal.

The book is well written and divided, very easy to comprehend and funny just when needed. If you’re new or got basic to medium knowledge of unit/integration testing, and are not bothered by example code in .NET than this book will make a fine addition to your shelf.

Even for those people who despise TDD and the whole testing philosophy, I think that such a book is a good read because it gives you different angles to approach problems you may have met before.

Divide et impera.

Filed under Books

blog comments powered by Disqus