Tip

Book excerpt: Pragmatic unit testing in C# with NUnit

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

Read "Introduction to unit testing"in this PDF file.

 


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.

This was first published in February 2008

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.