The Artima Developer Community
Sponsored Link

Thinking Upside Down
Unit Testing Frameworks - When to Abandon or Migrate?
by Andy Dent
October 11, 2008
Summary
A large body of unit tests as a regression test system is important to many organizations. What do you do when your framework of choice dies or is neglected? When is it time to move on and how do you budget for abandoning or rewriting tests? Have you ever thought about being caught by this situation?

Advertisement

After several years in other languages, I've currently got two projects in C or C++ with a unit test requirement. One code migration and major refactoring presents an opportunity to add tests. The other project needs updating from Visual Studio.Net 2003 and already has a couple of hundred tests which I expect to keep running.

This is the kind of situation many people will encounter if there is a need to maintain a legacy project, especially a mature one which has worked with little maintenance for several years.

My first step was to go and get the current version of cppunit but with some dismay found that the projects included were last used with Visual Studio v6, don't build in VS.Net 2008 and the project admin has gone AWOL - emails bounce (Update: this bad impression is courtesy of a bug with sourceforge mail handling - I've since been contacted and told that webmail through the contact form works and the project is, just barely, alive).

Whilst there is a range of alternatives and debate over which C++ framework to use, due to my familiarity with its patterns and amount of legacy code with tests I am hesitant to migrate.

Thinking about the issue of migration made me wonder - do people ever plan for their testing framework going away?

Hopefully, the bulk of the test bodies would remain the same if you had to migrate, possibly with changes to the assert macros. However, I expect that the registration of tests, establishment of fixtures and combining tests into suite would all change significantly. These seem to be the areas of most dispute in how to design test frameworks :-)

Would you migrate to a new framework, or would you assume the burden of maintaining the old test framework as well as your code?

Talk Back!

Have an opinion? Readers have already posted 6 comments about this weblog entry. Why not add yours?

RSS Feed

If you'd like to be notified whenever Andy Dent adds a new entry to his weblog, subscribe to his RSS feed.

About the Blogger

Andy is a free-lance developer in C++, REALbasic, Python, AJAX and other XML technologies. He works out of Perth, Western Australia for a local and international clients on cross-platform projects with a focus on usability for naive and infrequent users. Included in his range of interests are generative solutions, software usability and small-team software processes. He still bleeds six colors, even though Apple stopped, and uses migration projects from legacy Mac OS to justify the hardware collection.

This weblog entry is Copyright © 2008 Andy Dent. All rights reserved.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use