Definition
Characterisation test
What is a characterisation test?
A characterisation test records what an existing system does for chosen inputs and detects changes to those observations. It gives a team a reference point during a refactor or migration when the intended behaviour is only partly understood.
What should a reviewer do when the result changes?
Check where the expected value came from. A captured value can preserve an old defect as easily as a useful convention. Compare the observation with an example approved by the people who own the behaviour. Once intent is clear, write that rule into the test and explain the decision.
Worked example
Preserving a legacy catalogue export
Before replacing an exporter, record how it writes a missing subtitle, a quoted title and the final newline. A change from an empty cell to the word “null” then appears in review. A reader of the export can confirm which representation its importer expects.
Try it on your pull request
Choose a change in your repository and tell Cue April what should happen. Review the proposed checks before they run.
Try Cue April on your repository