On this page3 sections
Imagine a support assistant that reads a return request and recommends either a standard return or a manual review. One customer writes, “I received it on Tuesday.” Another includes the same date in a forwarded receipt. If the policy, item and delivery date are unchanged, the assistant should make the same routing decision. Its words can vary. Its recommendation and the facts it relies on should hold.
Now imagine changing one fact that matters. The delivery date moves across the written return deadline. A system that answers both questions the same way has shown a different kind of failure. It can be steady in the face of a change it should have noticed.
Write the relationship before running the model
Metamorphic testing evaluates a relationship between runs. Instead of writing a perfect answer for every phrasing, you specify what should happen when an input changes in a carefully defined way. The expected relationship might be sameness or a specific direction of change. Ribeiro and colleagues’ CheckList work uses related behavioral checks such as invariance tests and directional expectations for language systems.
Take a hypothetical policy that accepts a standard return through day 30 after delivery. Define the policy version, the day-count convention and the decision you inspect before creating test pairs. Submit one test return request 25 days after delivery and another 35 days after delivery. In this setup, the latter goes to manual review. Next put a pair on days 30 and 31 to check the actual cutoff. Both cases can have open-ended explanations because the test checks the destination and the delivery date used, while leaving the wording free.
| Input change | Expected result |
|---|---|
| Express the same delivery date in a different unambiguous format | Same routing and same interpreted date |
| Add a greeting with no new facts | Same routing |
| Change the delivery date from 25 to 35 days before the request, under the hypothetical policy | Change from standard return to manual review |
Check the pair, then check the original
Use the same model, policy revision, tools and retrieval conditions across a pair unless one of them is the variable under test. Record enough context to reproduce failures, while keeping customer data out of the fixture. For a variable system, run several paired trials and track the fraction that satisfy the relationship. Decide ahead of time which failure rate triggers investigation and which decisions are too consequential to tolerate a failure at all.
Keep a small set of literal expected answers alongside the paired tests. Two runs can agree and both compute the date incorrectly. Similarly, a seemingly harmless rewrite can change meaning. “Last Friday” can refer to a different day if the timestamp or time zone changes. Reject a test pair when a person cannot explain why the intended decision should stay steady.
The assistant does not need to sound the same every time. Give it room to write naturally and a narrow set of commitments it has to keep. Then change one of the facts that should change its mind.
Sources
Sources & context
Sources linked in this article. Read alongside the author’s analysis; a citation does not independently verify a publisher’s claims.
- Ribeiro and colleagues, Beyond Accuracy: Behavioral Testing of NLP Models with CheckListaclanthology.org
