Metamorphic Testing

2025-01-13T14:14

Property based testing is difficult because it's hard to find good properties. Metamorphic testing is a type of PBT under a "metamorphic relation". Here, we see if the outputs all match when many of them have undergone automated mutation (that shouldn't but could affect the output).

For example, if a given soundclip transcibes to output out, then we should still get output out if we:

...

We could, for example, download an episode of This American Life, run the transformations, and see if they all match.1 We have useful tests without listening to the voice clip. We can now generate complex, deep tests without the use of an oracle!


References

https://www.hillelwayne.com/post/metamorphic-testing/