Goodreads helps you keep track of books you want to read.
Start by marking “xUnit Test Patterns: Refactoring Test Code” as Want to Read:
xUnit Test Patterns: Refactoring Test Code
Enlarge cover
Rate this book
Clear rating
Open Preview

xUnit Test Patterns: Refactoring Test Code

(Martin Fowler Signature Book)

3.93  ·  Rating details ·  650 ratings  ·  48 reviews
Automated testing is a cornerstone of agile development. An effective testing strategy will deliver new functionality more aggressively, accelerate user feedback, and improve quality. However, for many developers, creating effective automated tests is a unique and unfamiliar challenge. xUnit Test Patterns is the definitive guide to writing automated tests using xUnit, th ...more
Hardcover, 883 pages
Published May 1st 2007 by Addison-Wesley Professional (first published May 1st 2003)
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 xUnit Test Patterns, please sign up.

Be the first to ask a question about xUnit Test Patterns

Community Reviews

Showing 1-30
Average rating 3.93  · 
Rating details
 ·  650 ratings  ·  48 reviews

More filters
Sort order
Start your review of xUnit Test Patterns: Refactoring Test Code
Gleb Sevruk
Jun 27, 2013 rated it did not like it
Shelves: read-dev
I started with some interesting reading - but this was only Preface by Martin Fowler. I stopped reading at 200-th page because it gets too repetitive and makes no sense (just a catalogue with generic programming practices)

If you want to learn testing - I would recommend (in order):
Michael Feathers "Working Effectively with Legacy Code" (explains WHY to write test and how to achieve it)
Roy Osherove "The Art of Unit Testing"
Mark Seemann "Dependency Injection in .NET"

These guys knows what they are
Tom Panning
Aug 24, 2011 rated it liked it
Shelves: quality
This is a really good 300 page book in 800+ pages. Trying to teach myself unit testing, without a more experienced mentor helping me, I ran into a lot of cases where the suggestions in normal unit testing books and guides didn't seem to work. This book had good solutions for many of those problems.

Unfortunately, this book is incredibly repetitive with an unbelievable amount of duplicated content. It was to the point where I could read a new chapter, and for several pages I would swear that I mus
Feb 02, 2009 rated it really liked it
Shelves: software, non-fiction
Big. It will take you a while. But if you want to go from novice to expert in unit test writing -- and learn more about practical application of design patterns along the way -- then read nearly every page, from cover to cover.

Periodically he seems to repeat himself, but it does serve a useful reinforcement purpose. Also seems to serve the purpose of further justifying the price. Along with no effort to prevent pages with three lines of text, these two function to add perhaps another 10% to the
Nov 25, 2012 rated it it was ok
This book makes me feel like this practice of cataloguing software patterns is getting out of hand. It started with Design Patterns, a brilliant book that catalogued 9 common software design patterns. It wasn't intended to be exhaustive, just a handful of some of the most useful patterns. Then other books started cataloguing other patterns, in various realms of software. This book catalogues patterns in unit testing, but not just a handful. I counted 68 patterns, including things such as using l ...more
Jul 25, 2018 rated it really liked it
Shelves: learning
The most exhaustive work on test automation practices & patterns I've encountered to date.

The book starts with some general outlines: "why", "how", "when",... but is mostly a smell & pattern catalog -including all the redundancy and back-referencing a pattern language implies-.

Topics covered: designing for testability, organising tests, state vs. behavior verification, setup/teardown patterns, getting untestable code under test, tests and databases, dealing with asynchronicity, ... http://xunit
Robson Castilho
Oct 03, 2017 rated it really liked it
Shelves: software
Very solid guide about coding high-quality tests.
Being a pattern catalog and a very extensive book, it's better using it as a reference guide or reading it in steps (maybe interleaving it with other books). One issue about being a big pattern catalog is the repetition of samples (and even text) from one pattern to another.
But the major disappointment is not mentioning anything about using Builders for creating Test Data and even Test SUTs (I strongly advice reading about that).
May 17, 2017 rated it really liked it
Shelves: software
Amazing book! A deep dive into the world of Unit Tests and the Refactoring of Test Code. So many valuable principles and patterns that you can use in your daily practice.
Every individual who calls themselves a 'Professional Developer' MUST read this book.
Rod Hilton
Mar 04, 2009 rated it it was amazing
I know a lot about unit testing. I'm a big TDD advocate, and I've learned an awful lot of lessons about effective unit testing over the years. I could easily give a series of talks on the topic of unit testing.

