Goodreads helps you keep track of books you want to read.
Start by marking “Working Effectively with Unit Tests” as Want to Read:
Working Effectively with Unit Tests
Enlarge cover
Rate this book
Clear rating
Open Preview

Read Excerpt

Working Effectively with Unit Tests

4.01  ·  Rating details ·  165 ratings  ·  25 reviews
Available at

Unit Testing has moved from fringe to mainstream, which is great. Unfortunately, developers are creating mountains of unmaintainable tests as a side effect. I've been fighting the maintenance battle pretty aggressively for years, and this book captures the what I believe is the most effective way to test.

This book details my strong opinions on
ebook, 204 pages
Published June 29th 2014 by leanpub
More Details... Edit Details

Friend Reviews

To see what your friends thought of this book, please sign up.

Reader Q&A

To ask other readers questions about Working Effectively with Unit Tests, please sign up.

Be the first to ask a question about Working Effectively with Unit Tests

Community Reviews

Showing 1-30
Average rating 4.01  · 
Rating details
 ·  165 ratings  ·  25 reviews

More filters
Sort order
Start your review of Working Effectively with Unit Tests
Gareth Jones
Jul 04, 2014 rated it it was amazing
It says "read", but that would be an exaggeration. "Briefly tolerated its existence before setting it on fire" would be more accurate. It burnt remarkably well, 5 stars. ...more
Timo Mihaljov
Jul 25, 2014 rated it 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
Eric Casteleijn
Dec 23, 2014 rated it really liked it  ·  review of another edition
A quick, enjoyable read. The focus of the book is how to improve ROI of your unit tests, and provides helpful suggestions to achieve this. There is no dogma here, nor anything revolutionary, but it's a solid addition to the testing literature.

If I have to list a downside, it's that all the examples are Java, and I wonder if some of the patterns are less valuable in other (say dynamic) languages. I would have loved to hear the author's thoughts on this, but it's a minor quibble, and I would still
Joe Walnes
Jul 10, 2014 rated it it was amazing
This book is a breath of fresh air!

Things I really like:

* The evolution of a hairy test to something really clean is elegant.

* It skips the usual slow history and get straight to the point.

* I wish more people wrote tests like this. I see so many unit tests that make me sad due to over complicated abstractions that hamper readability. Having a book to point people at will really help.

* Doesn't get carried away with frameworks, DSLs and such, but mostly it's just really straight forward programmi
Gustavo Enriquez
Jun 01, 2021 rated it it was amazing
A beautiful book for those who are interested to learn more about unit testing in Java and Mockito. A bit of experience with these technologies is required.

The examples are super clear, although, the format of the code presented in the book is not the most reader-friendly, maybe it is something to be improved for future editions.

Some concepts like Solitary Unit Test, Sociable Unit Test, Unit Test ROI are clearly explained and offer a good overview about how unit tests should be written. Additi
Daniel Gomez Rico
May 29, 2021 rated it it was amazing
It's really fun and easy to read, also gives you multiple strategies around "testing the hole picture" or just specific classes with some really practic and applied examples to avoid having a lot of brittle tests. Have you thought that there are multiple kind of unit tests? after this you will have a better picture of them.

In my experience I saw that people tends to not do unit test with the fear of spending more time updating/creating your test suit than in your features, but here, you will fou
Jake McCrary
Jul 03, 2014 rated it it was amazing
This is a book I plan on strongly recommending to other developers. Jay Fields presents his strategy for testing and his definition of a unit test. The book starts with some marginal unit tests and slowly improves them. I found myself feeling uncomfortable with the initial version of the tests and it was rewarding seeing the tests improve and having that uncomfortable feeling disappear.

Why do you write tests? What do you try to get out of testing? How do you make failing tests useful? By the tim
Marcus Ahnve
Dec 30, 2014 rated it it was amazing
As someone who has done TDD for 10+ years, this book still taught me a few new things and made me reconsider how I like my tests setup. I really like the format of the book - by clearly addressing readers already experienced with testing Jay manages to keep the book short and information dense in a way I wish more technical writers would.
Jan 03, 2022 rated it really liked it  ·  review of another edition
There is a lot of good stuff in here. My main gripe is that the author refers to blog posts in the book and simply states, this guy explains the x pattern well. Well that's great but I bought a paperback book with the intention of using it as a complete reference in the future. As time goes by these blog posts may disappear so this would be a more complete tome if the author did the extra work and summarized the information of these blog posts in his own book.

The paperback copy is quite affordab
Jan Ryswyck
An opinionated masterpiece about how to write maintainable unit tests. This book contains lots of details and well thought-out practices. Highly recommended for those who want to step up their game when it comes to unit tests and TDD.
Ahmed Chicktay
Oct 03, 2017 rated it really liked it  ·  review of another edition
A very pragmatic discussion of the challenges writing unit tests, and the solutions that the author uses.
Feb 25, 2018 rated it did not like it  ·  review of another edition
not a serious tdd book

