Learn how to improve your Java coding skills using unit testing. Despite it's name, unit testing is really a coding technique, not a testing technique. This book shows how to write tests, but more importantly, goes where other books fear to tread and gives you concrete advice and examples of what to test. Discover the tricky hiding places where bugs breed, and how to catch them using the freely available NUnit framework. It's easy to learn how to think of all the things in your code that are likely to break. We'll show you how with helpful mnemonics, summarized in a handy tip sheet (also available from our web site). But the best part is that you don't need to adopt Extreme Programming, or Test-Driven Development, or change your whole development process in order to reap the proven benefits of unit testing, the pragmatic way.
Review By: Stefan Turalski 09/12/2005"Pragmatic Unit Testing in C# with NUnit," by Andrew Hunt and David Thomas--known as the Pragmatic Programmers--, is a book that reveals almost everything about itself in the title. The main topic of this book is the unit testing technique; its premise is to describe this practice–pragmatically. The book starts with brief explanations about unit testing and its benefits. Unit testing novices should appreciate the general information about preparation of unit tests and the like.
Hunt and Thomas provide introductory steps to NUnit usage, and introduce a detailed overview of unit testing framework. They talk about some best practices that are worth reading--even if you know the solution. For an NUnit or unit testing novice, these chapters contain the best-written descriptions I have ever read.
Several chapters cover some of the most valuable information essential to unit testing practices, which includes what to test, what a good test looks like, and how to test a project. Hunt and Thomas also present information about the relation of design and refactoring to the unit testing approach. If you are not accustomed to unit testing or NUnit, you will be gently guided toward all the knowledge you need to begin. In addition, you will acquire knowledge that even experienced users rarely have. The code examples are clearly written and well commented. This book is a perfect pragmatic introduction to unit testing.
"Pragmatic Unit Testing in C# with NUnit" was like a fresh breeze. After so many books about test-driven development and unit testing, I finally got pragmatic instruction on the "how-to's." The authors convincingly declare that unit testing is a crucial technique for any developer--not only for those who work on high-quality-assured projects. The content of this book is perfectly organized. This book is not preachy, but simply provides the reader with a general set of practices, which used in addition to the unit testing approach, make his code much more reliable. The C# language or the NUnit tool may change over time, but the guidelines written by the Pragmatic Programmers will always be useful.
Even as an experienced NUnit user, this book reminded me of forgotten categories. The chapters on unit testing best practices also refreshed my memory. This book helped me to better review code, and even improve test design.
Every tester and developer should be familiar with practices related to unit testing. This should be a first reference for every C# developer, starting the unit testing adventure.