Skip to content

Stockertim Dictionary · Artificial intelligence · Technology

Expected output

Also called expected result, expected outputs, expected answer

In short

An expected output is the correct result for a test case, written down before the system runs, against which the actual output is compared and scored.

  • Beginner
  • Concept
  • Checked

In detail

A test case has two halves: the input and what should come out. The expected output is the second half. For a system extracting invoice details it might be the supplier name, date, total and order number exactly as they appear; for a system routing emails, the correct queue; for a drafting system, the facts that must appear and the ones that must not.

Writing it first is the point. If the expected answer is decided after looking at what the system produced, people tend to accept plausible output as correct. Recording it beforehand, ideally by someone who knows the work, turns testing into a comparison rather than an impression.

The form depends on the task. Where there is one right answer, such as a figure or a category, the comparison can be exact or automatic. Where many wordings are acceptable, the expected output lists required elements, forbidden elements and constraints such as length, and a rubric decides whether the actual output meets them. Some cases have more than one acceptable answer, and the expected output should say so rather than penalise a valid alternative.

Expected outputs can be wrong. A mistake in the answer key marks a correct output as a failure or the reverse, so a second person checks them, and disagreements between system and key are investigated before the key is assumed right.

Worked example

Ashgrove Property Management tests an AI tool that classifies tenant emails into four queues.

  1. Case 17 input: "The boiler has been off since Tuesday and there is no hot water." Expected output: Urgent repairs.
  2. Case 18 input: "Can I pay my rent on the 5th this month instead of the 1st?" Expected output: Rent and payments.
  3. Both expected outputs are written by the housing manager and checked by a colleague before the tool runs.

Each case has an agreed answer, so the tool's results can be marked right or wrong without argument.

In practice

Teams build test sets with an expected output for every case, have them written and checked by people who know the work, store them with the test set under version control, and correct the key when a disagreement shows it was wrong.

Watch out

  • An expected output written after seeing the system's answer is biased towards accepting it.
  • Where several answers are valid, an expected output that allows only one creates false failures.

Learn it properly

Official sources

Facts last checked on 9 November 2026.

Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.

English