the book go too fast over many deep contents, providing little insight. examples are really basic as well. waste of money.
Dec 20, 2019 rated it really liked it
Shelves: 2019, coding, testing
Very Java-heavy, but lots of great advice that's applicable to testing in general. ...more
Sep 15, 2017 rated it it was amazing  ·  review of another edition
Good book. I think this book is best start point to know (unit) testing. If you are junior, you will find this book is very useful. Recommend it!
Jan 17, 2015 rated it it was amazing
Jay Fields uses in Working Effectively with Unit Tests a different approach than most authors that write about TDD: How does test-driven development creates value? As a measurement to judge the different approaches he uses ROI (return on investment) and explains the different side-effects certain styles of tests have. This (at least for me) new way to look at TDD is refreshing and helps to stay away from code bases that are impossible to change after an endless amount of tests are written that n ...more
Aug 30, 2018 rated it it was ok
I didn't like the layout of the book. It made it hard to find the meat hidden in the book.
The main problem is that the book is probably 50% printed unit tests.
Personally, I find it unrewarding looking through code in a book.
I'd rather have seen carefully chosen snippets that illustrated the author's points.
The code could've been posted online and referred to allowing readers to utilizes IDE's to parse the code.

The author is also a bit dogmatic saying things should never/always (or at least a
Vlad Bezden
Jun 11, 2016 rated it it was amazing
Great book. Jay did a great job of providing excellent examples and explanations behind why he is changing those tests. Another great thing about this book, that it's 330 pages but they are all about testing, and no history or other unrelated to testing material. ...more
Jan 01, 2015 rated it really liked it
Shelves: 2015
The book is very pragmatic and short. Pretty nice overviews dos and don'ts of unit testing. With excellent examples to prove the points. But I would recommend to read "Growing object oriented software guided by tests" by N. Price first ...more
Dec 31, 2014 rated it it was amazing
Great book, but my only quibble is that using Java for the examples requires much more code for writing tests than in a more dynamic language. I definitely learned a lot about designing unit tests, useful in any language.
Jose  Seco Sanz
May 03, 2016 rated it really liked it
Shelves: technical, ul, to-re-read
Meh. It's good. It's probably directed to people that have been using unit tests for a very long time and use them extensively, which is not my case. It does have good info, it's probably that I don't know enough to get all of this book. ...more
Bheesham Persaud
Sep 27, 2017 rated it it was amazing
Easy to read and informative.
Aug 23, 2016 rated it really liked it
Amazingly crisp yet insightful.
rated it really liked it
Apr 27, 2016
Shane Groff
rated it it was ok
May 27, 2017
rated it liked it
Dec 05, 2017
rated it it was amazing
Jul 29, 2014
rated it really liked it
May 11, 2016
Kalle Björklid
rated it it was amazing
Jan 01, 2016
rated it really liked it
Nov 01, 2016
rated it really liked it
Jan 16, 2018
« previous 1 3 4 5 6 next »
There are no discussion topics on this book yet. Be the first to start one »

Readers also enjoyed

  • Predictably Irrational: The Hidden Forces That Shape Our Decisions
  • Modern Romance
  • Modern Software Engineering: Doing What Works to Build Better Software Faster
  • Fear and Loathing in Las Vegas
  • The Premonition: A Pandemic Story
  • The Silmarillion
  • The Martian Chronicles
  • The Omnivore's Dilemma: A Natural History of Four Meals
  • Othello
  • The Idiot
  • Growing Object-Oriented Software, Guided by Tests
  • Clean Code: A Handbook of Agile Software Craftsmanship
  • Refactoring: Improving the Design of Existing Code
  • The Fiery Trial: Abraham Lincoln and American Slavery
  • Software Design X-Rays: Fix Technical Debt with Behavioral Code Analysis
  • The Reckoning
  • So Long, and Thanks for All the Fish (The Hitchhiker's Guide to the Galaxy, #4)
  • Left Behind (Left Behind, #1)
See similar books…

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »
Jay Fields is a software developer at DRW Trading, conference speaker, and author. He has a passion for discovering and maturing innovative solutions. His most recent work has been in maturing software design through developer testing and software testing in general.

News & Interviews

The winter holiday season tends to be a busy one in the romance aisle. To assist you in finding your next hot read to warm up a cold night,...
134 likes · 6 comments
“when writing tests you should prefer DAMP (Descriptive And Maintainable Procedures) to DRY.” 1 likes
“Tests do not, or at least should not collaborate; it’s universally accepted that inter-test dependency is an anti-pattern.” 1 likes
More quotes…