Skip to content
QDNALearn AI
FR

Lesson 22 · Expert · 20 min

Evaluating a prompt on a set of ten cases

Measure a prompt instead of feeling it: ten cases with an expected answer, three runs, one rule changed at a time, and a compared score.

Goal
You will be able to build a set of ten cases with an expected answer, measure a prompt over three runs and attribute every gain to a single, isolated change.
Skills
Check
Step-by-step screenshot of Copilot: (1) test suite setup with edge cases, (2) automated test run, (3) 100% robustness score report.
Illustration generated by AI
In brief.

A test set is a table of ten realistic cases, each with the expected answer written before anything is run. You run your prompt three times over the ten cases, count the right answers, change a single rule, and start again. The score replaces the impression. It is what lets you tell a colleague "this prompt passes nine cases out of ten" rather than "it works well".

  1. 1Ten cases, three runs, a score instead of an opinion

    Anthropic opens its prompt engineering guide with a piece of advice few people follow: first define a success criterion and a way to test it, then only work on the prompt. Without measurement, every change is a bet, and you keep the one you liked on the last try. With ten cases and a score, the discussion changes in nature: you compare figures.

    Building the set takes about an hour. Choose ten representative fictional or anonymised inputs: six ordinary cases, three hard cases (double topic, missing data, ambiguity) and one trap case whose expected answer is "not found".

    Always write the expected answer before any run. Without this, you will evaluate Copilot based on its confidence rather than its factual accuracy. The score simply reflects the count of validated cases out of ten.

    Why three runs? Because the same request produces different answers from one time to the next. Wang and his co-authors built an entire method, self-consistency, on this variability: several runs followed by a vote clearly improve the result. For you, three runs give a range (8, 9, 8) instead of a misleading figure.

    The golden rule is isolation: a single change between two series. If you change the doubt rule and add an example simultaneously, any measured gain remains inexplicable. Microsoft recommends iterating and regenerating; the test set objectively adjudicates which revision to preserve.

    Have outputs scored by an independent peer in a blind review. Huang and co-authors demonstrated that models struggle to correct reasoning defects autonomously. The same cognitive bias affects prompt authors, who naturally favour their latest drafts.

    Diagram "Evaluate a prompt on a test set": Ten realistic cases; Run the prompt; Score each output; Fix the prompt; Replay the ten cases. Note: A prompt is good when it passes eight cases out of ten, not onceDiagram "Evaluate a prompt on a test set": Ten realistic cases; Run the prompt; Score each output; Fix the prompt; Replay the ten cases. Note: A prompt is good when it passes eight cases out of ten, not once
    Diagram "Evaluate a prompt on a test set"Diagram generated by AI and reviewed
  2. 2A message sorting prompt from 5 to 9 out of 10

    A support team wants to classify the messages of a shared mailbox into five categories.

    Turn 1 (Evaluating the baseline prompt across the ten-case benchmark).

    Classify these messages by category. Messages: [ten fictional messages]
    

    Over three runs, the scores are 5/10, 6/10 and 5/10. Copilot invents different categories on each run, puts one message in two categories and assigns an arbitrary category to the trap case.

    Turn 2 (Injecting an unambiguous precedence rule and measuring gains).

    Classify each message below into exactly one category: Billing, Delivery, Product complaint, Information request, Other. If a message covers two topics, pick the one requiring operational action. In case of dual intent, complaints always take precedence over simple inquiries. If unsure, classify as Other and explain in five words. Output table: Number, Category, One-sentence rationale. Messages: [ten fictional messages]
    

    Across the three evaluation runs, scores rise to 9/10, 10/10, and 9/10. Explicit arbitration handled mixed inquiries cleanly without degrading the negative test case.

    What changes. Closed categories eliminate hallucinations. The doubt fallback gives the model an honest exit instead of wild guesses. Measuring before and after an isolated change validates prompt modifications scientifically.

  3. 3Score a sorting prompt before and after one rule

    Here is a ready-to-use test set of ten customer messages received by the "NovaTech SAS" support team, along with the expected output for each:

    No. Customer message received Expected summary Expected urgency
    1 "What is the typical lead time for 5 Nova-Pro armchairs? Thanks." Delivery lead time inquiry for 5 armchairs Normal
    2 "URGENT: Reception desk down, order #NT-901 has no network cables, opening tomorrow 8 am!" Missing network cables before tomorrow morning opening Urgent
    3 "Could you please re-send the receipted invoice for our July order?" Request for copy of paid invoice Normal
    4 "Parcel #NT-908 arrived soaked and crushed. Two desks scratched, refusal of delivery signature." Damaged delivery and refusal to sign receipt Urgent
    5 "Are conference table tops available in light oak veneer?" Availability of light oak finish Normal
    6 "Looking for the assembly guide for the Alpha-2 ergonomic chair delivered last month." Request for chair assembly instructions Normal
    7 "Office move in 24 hours and our 10 ordered filing cabinets have not arrived!" 10 filing cabinets missing 24 hours before relocation Urgent
    8 "Quote #DEV-4412 received, we will sign next week following our board meeting." Confirmation of quote receipt with signature planned next week Normal
    9 "Need an extra drawer, but above all order #NT-915 is stuck at customs for Friday delivery!" Blocked shipment needing customs clearance within 48h and drawer inquiry Urgent
    10 "Hello, following the trade fair, here is our catalogue of recycled packaging supplies." Supplier packaging brochure sales pitch with no customer request Normal

    The "Load exercise" button in the composer pre-fills the weak starting prompt:

    "Summarise this customer email in one sentence and assess its urgency (Urgent / Normal)."

    1. First series (3 runs): Run this prompt without modification on the ten cases, three times in fresh conversations. Count the number of outputs matching expectations.

    2. Isolated modification: Add a single explicit rule in the Verification field of the composer: "Rule: classify as Urgent only if delivery is blocked, equipment is unusable, or deadline is under 48 hours. Otherwise, classify as Normal."

    3. Second series (3 runs): Replay three runs over the ten cases and compare your numbered scores.

    Self-assessment grid: (a) all ten expected answers are written before the first run; (b) six numbered scores are recorded, three before and three after; (c) a single rule changed, and the gain is measured.

    Open the prompt composer

  4. 4The test set that never makes the prompt fail

    A support manager builds her ten-case set from the last ten emails received on a quiet Tuesday morning: ten short, straightforward inquiries. The prompt scores 10/10 on three consecutive runs. She publishes it labelled "verified".

    In production, an email blending a product defect and a shipping delay is classified twice, while an ambiguous note gets an invented category. The test suite tested only simple inputs, ignoring production chaos.

    Correction: build test suites with six nominal cases, three complex edge cases, and one negative trap case requiring "Other" or "not found". Routinely append real production failures to the suite. Rule to remember: a test suite that never fails tests nothing.

  5. 5Quiz

    Three questions, instant feedback. Each option comes with an explanation.

    1. Why run the same prompt three times on the test set?

    2. Your classification prompt goes from 7/10 to 9/10 after you changed the doubt rule and added an example at the same time. What do you conclude?

    3. A case in the test set asks for a date that the document provided does not contain. What expected answer do you record, according to the lesson on checking an answer?

  6. 6Proof of mastery

    Paste the table of ten cases with the expected answer, the prompt tested, the scores of the three runs before and after the change, and the rule changed with an excerpt of the answer before and after.

    Expert badgeThis lesson counts towards the Expert badgeSee the four badges

    Criteria

Going further

The test set measures the version kept after a meta-prompt and serves as a check before sharing an agent; it also reveals the hallucinations the eye lets through.

Frequently asked questions

Are ten cases enough?

For a team prompt, yes: ten cases are enough to reveal the frequent defects, provided you include two or three difficult cases and one trap case whose expected answer is "not found". The set then grows with every error met in real use.

Can I ask Copilot to score its own answers?

With caution. Research shows that models correct themselves poorly without external feedback. Copilot can pre-fill the comparison between its answer and the expected one; a human, preferably a peer who does not know which version produced what, validates the score.

Where should the test set be kept?

In a clean Excel file, one row per case, next to the prompt's library card. Copilot Notebooks, open to Copilot Chat users since June 2026, also lets you gather the set, the prompt and the results in the same place.

Sources