characterization test
A test that records what existing code currently does, right or wrong, so you notice if a change alters it.
In more detail
Writing it is a respectable step while bringing legacy code under control, as long as everyone knows the test pins current behaviour rather than correct behaviour. When you fix the bug, you change the test on purpose.
Related terms
- legacy code — Existing code you have inherited, usually with few or no tests, that others depend on.
- regression — A bug where something that used to work stops working, or works worse, after a change.
Taught in
- One Assertion Per Reason — Automated Testing, TDD & Quality Engineering