Red Green Repeat Adventures of a Spec Driven Junkie

Journey to TDD - Legacy Systems

If you found this article and want to start at the beginning, this series starts here.

Testing may not always be the right answer, so there are cases where testing doesn’t make sense.

Does that mean one can use that excuse for any project? If you want to be a world-class developer, you balance when to test and when not to.

More importantly, you must know how to test. What a testable function looks like. How to construct code that makes it easy to test, even if you’re not writing tests.

Testing legacy systems is one of the hardest job any programmer will have.

What’s a legacy system?

A legacy system is any system that doesn’t have any tests.

Yes, that includes your code! You might know the code inside and out now, how about in a week? After two weeks of vacation? How about during a production fire?

How about your coworkers in those situations?

Avoid the “legacy system” problem and construct your code testable, even without writing tests.

That means: you must know how to test. In an untested environment, knowing this is important.