# What a characterisation test can tell you

> Learn what a characterisation test preserves during a refactor, and when a legacy system’s observed behaviour needs review against an independent rule.

Source: https://cueapril.com/knowledge/explanations/characterisation-and-correctness
Updated: 2026-12-02
Index: https://cueapril.com/llms.txt

## Does a characterisation test establish that legacy behaviour is correct?

A characterisation test captures a system’s observed behaviour on chosen inputs. It can reveal a behavioural change during a refactor. Establishing that the behaviour is correct also requires a requirement, rule or independently reviewed example.

## Why capture a result you cannot yet justify?

A legacy component may have users who depend on undocumented details. Recording a representative set of outputs at a stable interface makes a refactor easier to review. Label the build, fixture and reason for capturing each expectation so its origin remains visible.

## How does an observation become a requirement?

Ask someone responsible for the behaviour to review the example. If they confirm the expectation, record its rationale and make it an explicit rule. If they identify a defect, keep the evidence of the old behaviour and write a new check for the agreed correction.

## Worked example: An old importer drops blank lines

A characterisation case shows that a blank line between two catalogue items disappears during import. It can flag a refactor that starts creating an empty item. The catalogue owner can then explain whether blank lines should be ignored, rejected with a message or preserved.

## 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](https://app.cueapril.com/sign-up/?next=%2Fquality-start)

## Related reading

- [Characterisation test](https://cueapril.com/knowledge/definitions/characterisation-test)

- [How to choose a test oracle](https://cueapril.com/knowledge/how-to/select-a-test-oracle)

- [How circular testing gives AI-generated code a false pass](https://cueapril.com/knowledge/explanations/how-circular-testing-happens)

[Browse the Knowledge base](https://cueapril.com/knowledge)
