legacy code
Existing code you have inherited, usually with few or no tests, that others depend on.
In more detail
The first step with legacy code is often to write tests that pin its current behaviour, even where that behaviour is known to be wrong, so later changes are safe. Seams and characterization tests are the standard tools for getting it under control.
Related terms
- characterization test — A test that records what existing code currently does, right or wrong, so you notice if a change alters it.
- seam — A place in the code where you can swap in different behaviour without editing the code itself, such as a parameter.
- refactoring — Restructuring working code to make it clearer or easier to change without changing what it does.
Taught in
- One Assertion Per Reason — Automated Testing, TDD & Quality Engineering