Industrial Logic -> Catalogs -> Activity Catalog -> Unit Testing Legacy Code

Unit Testing Legacy Code

To refactor legacy code, you need good unit tests. To write good unit tests, you need to refactor your legacy code. How do you get out of such a mess? First, you isolate what it is you would like to unit test and refactor. Next, you use whatever language is simplest to produce coarse-grained tests for that area of code. Once you've written enough of the coarse-grained tests, you'll be able to implement coarse-grained refactorings, without fear of breaking your code.

Flavor: standard
30 to 60 minutes

We'll begin by telling some war stories of how we've unit tested legacy code (for example, C++ COM objects using a Javascript unit testing tool). Then we'll launch into a dialogue focused on generic issues surrounding unit-testing legacy code as well as specific recommendations for how to unit-test your legacy code.

ID: 30A
Flavor: challenge
1 to 2 hours

Participants will be introduced to a piece of legacy code for which there are no tests. Participants must then write tests for the code. At the conclusion of this exercise, we'll compare what kinds of tests people wrote.

ID: 30B

Industrial Logic, Inc.

Next 5 Activities
· Mock Objects
· Unit Testing Tool
· Test-Driven HTML
· The Refactoring Challenge
· Code Smells

Catalogs
· Activity Catalog
· Experience Catalog
· Workshop Catalog

         			Send mail to webmaster@industriallogic.com with questions or comments about this web site.
Copyright © 1995-2004 Industrial Logic, Inc. All Rights Reserved.