What are test cases?

Test cases for AI agents are concrete, repeatable scenarios specifying a user input, tool or account state, and the required outcome or policy checks. A balanced test suite covers common requests, tricky edge cases, and adversarial inputs—with a held-out subset reserved to measure true generalization across versions.

By Sacha Arbonel, Founder and CTOLast updated
  • Also called
  • Held-out test set
  • Scenarios

Why do test cases matter?

An evaluation suite is only as trustworthy as its test cases. Without realistic edge cases and a held-out set, an agent can score 100% in testing and still fail the first time a real customer sends an unexpected request.

A test case describes an input, the state of the world and what a correct response looks like. Good sets cover the common path, the edge cases and the adversarial ones.

A held-out set is kept aside and never used while making changes. Checking a change on held-out cases shows whether it truly helps, rather than just fitting the cases it was built on.

Key characteristics of test cases

  • Specifies the starting input, simulated tool/account state, and deterministic pass criteria.
  • Covers three buckets: happy paths, messy edge cases (missing or conflicting data), and adversarial attempts.
  • Splits into a working set for iteration and a held-out set for unbiased version comparison.
  • Grows organically whenever a real production trace uncovers a new failure mode.

Example in practice

How Norilu handles test cases

Frequently asked questions

How many test cases do you need to launch a reliable agent?
Start with 15 to 30 realistic scenarios covering core workflows, missing data, policy limits, and prompt injection, then add a new case for every production failure you discover.
What is a held-out test set?
A held-out test set is a group of scenarios excluded while drafting prompt fixes so you can verify whether a candidate version genuinely improves on unseen situations.

Go deeper