Goodreads helps you keep track of books you want to read.
Start by marking “The Art of Unit Testing: With Examples in .NET” as Want to Read:
The Art of Unit Testing: With Examples in .NET
Enlarge cover
Rate this book
Clear rating
Open Preview

The Art of Unit Testing: With Examples in .NET

4.10  ·  Rating details ·  1,287 ratings  ·  93 reviews
Unit testing, done right, can mean the difference between a failed project and a successful one, between a maintainable code base and a code base that no one dares touch, and between getting home at 2 AM or getting home in time for dinner, even before a release deadline.

The Art of Unit Testing builds on top of what's already been written about this important topic. It guid
Paperback, 320 pages
Published July 5th 2009 by Manning Publications
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 The Art of Unit Testing, please sign up.

Be the first to ask a question about The Art of Unit Testing

Community Reviews

Showing 1-30
Average rating 4.10  · 
Rating details
 ·  1,287 ratings  ·  93 reviews

More filters
Sort order
Start your review of The Art of Unit Testing: With Examples in .NET
Jan 27, 2013 rated it liked it  ·  (Review from the author)
I am the author, so.. I think I like it! but the 2nd edition fixes things in the first edition that today I disagree with.
Apr 16, 2020 rated it it was ok  ·  review of another edition
There's much less discussion about the art of unit testing in this book than you'd expect from the title.
The book does cover various fundamental aspects, but is missing a breadth and depth of discussion.

The book will sometimes mention differences of opinion or technique, but never gets much discussion out of this as to why there might be differences (or what would make sense in different situations). The author's views don't get defended with depth more than "that's just my opinion, what do I kn
Recep Karabıçak
May 19, 2019 rated it really liked it  ·  review of another edition
A well written introductory book on the topic of unit testing. It covers a lot of ground, there is even a chapter on how to introduce unit testing to an organization.

But be wary. The book is a highly opiniated one. The author has strong opinions and does not shy away from presenting them. Of course that is not a bad thing but something to keep in mind.
Feb 15, 2019 rated it did not like it
This book is maybe useful to give to someone to persuade them why they should care about unit testing, but is next to useless at making you better at unit testing. XUnit Test Patterns is the canonical book for improving your unit testing skills.
Sang Tran
Feb 17, 2020 rated it really liked it  ·  review of another edition
This review has been hidden because it contains spoilers. To view it, click here.
Ireney Berezniak
This title has been crossing my path for a number of years now, mainly through Amazon recommendations, and now also Goodreads recommendations. The second edition has been released a few months ago, and so I finally decided to purchase it and see whether I could learn anything from it. I have been a practitioner for many years, and felt that I have mastered the art, but if I learned anything from my years of experience, is that "there is always room for improvement".

Turns out that Osherove's book
Lucas Teixeira
Dec 05, 2016 rated it it was ok
This is a good book for those uninitiated in proper unit testing, but there are a lot o things I didn't like.

The book has a conversational tone, which can be very good, but there's a line writers should not cross. The author insists in using some dumb jokes throughout the book. I was pissed by the third time I read "you have three options: A, B, or quit your job".

Another problem with this book is that it doesn't connect the code examples in a manner that the build on top of each other. Most of t
Sonny Recio
Jun 11, 2017 rated it it was amazing
I would like to give this one a perfect score since it explains a lot of stuff about Unit Testing and how can beginners start cleaner, maintainable code.

In the beginning, I find it hard and challenging to write Unit Tests myself, especially when making TDD due to the fact that I'm not used to the "Test-fail first" approach of coding. But as I go along the book and trying some samples(MULTIPLE TIMES), I was able to grasp the concepts the book was talking about. It took me a lot of time to underst
Vasil Todorov
Feb 07, 2016 rated it it was amazing
A must-read for every .NET developer. Anyway, Java and C# are similar, so it might be useful for Java devs too. The book shows many ways of writing a highly-testable code. Writing good test cases, what needs to be tested, and what not. How to structure our testing project/classes.
Apr 09, 2013 rated it it was amazing
The chapter about answering hard questions is invaluable I you trying to bring unit test to be used! Wish I had read this book back in the day!
Thinh Kieu
Jan 21, 2019 rated it it was amazing
Must-read book for someone who is working on unit tests.
Everything you need to know about unit testing is here.
Jan 18, 2018 rated it it was amazing
Recommends it for: novice and experienced programmers alike
As with many other things, sometimes it is hard to know where to start to explore a new topic of interest, and TDD and unit testing itself was no exception from this. Fortunately for us, the above situation is no longer the case for the aforementioned subjects, as R. Osherove presents us with an excellent starting point with his book (I read the 2nd edition). Before going into (some) specifics though, it is important to note that this book is not about TDD (although it touches the subject), but ...more
James Taylor
Jul 27, 2020 rated it really liked it
Shelves: own
I wouldn’t say I’m an expert at Unit Testing but have done it enough to understand the majority of points the author makes here. I think much of the things discussed I have learnt through experience but have only used the standard library "Microsoft.VisualStudio.TestTools.UnitTesting", Moq and XUnit. The author has worked on TypeMock so does mention it more than other frameworks but he does discuss alternatives too like Rhino Mocks and Moq. I think if you are new to Unit Testing, then you will f ...more
Mohammed Kamil
Feb 25, 2017 rated it really liked it
The writer goes on sharing his distilled knowledge on unit testing and various patterns on making a maintainable automated unit tests, and by giving a clear recommendation on unit testing framework ,the author relief the novice unit tester approacher from the hustle of evaluating different unit test frameworks and giving the reader a solid introductory dose enabling him to adapt unit testing,the book also has a chapter explaining some of the pattern in dealing with introducing automated unit tes ...more
Viktor Nilsson
This book was a mixed bag for me. On the one hand, explanations are very clear and everything is easy to follow. On the other hand, it's organized quite haphazardly, with references back and forth and with no clear line to follow in order to progress step by step. Much of it reads like a collection of assorted blog posts, and some parts discuss very small details, such as features of different framework versions etc. Such fresh information should not be recorded in a book, since it will quickly ...more
Vỹ Hồng
Jun 21, 2017 rated it really liked it
Shelves: programming
This is a must read for anyone interested in writing good unit tests. The book introduces various concepts, tools, techniques and principles for unit testing. All are valuable.

