What is legacy code?

Legacy code can have multiple definitions:

  • code we have gotten from someone else
  • a slang-term for difficult-to-change code that we don’t understand
  • code without tests. Without tests we can’t be sure if our code base is getting worse or better. With tests we can change the behaviour of our code quickly and verifiably.

Working Effectively with Legacy Code (Robert C. Martin Series)