And yet, I don't think there's a single thing I know about unit testing that isn't covered in xUnit Test Patterns. This book is the bible of unit testing, unbelievably thorough. Nearly every aspect of unit testing is covered (at least that I know about), categorized into patterns and organ
Gishu Pillai
Aug 22, 2016 rated it liked it
My primary complaint with this book - it's too big. That's a shame - since there is some good stuff in here that needs to be read.

I've seen first hand that 'bad xUnit tests can be worse than having no xUnit tests' - teams sink hours trying to keep their tests green, while the tests are like christmas lights flickering red n green on their own accord.

Tests are code - the same rigor n quality procedures need to be applied for tests. If not the tests can cripple and impede development (instead of b
Vasili Puchko
Sep 29, 2011 rated it it was amazing
Shelves: technical
It's the Unit Testing Bible. It's highly informative, it covers almost everything a developer should know about Unit Testing. It's big, but it's a very good time investment if you want to become a great programmer. ...more
Thierry de Pauw
May 01, 2021 rated it really liked it
I gave it 4 stars because it is the only patterns book I know of about Unit Testing. You get here a very extensive overview of all patterns related to testing.
Even after 10 years wrestling with legacy code bases I had several aha moments.

To be fair, as some reviewers have already pointed out, the book is quite repetitive. But, well, repetition is a good learning tool ;)

You also need a fair bit of courage to start reading the book when contemplating the thickness of the book :)
Samuel Taggart
Nov 04, 2019 rated it really liked it
A bit long and repetitive but very good content. If you are looking to learn about unit testing, there are probably better, more approachable books. However if you need to manage a large amount of tests, then this book is a gem. It is 900 pages so I don't recommend reading straight through as I did, but it would be great for a reference. ...more
Umang Bhatt
Nov 04, 2017 rated it really liked it
Natural successive read after Kent beck's book. ...more
Álvaro Hernández
Feb 13, 2018 rated it it was amazing
Must read! for anyone who is writing software, therefore should be writing tests
Matt McCormick
Mar 09, 2018 rated it it was ok
Shelves: software
Very tough to read through as it's laid out as more of a reference book with many references back and forth to other sections. ...more
Kiril Kirilov
Feb 16, 2019 rated it it was amazing
The. Best. Book. About. Writing. Tests. For. Developers.
Arran Bartish
Feb 21, 2019 rated it it was amazing  ·  review of another edition
Assert awesome

Excellent book. When your code sense already tells you what makes a good test or a bad one, xUnit Test Patterns can explain why.
Uli Kunkel
Sep 08, 2019 rated it it was amazing
Some very good take-aways to keep in mind whilst your WRITING your code.
Luís Soares
Mar 28, 2021 rated it liked it
Shelves: software
Worth it as a reference in terms of testing patterns and standardization of testing terminology. I'd give a 5 if it was rewritten in 300 pages and not so repetitive. ...more
Nov 05, 2012 rated it really liked it
Shelves: software
A huge tome on everything xUnit. Part 1, the Narratives, explains all the basics and I would recommend reading completely. It gives a great overview of both the test "smells" and the patterns in later sections. Part 2, the Test Smells I think of as Martin Fowler's Refactoring book, except dealing strictly with testing. It's organized very similarly to that classic book. Part 3, the Patterns, is like Fowler's Patterns of Enterprise Application Architecture, except again, only dealing with common ...more
Aug 13, 2015 rated it liked it
Shelves: non-fiction
I thought this was a good book, particularly if you're new or somewhat new to automated testing. I was a bit disappointed personally though as I found that what other reviewers have said to be true: the book is about 3x longer than it needs to be.

The book is fairly repetitious. You'll find a chapter discussing a subject. Then there will be a section describing that subject as a pattern. Then each of the variations of that pattern (which were already discussed) are discussed again as separate pat
Väinö Leppänen
This book is not meant to be read in its entirety, so I did not. The first 181 pages that I did read gave a nice coverage of unit testing with (surprise surprise) a particular focus on xUnit tools. The book moves along in a logical fashion, each chapter building on the previous ones which I consider to be very important. The contained illustrations I didn't care for too much; mostly I thought they were unnecessary for me personally but I can see that others might benefit more from them.
After the
Helge Stenström
Jan 16, 2018 rated it really liked it
Good, but it repeats itself a bit too much.
Stefan Teixeira
Nov 24, 2014 rated it really liked it
This book is definitely the "Unit Testing Bible". It's a great reference book and it covers everything you could imagine about unit tests, which is very valuable. Despite its focus on unit testing, much of the smells, patterns and techniques covered by the book are definitely applicable to automated tests in other levels, such as integration or UI.

