WhatIs.com defines unit testing as a process in which "the smallest testable parts of an application, called units,...
are individually and independently scrutinized for proper operation." Unit testing can be a manual process or an automated one -- but, either way, it can be a time-consuming, documentation-filled endeavor.
For .NET programmers using Visual Studio 2005, the only way to take advantage of unit testing functionality is by purchasing Visual Studio 2005 Team Edition for Software Testers. As a result, open-source unit testing tools such as NUnit proved to be quite popular. (Microsoft addressed this deficiency by adding integrated unit testing to Visual Studio 2008 Professional Edition.)
Pragmatic Unit Testing in C# with NUnit introduces ways that C# programmers can introduce better tests, and catch more bugs, without adopting methodologies like test-driven development or extreme programming.
The first chapter of the book provides an introduction to unit testing -- what it is, how it works, what benefits it offers and how it affects productivity. Authors Andy Hunt and Dave Thomas end the chapter by dispelling some common myths about unit testing, such as "It takes too long to run the tests" and "I don't really know how the code is supposed to behave so I can't test it."
Excerpted from Pragmatic Unit Testing in C# with NUnit, First Edition (ISBN: 9780974514024) by Andy Hunt and Dave Thomas.
Copyright © 2004. Published by O'Reilly Media Inc.. Reprinted with permission.