or
Sign in to turn on 1-Click ordering
Sell Us Your Item
For a $9.77 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Sorry, this item is not available in
Image not available for
Color:
Image not available

To view this video download Flash Player

 

The Art of Unit Testing: With Examples in .Net [Paperback]

Roy Osherove
4.7 out of 5 stars  See all reviews (41 customer reviews)

List Price: $39.99
Price: $25.04 & FREE Shipping. Details
You Save: $14.95 (37%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.
Want it Wednesday, May 29? Choose One-Day Shipping at checkout. Details
Free Two-Day Shipping for College Students with Amazon Student

Formats

Amazon Price New from Used from
Paperback $25.04  
Amazon.com Textbooks Store
Shop the Amazon.com Textbooks Store and save up to 70% on textbook rentals, 90% on used textbooks and 60% on eTextbooks.
There is a newer edition of this item:
The Art of Unit Testing: With Examples in .NET The Art of Unit Testing: With Examples in .NET
$32.20
Available for Pre-order

Book Description

July 5, 2009 1933988274 978-1933988276 1

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 guides you step by step from simple tests to tests that are maintainable, readable, and trustworthy. It covers advanced subjects like mocks, stubs, and frameworks such as Typemock Isolator and Rhino Mocks. And you'll learn about advanced test patterns and organization, working with legacy code and even untestable code. The book discusses tools you need when testing databases and other technologies. It's written for .NET developers but others will also benefit from this book.

Table of Contents:

  1. The basics of unit testing
  2. A first unit test
  3. Using stubs to break dependencies
  4. Interaction testing using mock objects
  5. Isolation (mock object) frameworks
  6. Test hierarchies and organization
  7. The pillars of good tests
  8. Integrating unit testing into the organization
  9. Working with legacy code

Frequently Bought Together

The Art of Unit Testing: With Examples in .Net + Dependency Injection in .NET + C# in Depth, Second Edition
Price for all three: $86.42

Buy the selected items together


Editorial Reviews

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 http://www.ISerializable.comISerializable.com.


Product Details

  • Paperback: 320 pages
  • Publisher: Manning Publications; 1 edition (July 5, 2009)
  • Language: English
  • ISBN-10: 1933988274
  • ISBN-13: 978-1933988276
  • Product Dimensions: 7.4 x 0.7 x 9.2 inches
  • Shipping Weight: 1.3 pounds (View shipping rates and policies)
  • Average Customer Review: 4.7 out of 5 stars  See all reviews (41 customer reviews)
  • Amazon Best Sellers Rank: #50,570 in Books (See Top 100 in Books)

More About the Author

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

Customer Reviews

4.7 out of 5 stars
(41)
4.7 out of 5 stars
Most Helpful Customer Reviews
28 of 30 people found the following review helpful
5.0 out of 5 stars Approachable Yet Thorough June 9, 2009
Format:Paperback
This book covers unit testing in .NET from a pragmatic, yet thourough and passionate, perspective. In brief, it covers many important dimensions of unit testing from simple "hello world" tests over the use of Stubs and Mocks to how you write maintainable test code. It also covers organizational topics such as how you introduce unit testing in an organization and how to do code reviews of tests.

Although unit testing has become somewhat synonymous with Agile practices, such as Test-Driven Development (TDD), the book never assumes that you will be using TDD. It is valuable wether you write your tests before or after your code.

Roy Osherove clearly has a lot of experience with unit testing, and he willingly shares so we can learn from his mistakes and successes. As a long-term practitioner of TDD myself, I can vouch for most of the advice imparted by this book: It is based on established patterns and best practices that the unit testing community have arrived at through years of experimentation.

Being the anal-retentive perfectionist that I am, I would have liked to see the book adopt the Pattern Language of xUnit Test Patterns: Refactoring Test Code (Addison-Wesley Signature Series), but at least the guidance of those two books are very much in harmony, even if the terminology differs.

In summary, you can say that this book is a very readable and useful introduction to unit testing. If you are a beginner to intermediate unit test developer, you should definitely read this book - and then, as you become more advanced, you should still read xUnit Test Patterns :)
Comment | 
Was this review helpful to you?
17 of 19 people found the following review helpful
5.0 out of 5 stars Best book on Unit Testing - Ever July 5, 2009
By BOO
Format:Paperback
This book is not an evolutionary book to other unit testing books out there; it's revolutionary.

First of all it's not a thinly disguised book trying to sell you on TDD (as some unit testing books that I've read are), but rather it's a book that truly lives up to it's title - the art of unit testing.

Secondly, the discussions and examples in the book take real world considerations in mind. These are not simple contrite 'Hello World' tests, or 'perfect world' sets of code. It discuss' writing tests on both green and brown field applications.

A third aspect that is truly helpful is that there is an entire section for dealing with implementing unit testing in an organization and the politics you might face while doing so. Because the book isn't biased towards a particular software discipline, tool, or language, but on the 'art' of unit testing, these are tips and tricks you can take with you anywhere.

