Characterization testing: adding tests to legacy code