Shop now Learn more Shop now Shop Black Friday Deals Week in Fashion Cloud Drive Photos Shop now Amazon Fire TV Shop now DIYED Shop now Shop Fire Shop Kindle Paperwhite Listen in Prime Shop Now Shop now
Buy Used
+ £2.80 UK delivery
Used: Good | Details
Condition: Used: Good
Comment: Shows some signs of wear, and may have some markings on the inside. 100% Money Back Guarantee. Shipped to over one million happy customers. Your purchase benefits world literacy!
Have one to sell?
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See all 2 images

The Art of Unit Testing: with Examples in .NET Paperback – 8 Jul 2009

18 customer reviews

See all formats and editions Hide other formats and editions
Amazon Price
New from Used from
"Please retry"
£30.49 £6.90

There is a newer edition of this item:

Black Friday Deals Week in Books
Visit our Deals in Books store to discover Amazon's greatest ever deals. Shop now

Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.

  • Apple
  • Android
  • Windows Phone

To get the free app, enter your e-mail address or mobile phone number.

Product details

  • Paperback: 320 pages
  • Publisher: Manning Publications; 1 edition (8 July 2009)
  • Language: English
  • ISBN-10: 1933988274
  • ISBN-13: 978-1933988276
  • Product Dimensions: 18.7 x 1.8 x 23.5 cm
  • Average Customer Review: 4.3 out of 5 stars  See all reviews (18 customer reviews)
  • Amazon Bestsellers Rank: 255,085 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, and more.

Product Description

About the Author

The chief architect at Typemock, Roy Osherove is one of the original ALT.NET organizers. He consults and trains teams worldwide on the gentle art of unit testing and test-driven development. He frequently speaks at international conferences such as TechEd and JAOO. Roy's blog is at

Inside This Book

(Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

Customer Reviews

4.3 out of 5 stars
Share your thoughts with other customers

Most Helpful Customer Reviews

13 of 13 people found the following review helpful By John Mcloughlin on 14 Sept. 2009
Format: Paperback
I thought this book was excellent, but it came to me 6 years too late! If you're just starting out down the unit testing/TDD route then I would highly recommend you get this book and give it a read. It's broken up into 4 parts, each part building on the concepts from the previous part.

The first part sets the arena for the rest of the book by providing concise definitions of what Unit and Integration tests are, as well as introducing the reader to the concept of Test Driven Development (TDD). Part 1 ends with chapter 2 that walks the reader through an example of putting together their first unit test.

The second part then starts looking at ways of making your code loosely coupled so that you can test more effectively and start using Fake objects. Roy does this by introducing the concept of Dependency Injection (DI), otherwise known as Inversion of Control (IoC), and then how you can utilise DI to make use of Stub and Mock objects in your tests. The second part ends with the introduction of Isolation Frameworks and looks at how they can ease the complexity of using Stubs and Mocks in your Unit Tests.

The third part then starts moving in to the more practical side of Unit testing now that the groundwork has been established in the first 2 parts. Roy takes the reader through the various patterns that can be used for test classes and how you can utilise them in a Test Hierarchy. Roy highlights that a Automated Build process is essential for running your test regularly to pick up any breaking changes that may have occurred in your application. Chapter 7 then moves onto the critical area of how to write tests that are maintainable, trustworthy and readable.
Read more ›
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
6 of 6 people found the following review helpful By Robert Cooper on 21 July 2009
Format: Paperback
This is the summary taken from my full book review published here: [...]

An excellent book, I would recommend it if:

* You are completely new to Unit Testing.
* You have been Unit Testing for a short while and looking to see what the next step for you is.

If you have been a hardcore TDD practitioner for years, then I would expect that this book is not for you since you would have likely hashed all the issues covered in the book.

There are a lot of great anecdotes in the book, many of which rang home with me and personal experience. Which (for me) just affirms that the content is good.

A real nice, relatively short read. Great job Roy!
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
2 of 2 people found the following review helpful By Martin J. Hart on 5 Nov. 2009
Format: Paperback
I have been 'playing' with Unit Tests for a couple of years now, and have never felt comfortable implanting them because I knew I wasn't doing it right, I was making silly mistakes (both design and implantation), but didn't know exactly what I should be doing to resolve this.

After reading this book I have a very clear vision of what's right and what's not. I is written in a very easy-to-understand way with clear examples and well reasoned explanations. It shows the novice (and not so novice) test writer how they should go about writing clear, reliable and maintainable tests. There is some really great advice to get the reader up and running in no time at all, and best of all, with the confidence that what they are writing will stand the test of time in any development environment.

It also make very clear how to implement stubs and mocks and what rôle they play in the testing environment.

A truly great read and very highly recomended.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
1 of 1 people found the following review helpful By J. S. Hardman VINE VOICE on 9 April 2012
Format: Paperback Verified Purchase
"The Art of Unit Testing" by Roy Osherove is a good, introductory book re. unit testing for those working with .Net, particularly for those using (or planning to use) NUnit and RhinoMocks.

It's an easy read, that goes through what makes a good unit test, how to write a simple unit test using NUnit, how to replace dependencies with manually created stubs, how to manually create mocks, then how to use a mocking framework (e.g. RhinoMocks) to dynamically creates stubs and mocks. There's useful advice on things like naming conventions, how to organise projects and folders, integrating into the build system, how to introduce unit testing into an organisation, and how to work with legacy code. There's also advice on OOD for testability, including interface driven development and use of inheritance in order to break dependencies or allow insertion of objects to allow unit testing to take place (this has been a serious mental block for some developers I have worked with in the past - not being able to recognise that, with a little re-factoring, code that they thought could only be tested using integration/system testing can have dependencies broken to allow unit testing to take place). Together with numerous links/references to other tools and materials, this is a great, easy to read, and fairly short, introduction. It's one of a short list of books that I think all .Net developers should read.

This is not, however, the complete guide to unit testing in the .Net world. For example, it touches on Inversion of Control containers (e.g. Castle Windsor) but doesn't go into any detail. It mentions patterns for unit testing, but directs the reader elsewhere for more information. It touches on Test Driven Development, but doesn't really follow it through.
Read more ›
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse

Most Recent Customer Reviews