Programming Books C Java PHP Python Learn more Browse Programming Books
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

Pragmatic Unit Testing in C# with NUnit, 2nd Edition (Pragmatic Starter Kit Series, Vol. 2) Paperback – September 6, 2007

ISBN-13: 978-0977616671 ISBN-10: 0977616673 Edition: Second Edition

See all 3 formats and editions Hide other formats and editions
Amazon Price New from Used from Collectible from
Paperback
"Please retry"
$12.34 $0.01
Paperback, September 6, 2007
$16.68 $0.82

Free%20Two-Day%20Shipping%20for%20College%20Students%20with%20Amazon%20Student



NO_CONTENT_IN_FEATURE

Shop the new tech.book(store)
New! Introducing the tech.book(store), a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Product Details

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

Editorial Reviews

Review

"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, www.XProgramming.com

"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.


More About the Authors

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

Customer Reviews

I found it very easy to read.
SSC
The book then explains how this function, if it behaves properly, should perform.
DR
This is a great introduction to writing unit tests in C# with NUnit.
ueberhund

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. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
44 of 54 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. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
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. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
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. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
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. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
1 of 1 people found the following review helpful By B. G. Palin on February 2, 2010
Format: Paperback
This book is a slim one, just over 200 pages, and provides an easy introduction to writing unit tests. It explains the concept of unit testing, why they are beneficial, and carries on with how to write and manage tests.

The reader is gently introduced to the code, and shown how a unit test can be written without a test framework. NUnit is then introduced and is used to automate most of the gritty details. There is a basic overview of mock objects, and a mention of the NMock tool. The book briefly mentions test-driven development, code coverage, UI tests, and refactoring, but does not go into them in any depth. Which is fine, since this is intended as a focused introduction to unit testing.

For anyone new to unit testing in .NET, this book is worth a read. It does not go into much depth, but does the job as introductory material. If you are already comfortable with unit testing and NUnit, I can recommend The Art of Unit Testing: With Examples in .Net as a more advanced book.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Product Images from Customers

Most Recent Customer Reviews

Search
ARRAY(0xa564d2b8)