In software testing, a test oracle (or just oracle) is a provider of information that describes correct output based on the input of a test case. Testing with an oracle involves comparing actual results of the system under test (SUT) with the expected results as provided by the oracle.
The term "test oracle" was first introduced in a paper by William E. Howden. Additional work on different kinds of oracles was explored by Elaine Weyuker.
An oracle can operate separately from the SUT; accessed at test runtime, or it can be used before a test is run with expected results encoded into the test logic.
However, method postconditions are part of the SUT, as automated oracles in design by contract models.
Determining the correct output for a given input (and a set of program or system states) is known as the oracle problem or test oracle problem,: 507 which some consider a relatively hard problem, and involves working with problems related to controllability and observability.