What is an oracle? This post gives a definition that is aligned with the Black Box Software Testing Foundations course (BBST) created by Rebecca Fiedler, Cem Kaner, and James Bach.
An oracle is a heuristic principle or mechanism by which you recognize a potential problem.
It is important to stress the word potential. The definition of the test is that is an experiment for which we do not know the outcome. This is a basic mechanism that moves science forward.
“The engineering method is the use of heuristics to cause the best change in a poorly understood situation within the available resources” [Billy V. Koen (1985, p. 70), Definition of the Engineering Method, American Society for Engineering Education].
As software testers, we assume potential problems and create tests around those assumptions. This is what makes excellent testers.
Heuristics by example
A heuristic is anything that provides a plausible aid or direction in the solution of a problem but is, in the final analysis, unjustified, incapable of justification, and fallible. It is used to guide, to discover, and to reveal.
An example of Google search, it is plausible to believe that this blog post will be indexed by Goggle in 24 hours. However, if this post is for some reason in the robots.txt file, this assumption will not be true.
Heuristics do not guarantee a solution.
This is when we used all failable heuristics.
Two heuristics may contradict or give different answers to the same question and still be useful.
An example is the following two heuristics:
This post is indexed by Google.
This post is not indexed by Bing.
On testing, we find out that those both heuristics are true. This leads us to further investigate how sites indexing works.
Heuristics permit the solving of unsolvable problems or reduce the search time to a satisfactory solution.
An example is that I should solve Rubik cube faster if I consult official documentation on the Rubik site.
The heuristic depends on the immediate context instead of absolute truth as a standard of validity.
The heuristic that this post will be indexed by Google is true in Europe, but it will fail in China.