Art of Unit Testing Review

Back in 2010, I met my first nemesis for the 2010’s it was the Art of Unit Testing from Manning. This is a combination of a great book and an infuriating book all in one. Lets dig into my complicated history with the Art of Unit Testing as we wander through the library.

Art of Unit Testing

I believe I have the first edition of the book. With what I suspect is .NET falling out of favor, the examples in my edition are in .NET but in later editions of the book, it switches over to JavaScript examples. Even with what a .NET centric biases, this is one of the great texts of Unit Testing. It is well worth the read if you need to learn unit testing. Unlike most great text this one is fairly small. It starts small and ramps up so you never get lost. There is a bunch of impact in its few pages.

I really, really enjoy it but failed to get through it to the end 5 different times.

What held me back?

In all worlds, pillars exist to prevent civilization collasping and us reverting to hairless monkees who through crap at each other. The world of programming has its pillars too. One of those is the concept of encapsulation. He addresses it, I believe in chapter 5. If there is a problem in unit testing, it is that you can only test what is public at least in the way I organize my tests. Since the organization is the test are in separate projects, you get lots of public methods. If it is public then it is not encapsulated away from people. They can play with it. The author’s reasoning is that I am just a prude and the unit test is a valid user and if the user has a valid reason for needing it expose then expose it.

I ran headlong into a wall and metaporically cracked my skull. It kept me from finishing the book for years.

Regardless, I did finish it and it has been a major book in my advancement over the years. I may not always like unit testing but I do see the advantages of it.

Leave a Reply

Your email address will not be published.