You'll get most out of this book if you're using a static typed language. If you're using dynamic language, some sections of the book might not be applicable (e.g. constrained vs. unconstrained test framework, design for testability). However, there is still much value to take from this book even if you're using a dynamic
Nilofar Mew
Aug 08, 2017 rated it it was amazing  ·  review of another edition
The book touches pretty much everything related to Unit testing on high level. It is a good book to start with and to get your head around the idea of unit testing.

This will not teach you to write all kind of test that you might write, but it will definitely provide you with all the necessary information that you would need to write any test.

The book of course has Roy's personality all over it. His sarcasm makes it fun and delight reading the book.
Kyle Wilson
Sep 10, 2017 rated it liked it
Still trying to see where unit test fits in the scheme of things for the sorts of work I do. This book really wasn't all that helpful as its examples showed rather trivial fakes compared to anything I run across and suggested that anything more complex isn't really a unit test. If that is really the case then integration tests meet most of my needs better...
Madan Meena
Jan 04, 2019 rated it it was amazing
When i became serious with whole writing unit test thought process, I started with this book. It gave me good idea and direction and confidence to go about the actual act.
This book will get you to speed about various aspect of unit test writing but you need to actually start writing to get the full benefit of the book.
Vladimir Ananiev
May 04, 2020 rated it really liked it
Covers many of the best practices when writing unit tests, and useful tips on getting started.
If you can't tell the difference between a mock and a stub, I would recommend you read this book (one of the best explanations I have found yet).

I found the examples a bit hard to follow and the code snippets were not well-formatted.
Kyle Butler
Jul 04, 2017 rated it it was amazing
A must read for any software professional whether you design, code, or test for a living. Jam packed with insight, real world examples, tips for everything from testing to design for test, it is a wealth of useful actionable information.
Mike Nguyen
Sep 06, 2017 rated it it was amazing
Strongly recommend for software developer who aims to produce bug-free applications. This book not only recommends set of practice of doing TDD properly but also gives suggestion on managing and handling legacy code those without automated tests in the first place.
Tim Dorais
Jan 16, 2020 rated it really liked it
Spends a good amount of time showing how unit tests can be done from scratch before introducing tools and frameworks. Codifies a lot of unit testing practices that many of us know through experience, and makes some interesting points and guidelines for creating maintainable tests.
Eric Henziger
Jan 29, 2020 rated it liked it
Shelves: øredev
Should have read this back in 2009 when it wasn't quite as outdated as it has now become. However, some parts are pretty much timeless, such as Chapter 7 - The pillars of good tests, and still hold their ground. Formatting in code listings are sometimes a bit off, but overall a nice and easy read.
May 11, 2020 rated it it was amazing  ·  review of another edition
It's a really good book, it starts working days from scratch so it's very recommended for people who is new to unto testing. Towards the end gets more interesting and gives more senior advice but overall the books is a must read for whoever works in software development.
Sergey Shchurko
Jun 25, 2017 rated it it was amazing
Excellent introductory book about unit tests. It describes a entire set of aspects related to test.
Branimir Kirilov
Oct 16, 2017 rated it it was amazing
In my opinion this book is a must for every .NET developer.
Jeremy West
Dec 31, 2017 rated it it was amazing
Not only a great introduction but also a great reference. It goes from rock bottom to some pretty in depth topics with a pretty good transition.
Eugene Popovych
Nov 24, 2018 rated it it was amazing
Great book to start writing unit tests if you don't know anything about it.
Pat Swanson
Mar 05, 2019 rated it it was amazing
Shelves: software
This is, bare none, the best book about unit testing I have ever read.

While it is focused on .Net, a lot of the principles here translate to other languages.
« previous 1 3 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
  • The Clean Coder: A Code of Conduct for Professional Programmers
  • Design Patterns: Elements of Reusable Object-Oriented Software
  • Clean Architecture
  • Dependency Injection in .NET
  • The Pragmatic Programmer: From Journeyman to Master
  • Refactoring: Improving the Design of Existing Code
  • Working Effectively with Legacy Code
  • Patterns of Enterprise Application Architecture
  • Code Complete
  • C# in Depth
  • Head First Design Patterns
  • Test Driven Development: By Example
  • Domain-Driven Design: Tackling Complexity in the Heart of Software
  • Building Microservices: Designing Fine-Grained Systems
  • Growing Object-Oriented Software, Guided by Tests
  • Microservice Patterns
  • xUnit Test Patterns: Refactoring Test Code
See similar books…

Goodreads is hiring!

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

News & Interviews

As dedicated readers already know, some of the best and most innovative stories on the shelves come from the constantly evolving realm of...
30 likes · 10 comments
“Tests are stories we tell the next generation of programmers on a project.” 1 likes
“If you are too lazy to cleanup your database after testing, your filesystem after testing or your memory based system consider moving to a different profession. This isn't a job for you.” 1 likes
More quotes…