A Test Oracle is any mechanism or source of information that tells a tester what the correct outcome of a test is. Without an oracle, a tester can run the software but cannot tell whether its behavior is right.
Common types of test oracles include:
- Specifications: Requirements, user stories and design documents that state the expected behavior.
- Existing Systems: A previous version or a competing product whose output can be compared with the new one.
- Calculated Results: Expected values worked out independently, by hand or with a separate tool.
- Heuristics: General rules, such as consistency with similar features or with user expectations, used when no exact answer exists.
- Domain Experts: People with business knowledge who can judge whether a result makes sense.
Choosing reliable oracles is essential, especially for automated tests, where the expected value must be known in advance. The oracle problem, deciding the right answer when it is hard to know, is one of the core challenges of testing complex systems.


