Automotive Holiday Deals Up to 50% Off Select Books Shop Men's Athletic Shoes Learn more nav_sap_SWP_6M_fly_beacon Indie for the Holidays egg_2015 All-New Amazon Fire TV Subscribe & Save Gifts for Her Amazon Gift Card Offer cm15 cm15 cm15 $30 Off Amazon Echo $30 Off Fire HD 6 Kindle Cyber Monday Deals Cyber Monday Video Game Deals Shop Now HTL

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
  • Android

To get the free app, enter your email address or mobile phone number.

Pragmatic Unit Testing in C# with NUnit, 2nd Edition (Pragmatic Starter Kit Series, Vol. 2) Second Edition Edition

14 customer reviews
ISBN-13: 978-0977616671
ISBN-10: 0977616673
Why is ISBN important?
This bar-code number lets you verify that you're getting exactly the right version or edition of a book. The 13-digit and 10-digit formats both work.
Scan an ISBN with your phone
Use the Amazon App to scan ISBNs and compare prices.
Have one to sell? Sell on Amazon
More Buying Choices
7 New from $64.70 22 Used from $1.99
Free Two-Day Shipping for College Students with Amazon Student Free%20Two-Day%20Shipping%20for%20College%20Students%20with%20Amazon%20Student

Get Up to 80% Back Rent Textbooks

Special Offers and Product Promotions

  • Take an Extra 30% Off Any Book: Use promo code HOLIDAY30 at checkout to get an extra 30% off any book for a limited time. Excludes Kindle eBooks and Audible Audiobooks. Restrictions apply. Learn more | Shop now

Editorial Reviews


"Using the approaches described by Dave and Andy you can reduce greatly the number of defects you put into your code. The result will be faster development of better programs. Try these techniques"

—Ron Jeffries,

"Andy and Dave have created an excellent, practical and (of course) very pragmatic guide to unit-testing, illustrated with plenty of examples using the latest version of NUnit."

—Charlie Poole, NUnit framework developer

"The Pragmatic Programmers have done it again with this highly useful guide. Aimed directly at C# programmers using the most popular unit-testing package for the language, it goes beyond the basics to show what you should test and how you should test it. Recommended for all .NET developers."

—Mike Gunderloy, Contributing Editor, ADT Magazine

About the Author

Andy Hunt is a programmer turned consultant, author and publisher. He co-authored the best-selling book “The Pragmatic Programmer”, was one of the 17 founders of the Agile Alliance, and co-founded the Pragmatic Bookshelf, publishing award-winning and critically acclaimed books for software developers.

Dave Thomas, as one of the authors of the Agile Manifesto, understands agility. As the author of "Programming Ruby," he understands Ruby. And, as an active Rails developer, he knows Rails.


Hero Quick Promo
Holiday Deals in Kindle Books
Save up to 85% on more than 1,000 Kindle Books. These deals are valid until November 30, 2015. Learn more

Product Details

  • Paperback: 239 pages
  • Publisher: Pragmatic Bookshelf; Second Edition edition (September 9, 2007)
  • Language: English
  • ISBN-10: 0977616673
  • ISBN-13: 978-0977616671
  • Product Dimensions: 7.5 x 0.7 x 9 inches
  • Shipping Weight: 11.2 ounces
  • Average Customer Review: 3.9 out of 5 stars  See all reviews (14 customer reviews)
  • Amazon Best Sellers Rank: #1,008,248 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

Most Helpful Customer Reviews

24 of 25 people found the following review helpful By Scott D. Duncan on June 27, 2005
Format: Paperback
The message of this book is: responsible developers unit test, and it's easy to do, so do it! If you're tired of reading 800 page books that should've been 200 pages, then you will find this book a refreshing change. It gets straight to the point, explaining in an easy-to-read style how to unit test .NET applications, including how to install & use the popular NUnit & NMock tools. It also explains how to design effective unit tests, and what to do in common problem situations (such as incomplete requirements). It is a great first book on unit testing for .NET, but since it is a pragmatic guide it does not cover the more esoteric, quirky issues you may run into. It also does not discuss or promote test-driven development techniques and theories. It is strictly a nuts & bolts discussion of .NET unit testing with NUnit & NMock, but if you need to be unit testing today (not next month), then this is the book to get.
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
45 of 55 people found the following review helpful By DR on March 23, 2008
Format: Paperback Verified Purchase
I have to respectfully disagree with all the fawning reviews. It's a chatty, drawn out, tedious read, something of an accomplishment given the fact that it's only ~200 pages long. Frankly, anything more then something like the O'Reilly Pocket Reference is overkill on this subject. NUnit is a snap to use and the freely available documentation and tutorials are more than adequate and not nearly so time-consuming to digest.

