Home > .NET, Extreme Programming, Test Driven Development > Legacy TDD: Don't write all the missing tests

Legacy TDD: Don't write all the missing tests

A new project for Thycotic requires major enhancements to a legacy application.There are no existing tests. Where dowe begin?

This is the first post in a newblog series on the issues as they are tackledin this project. The usual advice you receive in thissituation is: Don’t write all the missing tests.

Why not? Several reasons …

  • You probably don’t understand the system well enough to write good tests
  • Eachtest should just pass as it verifies an existingfeature – this breaks the “fail, pass, refactor, pass” process of TDD
  • You will probably have large areas of missing coverage as it is difficult to test thoroughly after the fact
  • There will be no new features added while you spend all your time writing tests – this can be cost and timeprohibitive depending on the size of the existing system

This same advice says to ratheradd a test when you finda bug or need to work on an enhancement. Over time the number of tests for your application will grow and all will be good. Sounds great but how does it really work and where do you start?

Stay posted for the next in the series: The first test

  1. Brian Button
    January 3, 2005 at 2:41 am

    Check out Michael Feathers’ book, Working Effectively with Legacy Code. He’s tackled this same issue, too.

    — bab

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: