or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
Sell Back Your Copy
For a $13.62 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
The Art of Unit Testing: With Examples in .Net
 
 
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.

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

Roy Osherove (Author)
4.8 out of 5 stars  See all reviews (36 customer reviews)

List Price: $39.99
Price: $24.34 & eligible for FREE Super Saver Shipping on orders over $25. Details
You Save: $15.65 (39%)
  Special Offers Available
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 delivered Monday, January 30? Choose One-Day Shipping at checkout. Details
Textbook Student FREE Two-Day Shipping for Students. Learn more

Formats

Amazon Price New from Used from
Paperback $24.34  

Book Description

1933988274 978-1933988276 July 5, 2009 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

Special Offers and Product Promotions

  • Buy $50 in qualifying physical textbooks, get $5 in Amazon MP3 Credit. Here's how (restrictions apply)

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

Show availability and shipping details

Buy the selected items together
  • In Stock.
    Ships from and sold by Amazon.com.
    Eligible for FREE Super Saver Shipping on orders over $25. Details

  • Dependency Injection in .NET $31.35

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details

  • C# in Depth, Second Edition $30.42

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details


Customers Who Bought This Item Also Bought


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: 9.4 x 7.4 x 0.7 inches
  • Shipping Weight: 1.2 pounds (View shipping rates and policies)
  • Average Customer Review: 4.8 out of 5 stars  See all reviews (36 customer reviews)
  • Amazon Best Sellers Rank: #16,078 in Books (See Top 100 in Books)

More About the Author

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

 

Customer Reviews

36 Reviews
5 star:
 (28)
4 star:
 (7)
3 star:
 (1)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
4.8 out of 5 stars (36 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

23 of 25 people found the following review helpful:
5.0 out of 5 stars Approachable Yet Thorough, June 9, 2009
By 
Mark Seemann (Copenhagen, Denmark) - See all my reviews
(REAL NAME)   
This review is from: The Art of Unit Testing: With Examples in .Net (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 :)
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


15 of 16 people found the following review helpful:
5.0 out of 5 stars Best book on Unit Testing - Ever, July 5, 2009
By 
BOO (Roanoke, VA USA) - See all my reviews
This review is from: The Art of Unit Testing: With Examples in .Net (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.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


7 of 7 people found the following review helpful:
5.0 out of 5 stars Succinct, Pragmatic and Actionable, July 19, 2009
By 
R. Garibay (Phoenix, Arizona) - See all my reviews
(REAL NAME)   
This review is from: The Art of Unit Testing: With Examples in .Net (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.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews











Only search this product's reviews



Inside This Book (learn more)
Browse Sample Pages:
Front Cover | Table of Contents | First Pages | Index | Back Cover | Surprise Me!
Search Inside This Book:

What Other Items Do Customers Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(15)
(13)

Your tags: Add your first tag
 

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

Customer Discussions

This product's forum
Discussion Replies Latest Post
Must-Have Books for your shelf 2 Jun 7, 2009
See all discussions...  
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
   
Related forums





Look for Similar Items by Category


Look for Similar Items by Subject