What is Legacy Code?
Legacy code is existing software that is difficult to modify, extend, or replace, typically because it was written with older technologies, lacks documentation, has no automated tests, or the original developers have left the organization.
Michael Feathers defines legacy code simply as "code without tests." This definition captures the core problem: legacy code is code you're afraid to change because you can't verify that your changes don't break existing functionality.
Legacy code is not inherently bad — in fact, much legacy code is battle-tested and reliable. The problem is that it becomes increasingly expensive to maintain and nearly impossible to extend. Organizations often spend 60-80% of their engineering budget maintaining legacy systems rather than building new capabilities.
Why It Matters
Legacy code is the largest hidden cost in most software organizations. When 70% of your engineering team is maintaining systems rather than building new features, you're paying innovation-era salaries for maintenance-era work. This is what Richard Ewing calls the Innovation Tax.
The decision to rewrite vs. refactor legacy code is one of the highest-stakes decisions a CTO can make. Joel Spolsky famously called rewrites "the single worst strategic mistake that any software company can make." Yet sometimes a rewrite is the only viable path forward.
Frequently Asked Questions
What is legacy code?
Legacy code is existing software that is difficult and risky to modify. It typically lacks tests, documentation, and the original developers may have left the organization.
Should you rewrite legacy code?
Usually no. Incremental refactoring is safer and less risky than a full rewrite. However, if the legacy system is on an obsolete platform or the Technical Insolvency Date is approaching, a rewrite may be necessary.
How much does legacy code cost?
Organizations typically spend 60-80% of their engineering budget maintaining legacy systems. Use the Product Debt Index (PDI) at richardewing.io/tools/pdi to calculate the dollar cost of your legacy burden.
Free Tools
Related Terms
Free Tool
Quantify your legacy code burden
Use the free Product Debt Index diagnostic to put numbers behind your legacy code challenges.
Try Product Debt Index Free →Need Expert Help?
Richard Ewing is a Product Economist and AI Capital Auditor. He helps companies translate technical complexity into financial clarity.
Book Advisory Call →