Characterization Test
From Wikipedia, the free encyclopedia
In computer programming, a characterization test is a mean to describe (characterize) the actual comportment of an existing piece of software.
The goal of Characterization Tests is to help developers verify that the modifications made to a reference version of a software system did not modify its behavior in unwanted or undesirable ways. They enable, and provide a safety net for, extending and refactoring code that does not have adequate unit test.
Characterization Tests are a mean to automate testing of legacy code.
Unlike Regression Tests, to which they are very close, they do not verify the correct behavior of the code, but the behavior that was observed when they have been written. Characterization tests are, essentially, change detectors. It is up to the person analyzing the results to determine if the detected change was expected and/or desirable, or unexpected and/or undesirable.
This term was coined by Michael Feathers in its book Working effectively with legacy code (ISBN 0-13-117705-2).
One of the interesting aspects of characterization tests is that, since they are based on existing code, it's possible to generate some characterization tests automatically. An automated characterization test tool (ACTT) would exercise the existing code with a wide range of relevant and/or random input values, record the output values (or state changes) and generate a set of characterization tests. When the generated tests are executed against a new version of the code, they will produce one or more failures/warnings if that version of the code is modified in a way that changes a previously established behavior.
External reference:
Characterization Tests
JUnit Factory a free experimental characterization test generator for Java and JUnit.
Working Effectively With Characterization Tests first in a blog-based series of tutorials on characterization tests.