How do you know the right answer? Test oracles
A test needs a right answer to compare with. The source of that answer is called an oracle.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: the recipe photo. A recipe shows a photo of the finished cake. You bake, look at your cake and compare it with the photo. The photo tells you what to expect. But the photo may be wrong, since the cook may have used a nicer cake. It also cannot show you the taste.
Testing has the same need. Daily List, a to-do list app, lets Lily share a list with friends. Tom, the tester, shares a list with two friends and the screen shows three names. Is that right? He wonders why it should be three and not four. To answer, he needs something that tells him the right answer.
That something is a . It is the source you use to decide whether a result is right, such as a written requirement, or a past version of the app. When no complete source exists, testers meet the , which is the difficulty of knowing the correct result. One way to help is a pseudo-oracle, a second method that gives an independent answer to compare with.
The photo picture has a limit. A recipe photo is one source. A tester often has several, and they can disagree. The photo cannot argue back, but a requirement and a user can.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB A source of the right answer lets a tester compare a result with what should happen, and it can be wrong or missing.
- Name the source of the right answer
- Compare the result with it
- Ask how far the source can be trusted
- If sources clash, ask the owner
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The recipe photo | The oracle, the source of what should happen |
| Your own baked cake | The actual result the app gives |
| Comparing cake and photo | The test: actual result against expected result |
| A photo of a nicer cake than the cook made | An oracle that is wrong or out of date |
| Taste, which no photo shows | The oracle problem: a source that cannot give the whole answer |
| Asking a second baker to bake the same cake | A pseudo-oracle: an independent second answer |
WHERE THIS PICTURE STOPS
- A photo is fixed. A requirement or a user can change their mind and argue back.
- A baker sees the cake in one look. A tester often sees only part of the result.
- Two bakers can both follow the same wrong recipe, and a pseudo-oracle can share the same wrong idea.
HOOK
Where did the answer come from, and can it be wrong?
REMEMBER IT THIS WAY
A story beat: one picture-line that carries the order or the cause.
Tom shares a list with two friends and the screen shows three names. Before he calls that right or wrong, he asks what source says three.
| In the trick | What it stands for |
|---|---|
| three names | He wonders why it should be three and not four |
| what source | The test oracle is the source you use to decide whether a result is right |
When no complete source exists, no one source settles it, so ask the owner.
TELL A FRIEND
A recipe photo shows what the cake should look like. A tester also needs a source of the right answer, and knows that any source can be wrong.
OFTEN MIXED UP WITH Writing test conditions and test cases. A holds an . Oracles are where that expected result comes from and how far you can trust it.
PRACTISE AND KEEP
Sources for this topic — 4 sources
- Market practice
Glossary of testing terms from the International Software Testing Qualifications Board (equivalence partition, equivalence partitioning, boundary value) ↗ — International Software Testing Qualifications Board (ISTQB) · Glossary of testing terms: test oracle, a source used to work out expected results to compare with the actual result (search excerpt, page not opened)
Seen as a search excerpt; the page was not opened. The authoring container could not resolve this publisher's host name when a fetch was tried on 12 October 2026 for related hosts, so this is a reachability gap and not a statement about the publisher. The glossary has an older and a newer version of the entry for equivalence partitioning; the newer one defines the partition rather than the technique.
- Market practice
The Oracle Problem in Software Testing: A Survey (Barr, Harman, McMinn, Shahbaz, Yoo) ↗ — IEEE Transactions on Software Engineering, vol. 41, no. 5, 2015, pp. 507-525 · Barr, Harman, McMinn, Shahbaz and Yoo, 'The Oracle Problem in Software Testing: A Survey', IEEE Transactions on Software Engineering, vol. 41, no. 5, 2015: the oracle problem and the human as the last source (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: 2015, DOI 10.1109/TSE.2014.2372785. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
On Testing Non-Testable Programs (Weyuker) ↗ — The Computer Journal, vol. 25, no. 4, 1982, pp. 465-470 · Weyuker, 'On Testing Non-Testable Programs', The Computer Journal, vol. 25, no. 4, 1982: programs with no practical oracle (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: 1982. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Using Heuristic Test Oracles (Michael Kelly) ↗ — InformIT · Bolton, 'Using Heuristic Test Oracles', InformIT: oracles are fallible heuristics that suggest a problem (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: article as listed on the publisher's site. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. Author attribution corrected from the author’s own bibliography https://www.michaeldkelly.com/articles, opened6 November2026. The InformIT article now redirects to its generic article index; article contents remain excerpt-only.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.