Timo Mihaljov's Reviews > Working Effectively with Unit Tests

Working Effectively with Unit Tests by Jay Fields
Rate this book
Clear rating

by
33347309
's review
Jul 25, 2014

it was amazing

I wish every developer I work with had read this book (including the past me). It distills into a surprisingly short amount of pages many important lessons that I've learned the hard way over a number of years. For a beginning or intermediate unit tester this book is a must-read. The most experienced unit testers may not find much new in it, but even they can benefit from seeing unit testing from the author's unique point of view.

What sets this book apart is its hands-on approach. You're thrown right into the deep end with a painfully realistic example. A bunch of tests have failed and it's your job to figure out what went wrong by reading the test output, the test code, and the code under test. This dreadful task gives you a very tangible impression of what it means for a test suite to be maintainable: the better the tests, the faster you'll be done.

In the rest of the book the author points out features of the test suite that make it hard to work with and demonstrates refactorings that alleviate the problems. There's nothing abstract about why each change makes the tests better. You can clearly see that with each new version the cause of failure becomes much easier to find. Sometimes this approach might lead to surprising solutions, for example, introducing duplication into DRY code, but you can't argue with results.

I found the book's objective approach to (test) code quality refreshing. As always in design, some decisions are simply a matter of taste, and the author makes it clear when what he's presenting is simply his preference.

This is one of my favorite books on testing, and if I could recommend only one, this would be it.
3 likes · flag

Sign into Goodreads to see if any of your friends have read Working Effectively with Unit Tests.
Sign In »

Reading Progress

Started Reading
July 15, 2014 – Finished Reading
July 25, 2014 – Shelved

No comments have been added yet.