Learning Guide

Better software through debugging and unit testing -- Unit testing, Extreme Programming and TDD

TABLE OF CONTENTS
   Software debugging basics
   Unit

    Requires Free Membership to View

testing basics

   Unit testing, Extreme Programming and TDD
   Debugging for security
   Other useful resources



  Unit testing, XP and TDD

Unit testing is a key element of Extreme Programming (XP). A practitioner of XP, however will approach unit testing differently than an adherent of another software development methodology. XP practitioners follow test-driven development (TDD), which requires a style of unit testing that's quite intensive.

There are many tools and frameworks for unit testing, as this extensive list demonstrates. However, the mind behind XP created the first popular unit testing tool, which sparked the entire line of xUnit frameworks. The following links will mention many tools, but JUnit for Java and NUnit for -- you guessed it -- .NET come up most often.

  • Article: Unit tests -- Lessons learned -- This short introductory article from extremeprogramming.org is a good place to begin learning about unit testing in the context of Extreme Programming. There are helpful links, including one to download a unit testing framework. For those lacking inspiration, the article also links to an older (2001) but relevant article from Ron Jeffries, Essential XP: Unit tests at 100.


  • Article: Advanced unit testing, part 1 -- Author Marc Clifton has a rather cynical view of unit testing and XP. "This is a meandering article on the issues of unit testing and the Extreme Programming (XP) process," he warns his audience. "And what's worse, this is Part I of four articles," he adds. But readers shouldn't be put off. This is a comprehensive, organized (in outline form, no less) tutorial on unit testing in general and how it applies to XP specifically. It is tailored to the beginner, and code samples and tool descriptions abound.


  • Article: The importance of unit testing -- This is a short and sweet introduction to unit testing and XP.


  • Article: Introduction to test-driven design (TDD) -- This is a clean, clear, well-organized description of TDD. There are numerous graphics, a "myths and misconceptions" chart and a host of links.


  • Article: Testing with JUnit -- This is a basic tutorial on how to use JUnit in Java applications. Those looking for more information on this tool may want to check out JUnit.org.


  • Article: Testing project using NUnit -- A concise tutorial for beginners, heavy on the screenshots and code samples. "Testing .NET components using NUnit" is slightly heavier fair. And "NUnit allows effective unit testing with .NET applications" offers up a definition of test-first development, which in this case the author conflates with TDD. Like JUnit, NUnit has its own site -- NUnit.org for good measure.


  • Article: TDD design starter kit -- State vs. interaction testing -- Moving beyond regular (state) unit testing, Jeremy Miller explores a different perspective: interaction unit testing. He provides examples and explanations.


  • Tip: Using JMock in test-driven development -- This excellent tip from Paulo Caroli introduces the concepts of mock objects and TDD before delving into how to use the JMock tool. Caroli is generous with diagrams and code samples.


  • Article: Unit testing and test-driven development (TDD) for Flex and ActionScript 3.0 -- Valuable even if you aren't using Flex or ActionScript 3.0, this article offers another perspective on TDD and unit testing.


Visit our next section, Debugging for security, for information on how to find security flaws in software.

This was first published in November 2007

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: