This article needs more sources for reliability. (February 2013) (Learn how and when to remove this template message)
Legacy code is source code from software that is no longer maintained or supported by its creator. The term was first used by Computer Scientist George Olivetti when talking about code maintained by an administrator that did not create the code. [source?] The term can also mean code added to modern software to make an older, no longer existent feature working — for example, the usage of a serial interface, even though modern computers do not have a serial port. It can also be with supporting older types of files[source?], for example, types of files that may have used non-ASCII characters, like EBCDIC [source?]
Usually, most source code depends on functions of the platform (like the operating system) that it is made for — even if a programmer uses a programming language that works across platforms, like Java, it is hard to write a large program that is completely independent of its environment. If a manufacturer upgrades the platform, the old code may no longer work without changes, and becomes legacy code. A large part of the task of a software engineer is to change their code to prevent this and ensure it runs on all of its targeted platforms.
Although the term usually refers to source code, it can also describe executable code that can't run on a later version of a system, or requires a compatibility layer to work. For example, a "classic" Macintosh application which cannot normally run on Mac OS X, but can run inside the Classic environment on a PowerPC-based Mac, or a Win16 application running on Windows XP using the Windows on Windows feature in 32-bit versions of Windows.
Modern interpretations[change | change source]
More recently, the software engineering community developed other meanings for the term legacy code. Some of these include source code inherited from someone else and source code inherited from an older version of the software. Michael Feathers introduced a definition of legacy code as code without tests, because legacy code is often more difficult to work with, especially without automated regression tests. He also defined Characterization Tests to start putting legacy code under test.
See also[change | change source]
References[change | change source]
- Michael Feathers' Working Effectively with Legacy Code (ISBN 0-13-117705-2)