Tuesday, April 10, 2007

Legacy Code = Code without tests

Saw this definition from a blog entry here. It origins from book "Working Effectively with Legacy Code". This makes perfect sense in most cases: the fear of making changes in "legacy code" largely derives from the fact that the system is untestable. Before TDD became a rather common software development practise, "legacy code" normally refers to code without detailed documentation. I tend to think of unit/integration tests as a type of documentation under TDD. After all, there is no better way to describe the specification of an application than actually using it.