Welcome!

Java Authors: Michael Sheehan, Maureen O'Gara, Jonny Defh, Suresh Krishna Madhuvarsu, RealWire News Distribution

Related Topics: Java

Java: Article

Generating JUnit Tests for Legacy Java Applications

How to maintain apps you didn't write

Unit tests give us the confidence to change applications, even legacy applications that we didn't write ourselves. To avoid the drudgery of writing a test case for every edge and boundary, we can let JUnit Factory generate a large set of characterization tests for us. If we need to explore an existing code base, characterization tests can act as a learning guide by documenting what the code actually does. If we need to change existing code, characterization tests act as critical "change detectors" that help us avoid unforeseen side effects.

Tests Give Us the Confidence To Change
We often inherit applications that we didn't write. The application works and the users seem happy, at least for now. But, we still need to be ready to maintain the application as soon as the next bug report or enhancement request comes down the pike.

More Stories By Ted Husted

Ted Husted (http://husted.com/ted/) is a software engineer and an active member of several open source projects hosted by the Apache Software Foundation, including Struts and iBATIS. His books include JUnit in Action, Struts in Action, and Professional JSP Site Design. Ted is also a consultant for Agitar Software, Inc.

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
Alexander Klimuk 01/14/08 06:37:02 PM EST

This article resembles the video of Alberto Savoia from Agitar, which is available as of Sep 2007 at 'theserverside.com':
http://www.theserverside.com/news/thread.tss?thread_id=46931#239986

Well, a bit different wording, and that's all.

Why haven't you just placed a link to that video and discussion on TSS site?

Regards,
Alexander Klimuk