Skip to content
bits
Evals that matter · Lesson 2 of 8 · 7 min

Start from real failures

Tutor:

Where do good test cases come from? Not from brainstorming in an empty file. They come from things that actually went wrong.

Anthropic's advice for a first eval suite is 20 to 50 simple tasks drawn from real failures: the checks you already do by hand, what users commonly ask, your bug tracker and your support inbox. You don't need hundreds to start.

Tutor:

The method is borrowed from qualitative research. Husain and Shankar call it the most important activity in evals, because it decides which evals you write.

  1. Dataset. Representative traces of real use, or realistic synthetic ones before launch.

  2. Open coding. Read traces and write free-text notes, focusing on the first failure in each. Do at least 30 yourself.

  3. Axial coding. Group the notes into a failure taxonomy and count each category.

  4. Iterate until saturation. Keep sampling until new traces stop adding or changing categories. A pool of about 100 diverse traces is their guardrail. An agent can help find more examples of a failure you've already named, but don't let it name your failures for you.

Then turn categories into tasks. Each task needs an input, success criteria you can check, and ideally a reference solution: a known good output that passes, which proves the task is solvable and the grader works.

Tutor:

A test case is only as good as its "expect". Compare:

  • "Replies helpfully about opening hours." Nobody can grade that the same way twice.

  • "Says the shop is closed on Sundays." Code can check it.

One more rule from Anthropic: test both sides. If the bot should say "closed" on Sunday, also test that it doesn't say "closed" on Saturday. A suite with only one side rewards a bot that says "closed" to everyone.

Your turn. The shop owner read last week's chats and wrote three notes. Get Claude to turn them into test cases you could run.

Your turn

Goal Get one test case per failure, each with a real customer message and an expectation specific enough to check

What good looks likeThe coach checks the reply
  • Includes the three failuresnot checked yet
  • Asks for JSONnot checked yet
  • Asks for an input and an expectation per casenot checked yet
  • Ran at 1.0not checked yet
  • Parses as JSON with a list of casesnot checked yet
  • A case expects the price £15not checked yet
  • A case expects the shop to be closed on Sundaysnot checked yet
  • There is one test case for each of the three failures: Sunday hours, the Spanish reply and the puncture pricenot checked yet
  • Each expectation is specific enough to check, like a fact, a language or a price, not 'is helpful'not checked yet

Run your prompt and the replies land here.

    ~0 tokens

    Turn on JavaScript to run prompts.