The first passage that discusses actual test coding (~20 pages or so into the book) presents a simple case where a method should accept an integer array as a parameter and return the largest element. The book then explains how this function, if it behaves properly, should perform. A series of simple test cases are discussed before we get to the real toughie for all you computer scientists out there - a data set consisting of negative integers. A test vector consisting of the array [-9,-8,-7] is passed to the method and -7 is returned. The book explains 'It might look odd, but indeed -7 is larger than -9. We're glad we straightened that out now, rather than in the debugger or in production code where it might not be so obvious.'

ARE YOU KIDDING ME?!? Just what audience was this thing written for? One would have thought that that little gem wouldn't have been necessary... but in fact that is the tone of the entire book. Expect to have your hand held in this manner throughout. If that's the sort of thing that appeals to you, you'll love this one. If, on the other hand, you're trying to learn to incorporate NUnit testing into C# development in an efficient, professional manner, save your money and time and read the NUnit docs.
6 Comments 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
9 of 9 people found the following review helpful By ueberhund VINE VOICE on September 30, 2007
Format: Paperback
This is a great introduction to writing unit tests in C# with NUnit. The authors do a good job of explaining why unit tests should be created, how having unit tests are better than not having unit tests, and what exactly should be coded for in a unit test. The book is well-written, easy to follow, and includes helpful guidelines for things that might be confusing to developers.

The real strength of this book is not the author's approach to writing unit tests, but rather they clearly illustrate what exactly should be tested in a unit test. The authors show how adhering to the guidelines they set forth results in unit tests that are well-written and fail at appropriate times. The authors then generalize this to some extent and provide an excellent discussion on the properties of a good unit test.

My favorite section of the book was actually one of the appendices. In the first appendix, the authors go through a list of gotchas--both in writing unit tests in general and specific to unit tests in C#. This is a very short discussion (only 6 pages), but they identify some issues I've seen with poorly written unit tests.

This is a great book as an introduction to writing unit tests. The authors clearly explain why unit tests should be written, they show clearly what should be tested in a unit test, and they describe some of the problems that have been avoided by writing intelligent unit tests.
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
9 of 10 people found the following review helpful By Amazon Customer on June 27, 2008
Format: Paperback Verified Purchase
This is a decent getting started book, but it doesn't give good coverage of things such as NUnit projects or using app.config files with NUnit.

Unfortunately, this book isn't good as a stand-alone. I'll admit that it did help me get started, but it lacks so much that I can't give it more stars. A second volume that covers more advanced topics is suggested, or the next edition can add the missing parts.
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
5 of 6 people found the following review helpful By SSC on July 12, 2006
Format: Paperback
I was using NUnit within an hour of reading this book. I found it very easy to read. It has helped me transition into a Test Driven Development frame of mind.

Just using NUnit to write test fixtures for existing code reveals instantly where code should be refactored due to high level of dependency. I recommend this to every .NET developer.
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
4 of 5 people found the following review helpful By Adam Rackis on December 28, 2010
Format: Paperback Verified Purchase
I really wanted to give this book 3 stars; the authors seem like very nice people, and the book is friendly and readable. Unfortunately, the content is very lacking.

Their UI testing chapter was limited to a discussion of various tools that allow you to test-run the actual GUI, but was bereft of patterns like MVP/MVC that exist for the purpose of UI testing.

IoC was virtually if not literally unmentioned.

The mocking chapter was very very light, and mentioned Rhino only in one of those side boxes, not as actual content in the book (!!)

This is one of those books that will give beginners a false sense that unit testing is easy, who then wind up making a mess in a real-world project.

And as noted by other reviewers, the book was written in insufferably chatty prose, which somehow only added up to 190 pages

I'm just starting the Osherove, and it seems outstanding so far.
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