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.11  ·  Rating details ·  1,197 ratings  ·  79 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
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.11  · 
Rating details
 ·  1,197 ratings  ·  79 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.
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.
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
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
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.
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
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 ...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.
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.
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...
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.
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.
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
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.
Oct 23, 2017 rated it really liked it
Great introduction to unit testing that is very readable with lots of examples.
Cliff Roberson
5 Isolation Frameworks
6 Digging deeper into isolation frameworks
7 Test Hierarchies and Organization
9 Integrating Unit Testing into the organization
10 Working with legacy code
11 Design and Testability
Dec 05, 2014 rated it it was amazing
I rather liked this book, and learned a lot from it (far more than I have from a lot of other computer programming books). The things I liked about it is:

1) While the concepts are demonstrated in .NET, there's references to other languages (Java and Ruby) and the concepts I imagine would transfer fairly easily.
2) The book is written almost as if you were talking to the author right there. It didn't feel as artificial as other books, and you can see there's 'personality' in parts of the 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
Hovhannes Gulyan
Very informative and practical book on Unit Testing, IoC containers, mocking frameworks, automation builds, continues integrations and object-oriented programming.
This book gives a huge insight on good development skills, making code testable and readable, which a lot of companies value the most.
Besides that Roy Osherove gives a lot of information about tools and frameworks, that are good to know and use in modern applications.
Along with improving design skills, you will feel yourself more
Jun 19, 2015 rated it really liked it
Shelves: sjpl
This book is a great introduction into unit testing if you only heard about it and want to dive in. It can also help you understand some missing points from your own unit test practice. Although the examples are in C#, it's quite easy to understand what's going on, and adapt to your language. The book is explicitly only about unit testing, not integration testing or TDD (they are covered very briefly); you'll see the design principles allowing for easier testing and pieces of advice how to ...more
Mar 08, 2014 rated it liked it
Shelves: programming
More like 3.5 stars. Dated references but good foundation and intro to NUnit as opposed to the built in Visual Studio tools. Don't have a lot of experience with automated testing and continuous integration, but interested in moving in that direction. The discussion of integration testing frameworks and by extension, web testing frameworks (Selenium anyone?) were also engaging and something I've been looking for for a while. I know that c#/.net has started including a lot of fakes and other ...more
Sep 12, 2013 rated it really liked it
As usual, books on software development get outdated very fast. Lots of the information in this book is still applicable, but in terms of the portrayed frameworks, a lot has happened. I'm excited about the second version of the same book that came out late last year.

Apart from framework issues, this book is a great overview of testing techniques and design principles. Had I read this book earlier on, I may have been able to rectify the situation (lack of tests, project tending to failure) on a
« 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
  • Clean Architecture
  • Dependency Injection in .NET
  • Design Patterns: Elements of Reusable Object-Oriented Software
  • The Clean Coder: A Code of Conduct for Professional Programmers
  • Refactoring: Improving the Design of Existing Code
  • Head First Design Patterns
  • Test Driven Development: By Example
  • Code Complete
  • Working Effectively with Legacy Code
  • The Pragmatic Programmer: From Journeyman to Master
  • Domain-Driven Design: Tackling Complexity in the Heart of Software
  • CLR via C# (Pro-Developer)
  • C# in Depth
  • Building Microservices: Designing Fine-Grained Systems
  • Agile Software Development, Principles, Patterns, and Practices
  • The Software Craftsman: Professionalism, Pragmatism, Pride
  • Patterns of Enterprise Application Architecture
See similar books…

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »
“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…