MetamorphicTesting

Test a stated relation among the outputs of several runs, which needs no exact expected answer for any single run

Infrastructure · Verification · bootstrap 0.11.0

Mechanism

Instead of checking each run against a known answer, related runs are compared: a relation states how the outputs must correspond when the inputs are changed in a stated way, as permuting the rows fed to an order-independent aggregation must leave its result unchanged. A relation may involve more than two runs. Each relation is derived, before any run, from a property the correct output must have, stated in the Spec or known of the domain, never from the implementation's behaviour, and it states how a violation is decided: exactly, within a tolerance, or by a statistical test where outputs are random. Follow-up inputs are generated from source inputs, and a violation is a failure on that set of inputs. A satisfied relation shows the outputs are consistent under that relation, not that any single output is correct. It builds tests for EmpiricalTest that need no exact expected answer, including where the correct output cannot be computed independently.

Invariants

Failure modes

Where this came from

—

Builds on

Related

Identity