If you found books like 'The Pragmatic Programmer' or 'The Inmates are Running the Asylum' getting you revved up to write better software, then this book will drive you to a whole new level of unit testing.

I've been doing unit testing for several years now, but it wasn't until after I read this book, that it no longer was a chore that I checked off my 'TODO' list.
Comment | 
Was this review helpful to you?
9 of 9 people found the following review helpful
5.0 out of 5 stars Succinct, Pragmatic and Actionable July 19, 2009
Format:Paperback
The Art of Unit Testing: with Examples in .NET

In short, if you want a tactical book on unit testing that distills the passion and love of an expert practitioner into a very readable yet reference-friendly text on unit testing, this is it.

If you are new to unit testing or TDD, this book will demystify the practices, tools and techniques that would otherwise take years and lots of frustration to get right.

If you are an experienced practitioner of unit testing and TDD, and are already practicing SOLID, TOOD, and BDD not just as a flavor of the week but as a way of life, this book will provide unambiguous insight into different approaches that will help you refine your existing techniques or at a minimum, validate your approach which is always valuable to any developer who has an opportunity to review his/her techniques with a seasoned master. This book will afford you that opportunity.

While the book cites excellent references for TDD and design patterns, if there is one thing that I thought was missing was a narrative- even if by way of an appendix- that ties all of the techniques covered together in an example of building the example Logger component using TDD. I understand that this book is not about TDD, but at the same time, that's like a book on scuba equipment that teaches you precisely how to pressurize your CO2 tank, keep your mask from fogging up and care and maintenance of your scuba suit not being about scuba diving.

That said, knowing Roy, it must have been painful to resist a detailed examination on TDD, but, for this book to be effective, it had to be relatively short, to the point and most of all pragmatic for it to succeed at filling the void on the topic of unit testing techniques and practices. To that end, Roy hits the mark very elegantly without being pretentious, catering to those who test first, test last or don't (yet) test at all. While I would love for everyone to pick this book up and start doing TDD today, even if you aren't yet convinced on TDD, applying these techniques to writing code that is testable, and learning how to test the right things will be an instant asset to your product, your team and your organization.
Comment | 
Was this review helpful to you?
Most Recent Customer Reviews
5.0 out of 5 stars Learned a Lot
Great book. Most of the material I had already learned from others, but I still learned some new things. It was a pretty easy read, not too technical, but still informative. Read more
Published 1 month ago by Bryce
5.0 out of 5 stars The Head First Book
This book is a great head first tool for unit testing. The language of book is very clearance. Code samples are written in .NET platform. Read more
Published 2 months ago by bayram üçüncü
5.0 out of 5 stars Great jumpstart to improving your unit tests... in any language
I work on a 75 programmer project in C++ and this book has had a noticible effect on the quality of our unit tests. I read the book after one year of unit testing experience. Read more
Published 11 months ago by Matthew Jessick
5.0 out of 5 stars Great overview of unit testing
I have been doing unit testing for a while, but never learned the "right way." This book pointed out the good and bad of what I have been doing and had great suggestions. Read more
Published 14 months ago by Regan H. Thacker
5.0 out of 5 stars Must read for .net devs
The book is well-written, covers core TDD topics and their appliance to .NET. I would recommend it to everyone who wan't to undertand what Unit Testing is even if you are not a... Read more
Published 15 months ago by Stoune
3.0 out of 5 stars It is not sufficient for real application
This book gives you a very good introduction for unit testing and the explanation is neat and easy to understand. Read more
Published 15 months ago by Goh Siang Hwee
3.0 out of 5 stars A Good Introduction
I thought this book was okay for starting out unit testing. I don't think it gives a developer enough ground work to successfully use unit testing on their first project, but it... Read more
Published 16 months ago by Travis Parks
5.0 out of 5 stars excellent quality and delivered on time (oversea)
Excellent book on unit level testing. The order give also access to pdf, kindle, epub versions as well. Read more
Published 17 months ago by Dan A.
5.0 out of 5 stars Unit testing at its best!
Only a few chapters in, but a very good book. Roy seems very good so far about taking a moment to be very clear about the *reasons* behind doing something. Read more
Published 19 months ago by Graeme J Reisinger
5.0 out of 5 stars Great book on unit testing in the .NET ecosystem
This book provides great insight into unit testing and TDD in .NET. To be honest I bought this book when I started doing TDD and unit testing and it stayed as a reference book. Read more
Published 22 months ago by Slo
Search Customer Reviews
Only search this product's reviews

What Other Items Do Customers Buy After Viewing This Item?


Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Forums

Topic From this Discussion
Must-Have Books for your shelf
I second this review, though I've only read the first 6 chapters. What I have read is good stuff and he answers many of my questions about how to write testable code.
Mar 22, 2009 by Alf Lervĺg |  See all 3 posts
Have something you'd like to share about this product?
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Search Customer Discussions
Search all Amazon discussions


So You'd Like to...


Create a guide


Look for Similar Items by Category