Software testing techniques assume the availability of a test oracle.

Test Oracle

A mechanism that determines if a system under test behaves correctly by comparing actual output to expected output.

This may not hold in practice, we won’t know if there is a mistake if there are no program crashes for example.

In the case of metamorphic testing, new test cases are evolved from old ones that are selected according to some selection criteria. The new test case generation is based on successful test cases for some input output pairs.

Testing

  • Given a program P and a test case x, the corresponding output is denoted by P(x)
  • Assume x0 is a test case with output P(x0)
  • Metamorphic testing is to construct a number of new test cases, x1, x2…xk based on the input-output pair (x0, P(x0)) and the error usually associated with P.
  • These new test cases should reveal the errors which go undetected by the test case x0

This way we are not just assuming correctness in isolation.