Jump to ratings and reviews
Rate this book

Pragmatic Unit Testing in C# with NUnit

Rate this book
The NIST estimates that poor testing costs the US economy $60 billion annually. This book gives teams straightforward and proven ways to introduce unit testing into their process, resulting in higher quality and fewer bugs.

All over the world, software teams are using unit testing both to verify their code and as a way of helping them design better code. This book is unique in the way it covers two aspects: showing developers both how to test and helping them determine what to test.

New in the second edition:


Updated for NUnit 2.4 (.NET 2.0 and Visual Studio 2005) More assert methods New String and Collection assertion support Better support for multiple-platform development Higher-level setup and teardown fixtures Whole new chapter on extending NUnit and more!

227 pages, Paperback

First published January 1, 2004

6 people are currently reading
189 people want to read

About the author

Andy Hunt

23 books405 followers
see also Andrew Hunt

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.

Andy started writing software professionally in early 80's across
diverse industries such as telecommunications, banking, financial
services, utilities, medical imaging, graphic arts, and of course,
the now-ubiquitous web.

Source: Amazon.com

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
26 (16%)
4 stars
67 (43%)
3 stars
53 (34%)
2 stars
7 (4%)
1 star
2 (1%)
Displaying 1 - 6 of 6 reviews
Profile Image for Mohammad Elsheimy.
46 reviews8 followers
Read
December 24, 2021
Started reading the book earlier and could not even pass through a couple of chapters. The information in the book is outdated, configuration and setup is deprecated. I would not give it a rating as it was very helpful at the time of its writing, however, now, no way! For me, I switched to "The Art of Unit Testing, 2nd Edition" and it's super! I highly recommend that you switch too.
Profile Image for Jesper.
20 reviews
December 15, 2011
I didn't even know what unit testing was before I picked up this book.

At not much more than 150 pages, this book is small. It's part of a series called "The Pragmatic Starter Kit". That series is part of a larger series of books that started coming out after "The Pragmatic Programmer" was published.

I LOVE what unit testing promises. To be able to incrementally build code that is known to work AND be instantly alerted when you break it is very, very cool.

The book goes over the NUnit framework, walks you through the initial setup, and shows some unit tests in an example project.

After reading this book, I have no idea how to write a useful unit test.

My guess is that it must take a lot of experience to do it well and might even be a bit of an artform.

The book talks about testing principles, fence post errors, mock objects and edge case scenarios. Things like: testing for null or handing a pre-sorted algorithm to a sort algorithm.

None of that really helps me.

Because of this book, I understand why it's a good idea to write unit tests and what the common reasons are that developers give for not writing them.

Even though I scratch my head a lot when I try to write a unit test, I've started using them. I open the book up, look through the examples, and skim the chapters looking for an appropriate example. Most of the time I feel like I'm missing something.

I'm wondering if I need to read a different book, one that has more concrete examples or find an open source project that uses unit tests.
Profile Image for Andrii.
30 reviews
September 28, 2015
Ожидал большего и пожалел потраченного времени.
Больше напоминает какую-то бакалаврскую работу, когда студент начал работу за неделю до даты сдачи, залез в поисковик и начал копировать все, что попадает в категории юнит-тесты, nunit и C#.
Если Вы еще ни разу не сталкивались с понятием Юнит-тестов и желаете прочитать что-то обзорное, можно начать с этой книги.
Действительно полезными могут быть акронимы, которые описаны в книге - FIRST, Right-BICEP, CORRECT.
6 reviews
August 3, 2009
I was looking for something that would help me more in terms of validation testing rather than unit testing so my fault for expecting more out of the book than the title said.
Profile Image for Eric Olsson.
5 reviews
July 15, 2010
Great introduction to unit testing. This is one that I'll definitely be having to re-read since I'm sure I didn't pick up everything the first time.
Profile Image for William.
Author 1 book42 followers
May 5, 2013
after reading this book, I'm convinced unit testing is essential in all but the most trivial code projects.
Displaying 1 - 6 of 6 reviews

Can't find what you're looking for?

Get help and learn more about the design.