However, the book is VERY repetitive. If you want to read it in its entirety, be prepared to read the same things all over again for multiple times. I
Jan 01, 2015 rated it it was amazing
A great reference book on patterns around testing, not so interesting to read from cover-to-cover. However, when you have a problem with your automated tests, then there is most likely a solution in this book.

Many problems you run into with starting test automation are covered. I wish I had read this book years before and would not have needed to make the errors for myself. If you are testing your software with automated tests, then this book is a must-read. Don’t shy away because it has so man
Jean Tessier
Sep 27, 2011 rated it it was amazing
Shelves: software
An amazing text on testing. I read the first 200 pages, the narrative, and skimmed the rest of the catalog of patterns. It does a great job of defining a vocabulary for unit testing and really nails down the terminology. The narrative format really brings the language to life, shows how all the terminology fit together very nicely. A must read for anyone doing unit testing with any of the xUnit frameworks.
John Curtis
Sep 27, 2013 rated it really liked it
Very good, exHAUSTive overview of the xUnit test space. Meszaros names things that I don't think others name or would agree with his name of, but the distinction between the nuances of testware componentry is unique if nothing else. And .. he knows his stuff and makes you think, which is exactly what development-focused engineers need when thinking about the foreign land of testing. Well, I guess it's foreign no more :-D ...more
Neville Ridley-smith
May 30, 2015 rated it really liked it
Shelves: technical, owned
Yes, I read the whole damn thing. There's quite a bit of repetition and a lot of very straightforward stuff, so it was quite quick to read for the most part. I make it a habit to spend 15 minutes at work every day reading a technical book and I could generally get through about 20 pages of this each time.

There's a lot of good stuff in there and I've taken on board some of the advice. I'm also going to keep it handy as a reference.
Jul 04, 2007 rated it it was amazing
Recommends it for: software engineers
I reviewed this for IEEE Software. This is a great book for software developers/engineers in the often neglected unit test practice. This book starts with philosophy, principles, and then gets into foundations of unit tests and finally with the catalog of patterns. It also discusses smells and refactoring.
Mar 21, 2008 rated it liked it
I got half-way through this on the first go.

For me, this really serves as a reference piece instead of a book that you get something out by reading the prose.

With as many times as this book is referenced in other pieces that I read though, I think it may become more important for me over time.
« previous 1 next »
There are no discussion topics on this book yet. Be the first to start one »

Readers also enjoyed

  • Clean Code: A Handbook of Agile Software Craftsmanship
  • Working Effectively with Legacy Code
  • Test-Driven Development: By Example
  • Growing Object-Oriented Software, Guided by Tests
  • Design Patterns: Elements of Reusable Object-Oriented Software
  • The Clean Coder: A Code of Conduct for Professional Programmers
  • Effective Java
  • The Art of Unit Testing: With Examples in .NET
  • The Pragmatic Programmer: From Journeyman to Master
  • Refactoring: Improving the Design of Existing Code
  • The C Programming Language
  • Domain-Driven Design: Tackling Complexity in the Heart of Software
  • Extreme Programming Explained: Embrace Change (The XP Series)
  • Site Reliability Engineering: How Google Runs Production Systems
  • Grokking Algorithms An Illustrated Guide For Programmers and Other Curious People
  • Java Concurrency in Practice
  • The Algorithm Design Manual
  • Code Complete
See similar books…

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »

Other books in the series

Martin Fowler Signature Book (1 - 10 of 11 books)
  • Refactoring to Patterns
  • Refactoring HTML: Improving the Design of Existing Web Applications
  • Beyond Software Architecture: Creating and Sustaining Winning Solutions
  • Refactoring Databases: Evolutionary Database Design
  • Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation
  • Domain-Specific Languages
  • Patterns of Enterprise Application Architecture
  • Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions
  • Continuous Integration: Improving Software Quality and Reducing Risk
  • Service Design Patterns: Fundamental Design Solutions for SOAP/WSDL and RESTful Web Services

News & Interviews

  Jordan Morris is a comedy writer and podcaster whose credits include @Midnight, Unikitty! and Earth to Ned.  The sci-fi comedy Bubble is his...
16 likes · 5 comments
“Testing the business logic inside the system under test (SUT) via the user interface is a bad idea. Even” 0 likes
More quotes…