Metamorphic testing: checking relations when you cannot know the answer
When you cannot know the right answer, you can still know how two answers must relate. Metamorphic testing checks that relation after a known change to the input.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: adding a known weight to a crate. You do not know the crate's exact weight. Add a known 5-kilogram weight without changing anything else. The reading should rise by 5 kilograms. That relation can reveal a fault even without the original weight.
Daily List is a to-do list app. Its search box returns tasks, and the order depends on a score nobody can predict in advance. Tom, the tester, cannot write the exact right list for every query.
He uses , checking a rule that links the results of related inputs, when the exact answer is unknown. Each rule is a , a rule saying how the output must change when the input changes in a known way. The second test is the follow-up test, the test built from the first by a known change, whose result is compared with it.
For example: adding one more word to the query can never add results. If the follow-up search returns a task that the first one did not, the relation is broken. Tom has found a fault without knowing the right list.
The picture has a limit. The crate check assumes the added weight is known and the weighing conditions stay the same. In software, a relation holds only if the product really should behave that way.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 1 in this section
- metamorphic
- changing form; here, a rule about how results change
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Checking a rule between the results of related inputs, when the exact answer is unknown.
- Change the input
- Predict the link
- Compare
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| You cannot weigh one whale | The exact answer is unknown |
| Two equal-mass whales weigh twice either one | The metamorphic relation |
| Adding a second whale | The follow-up test |
WHERE THIS PICTURE STOPS
- Whales always double. A relation must really hold for the product.
- A scale tells you if the rule fails. A product may fail the rule for good reasons.
- Two whales prove nothing about one. A wrong product can obey a relation.
HOOK
Change the input, predict the link, compare.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
If you cannot know the right answer, change the input in a known way and predict the link between the two results.
| In the trick | What it stands for |
|---|---|
| Known change | Adding one more word to the search |
| Predicted link | The metamorphic relation, how the output must change |
A weak relation may pass while both results are wrong.
TELL A FRIEND
uses an agreed relation, such as two equal masses adding to twice one, without needing the unknown mass itself.
OFTEN MIXED UP WITH How do you know the right answer? Test oracles. The oracle lesson asks how to judge a result. This lesson gives a way to judge when the exact result is unknown.
PRACTISE AND KEEP
Sources for this topic — 7 sources
- Market practice
Metamorphic Testing: A Review of Challenges and Opportunities (Chen and others, ACM Computing Surveys, 2018) ↗ — Association for Computing Machinery (ACM Computing Surveys) · Metamorphic testing both generates test cases and checks results; its core is a set of metamorphic relations, properties a function must satisfy across related inputs and their outputs (search excerpt of the abstract, full text not seen)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: ACM Computing Surveys, vol. 51, no. 1, article 4, 2018. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Metamorphic testing (Wikipedia) ↗ — Wikipedia · Uses sin(pi - x) = sin(x) as the standard example: build the follow-up input from the first and check the two outputs agree; the same identity also passes a broken sine that always returns zero (search excerpt of a community encyclopedia and a forum thread, pages not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
The Oracle Problem in Software Testing: A Survey (Barr, Harman, McMinn, Shahbaz, Yoo) ↗ — IEEE Transactions on Software Engineering, vol. 41, no. 5, 2015, pp. 507-525 · The oracle problem is the difficulty of deciding whether a result is correct (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: 2015, DOI 10.1109/TSE.2014.2372785. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
On Testing Non-Testable Programs (Weyuker) ↗ — The Computer Journal, vol. 25, no. 4, 1982, pp. 465-470 · Origin of the idea of a program whose correct output cannot be known in advance (bibliography entry; wording from secondary descriptions in search excerpts)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: 1982. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
QA Glossary (Mozilla wiki) ↗ — Mozilla · Back-to-back testing: two or more variants of a component or system are run with the same inputs, and the outputs are compared and analysed when they differ (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). The standard text is sold, so put any detail in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Regression vs. Back-to-Back Testing: Which One to Choose in TPT? (Synopsys blog) ↗ — Synopsys · The main difference from regression testing is the oracle: back-to-back testing treats the behaviour of another version as the expected result (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). The standard text is sold, so put any detail in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Glossary of testing terms from the International Software Testing Qualifications Board (equivalence partition, equivalence partitioning, boundary value) ↗ — International Software Testing Qualifications Board (ISTQB) · Glossary entry for back-to-back testing: running the same test cases on two or more variants of a test item, or a simulation model of it, and comparing the results (search excerpt, page not opened)
Seen as a search excerpt; the page was not opened. The authoring container could not resolve this publisher's host name when a fetch was tried on 12 October 2026 for related hosts, so this is a reachability gap and not a statement about the publisher. The glossary has an older and a newer version of the entry for equivalence partitioning; the newer one defines the partition rather than the technique.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.