Working Effectively with Legacy Tests

At the Agile Cambridge conference on the 1st of October, Duncan McGregor and I are running a workshop entitled Working Effectively with Legacy Tests.

Legacy what

In Working Effectively with Legacy Code, Michael Feathers defined "legacy code" as "code without tests". But not all test code is a panacea. I have often encountered what I can only describe legacy tests.

I define legacy tests as:

You have legacy tests if you usually change the code then fix the tests to match the code

Legacy tests are still useful. They reduce risk by catching unexpected regressions. But it is often difficult to know why a regression occurs and time is wasted diagnosing the underlying problem. Legacy tests don't pull their weight. They add a continual overhead to every change you make.

Symptoms of legacy tests I have encountered include:

Does any of that sound familiar? If so, please bring some examples of your tests to our workshop.

We will run the workshop as a cross between a mob programming session and a clinic. Bring some legacy tests from your own projects. We will work together, in a mob programming style, to improve them. Along the way we will share techniques for writing effective tests and refactoring tests from burdensome legacy to a strategic asset.

Cartoon by Thomas Rowlandson, uploaded to Flickr by Adam Asar. Used under the Creative Commons Attribution 2.0 Generic license.

Copyright © 2015 Nat Pryce. Posted 2015-09-10. Share it.