ChanlChanl
Case Study

Scenario Testing: The QA Strategy That Catches What Unit Tests Miss

Discover how synthetic test conversations catch edge cases that unit tests miss. Personas, adversarial scenarios, and regression testing for AI agents.

Chanl TeamAI Agent Testing Platform
March 5, 2026
15 min read
Colorful code displayed in an IDE on a MacBook Pro screen in a dark environment

Picture this: your AI agent passes every unit test with flying colors. Intent recognition? 97%. Entity extraction? Precise. API integrations? All green. You ship to production feeling confident — and within 48 hours, support tickets start rolling in. Customers are getting confused responses when they phrase their billing question differently than your test cases assumed. The agent loops on ambiguous requests instead of asking a clarifying question. When a caller says "actually, scratch that" mid-conversation, the whole session goes sideways.

Sound familiar? You're not alone. This is the scenario testing gap — the space between what unit tests can verify and what actually happens when real humans talk to your AI agent.

Unit tests are essential, but they're fundamentally optimistic. They test individual components in isolation with well-formed inputs. They verify that your intent classifier correctly labels "I want to cancel my subscription" as a cancellation intent. What they don't test is what happens when a slightly annoyed customer says "I've been trying to get this sorted for two weeks, can we just end this?" — which might mean cancellation, might mean escalation, and almost certainly requires a different tone than your standard response template.

That's the territory where scenario testing lives. And if your AI quality strategy doesn't include it, you're shipping blind.

What Unit Tests Actually Cover (And What They Don't)

Let's be clear about what unit tests do well. They're fast, repeatable, and excellent at catching regressions in isolated logic. For an AI agent, good unit test coverage typically means:

  • Intent classifiers correctly label known utterance patterns
  • Entity extractors pull out phone numbers, dates, and account IDs from structured inputs
  • Individual API calls return expected shapes
  • Prompt templates render correctly with known variable substitutions

This is real value. Don't throw it away. But notice the pattern: unit tests verify that each instrument in the orchestra plays the right note on cue. They don't check whether the symphony sounds good.

AI agents are fundamentally conversational systems. Their behavior emerges from a sequence of exchanges — each turn influenced by context from previous turns, the emotional tenor of the interaction, and subtle variations in how users phrase their needs. No unit test can capture that. Research consistently shows that the majority of AI agent failures in production are failures of conversation flow, not failures of individual components that had passed all their own tests. The individual pieces work — it's the handoffs between them that break.

Here's a concrete example. Consider a customer service agent handling billing disputes. Unit tests will validate:

  • "Charge dispute" → BILLING_DISPUTE intent ✓
  • "It says I was charged twice" → entity extraction: issue_type: duplicate_charge
  • createDisputeTicket() API → HTTP 200 ✓

What they won't catch:

  • Customer says "I was charged twice last month... wait, actually maybe it was two separate things?" — agent commits to dispute flow instead of pausing to clarify
  • Customer provides account number, then immediately corrects it — agent uses the original incorrect number
  • After resolving the billing issue, customer casually mentions they're thinking about canceling — agent misses the retention opportunity because it's already closed the billing intent

These aren't edge cases in the trivial sense. They're the normal messiness of human conversation. And catching them requires a different approach entirely.

The Anatomy of a Scenario Test

A scenario test is a synthetic conversation — a scripted or semi-scripted exchange between a simulated user and your AI agent, evaluated against defined quality criteria. Unlike unit tests, scenario tests treat the entire conversation as the unit of measurement.

A well-constructed scenario test has three components:

A persona: Who is this caller? A first-time customer who's confused about their bill is a fundamentally different test than a long-time customer who's technically sophisticated and mildly frustrated. The persona defines vocabulary, patience level, likely phrasing patterns, and emotional context. A confused first-timer might say "I don't understand this charge" — a sophisticated user might say "This fee wasn't disclosed in the ToS update from Q3."

A conversation script (or seed): The opening situation and any forced branching points. Some scenario tests are fully scripted turn-by-turn. Others provide an opening message and a set of "pivots" — points where the test infrastructure injects a specific user response to steer the conversation toward the edge case you're testing.

Evaluation criteria: What does success look like? This is where scorecards come in. A scenario test isn't just pass/fail — it's a graded evaluation against rubrics like: Did the agent correctly identify the user's primary intent within 2 turns? Did it maintain appropriate tone throughout? Did it complete the task without requiring the user to repeat information? Did it handle the topic change at turn 7 gracefully?

Quality analyst reviewing scores
Score
Good
0/100
Tone & Empathy
94%
Resolution
88%
Response Time
72%
Compliance
85%

The combination of these three elements lets you test behaviors that no unit test can touch: how your agent handles interruptions, topic switches, emotional escalation, and the unpredictable ways people actually communicate.

Personas: The Heart of Adversarial Testing

If scenario testing is the strategy, personas are where it gets interesting. A persona is a synthetic user profile that shapes how your test conversations unfold — and the most valuable personas aren't the easy ones.

Most teams start by testing their agents against "happy path" personas: cooperative users who provide clear information, follow the expected conversation flow, and accept the agent's first response. These tests have value, but they're not where the interesting failures hide.

The real QA gains come from adversarial personas — profiles designed to probe the edges of your agent's capabilities:

The Tangential Talker starts with one question and drifts into related (and sometimes unrelated) topics. "I'm calling about my bill — oh wait, can you also tell me if my account has international calling enabled? Actually, first, let me give you my account number..." This persona tests your agent's ability to track multiple open threads and return to them without losing context.

The Implicit Communicator never says quite what they mean directly. "I don't think this is working for me" might mean they want to cancel, or want to switch plans, or are having a technical issue. This persona tests your agent's disambiguation abilities — does it ask a clarifying question, or does it guess and run with the wrong interpretation?

The Correction-Prone User provides information and then corrects it. "My account number is 48392 — wait, no, it's 48329." Does your agent update its working memory correctly, or does it continue with the first number?

The Emotionally Escalating Customer starts calm and becomes progressively more frustrated as the conversation continues. Does your agent recognize the emotional shift and adjust its tone? Does it know when to stop trying to resolve programmatically and offer a human escalation?

The Multi-Goal Caller has three things they want to accomplish in one call, and they'll bring them up opportunistically throughout the conversation. This tests whether your agent can complete one task while keeping track of the others.

Teams using adversarial persona testing consistently catch significantly more production-relevant defects in pre-launch QA compared to teams relying solely on unit and happy-path testing. And the defects aren't random — they cluster around conversation state management, emotional tone calibration, and multi-intent handling. Exactly the behaviors that unit tests structurally cannot reach.

We ran 200 unit tests and felt great about launch. First week in production, we discovered our agent completely broke when users corrected themselves mid-sentence. We'd never thought to test that. Scenario testing with adversarial personas would have caught it in day one.
Head of AI QualityEnterprise SaaS Company

Regression Testing: Keeping the Gains You Make

AI agent regressions don't get enough attention — and they're sneaky. When you update a prompt, change a model, or adjust a configuration parameter, you might fix the problem you intended to fix — while subtly breaking something that was working before.

With traditional software, regression testing is straightforward: run your test suite, check that nothing that passed before now fails. With AI agents, it's more complex. The outputs are probabilistic and language-based, which means "did this test pass?" isn't a binary question. A response might be semantically equivalent to the expected output but phrased differently. Or it might drift slightly — still technically correct, but in a direction that accumulates into a problem over time.

Scenario-based regression testing handles this by evaluating behaviors rather than outputs. Instead of checking whether the agent said a specific string, you evaluate whether it:

  • Completed the task the user requested
  • Maintained appropriate tone throughout
  • Didn't ask for information it already had
  • Correctly handled the topic pivot at turn 5

These behavioral rubrics are stable across model and prompt changes. Your agent might phrase things differently after a prompt update, but you can still evaluate whether it behaved correctly — and you'll catch it immediately if the update inadvertently broke the emotional calibration that was working before.

Defects caught pre-launch

Unit tests onlyUnit + scenario tests

Regressions detected after prompt updates

23%87%

Edge case coverage

Happy path onlyAdversarial + multi-turn

The regression testing workflow that works in practice looks like this: every time you make a change to your agent — new prompt, model update, configuration change — you run your full scenario test suite before shipping. Not just the scenarios related to the change, but all of them. Because AI system behavior is interconnected in ways that aren't always obvious, and the scenario that breaks might have nothing to do with what you changed.

Building Your Scenario Library

A scenario library is a living document — a collection of test conversations organized by behavioral domain. Building one takes investment up front, but the payoff compounds over time as you accumulate coverage of increasingly subtle edge cases.

Start with the scenarios that reflect your highest-risk failure modes. For a customer service agent, that typically means:

Progress0/8
  • Cancellation and retention conversations — high emotional stakes, high business impact
  • Multi-step account changes where users can provide information out of order
  • Billing disputes that involve correcting incorrect information
  • Escalation-worthy situations where the agent needs to recognize its limits
  • Topic switches that test whether context is correctly maintained
  • Time-pressured callers who provide minimal information and expect the agent to work with it
  • Users with strong accents, unusual phrasing, or non-standard terminology
  • Follow-up calls where the caller references a previous interaction

As you build your library, resist the temptation to only write scenarios that your agent currently handles well. The most valuable additions are scenarios that reveal gaps — conversations that expose failure modes you didn't know existed. These come from two sources: production call logs (what did real users actually say that caused problems?) and adversarial imagination (what's the worst version of this user type we can construct?).

If you're using a platform that supports automated scenario testing, you can also use your existing agent conversation history to automatically generate new scenario variations. Real production conversations contain phrasing patterns, topic combinations, and conversational structures that your QA team wouldn't think to write manually.

The Scorecard Dimension: Making Evaluation Consistent

One of the harder problems in scenario testing is evaluation consistency. If you're manually reviewing whether a conversation "went well," you'll get different judgments from different reviewers, and different judgments from the same reviewer on different days.

Automated scorecards solve this by defining evaluation criteria as structured rubrics that apply consistently across every test run. A scorecard for a customer service agent might include dimensions like:

  • Task completion: Did the agent successfully accomplish what the user needed? (0-100)
  • Turn efficiency: How many turns did it take? Were any turns redundant? (0-100)
  • Tone calibration: Did the agent's emotional register match the conversation's context? (0-100)
  • Information accuracy: Did the agent provide correct information, or did it hallucinate? (0-100)
  • Escalation appropriateness: When the agent offered human escalation, was it warranted? (0-100)

Scoring against these rubrics lets you track quality over time, compare agent versions quantitatively, and set thresholds that must be met before a change can ship. "This update improved task completion by 4 points but dropped tone calibration by 8 — let's understand why before we ship" is the kind of conversation you can have when you have scorecard data. Without it, you're flying by intuition.

The other value of scorecards in scenario testing is that they make regressions visible at a granular level. If a prompt update causes your tone calibration score to drop by 10 points across adversarial persona scenarios, you know exactly what broke and where to look. The alternative — discovering it through production support tickets — is much more expensive.

A Real-World Application: The Correction Loop Problem

The following pattern appears across many AI agent deployments — it's worth walking through in detail because it shows exactly what scenario testing is designed to catch.

An AI agent for a financial services company was handling account inquiries. Unit tests were passing. In production, the support team noticed a pattern: calls that started with a corrected account number were running longer and sometimes ending with incorrect account information in the final resolution.

The unit tests had checked: "does entity extraction correctly pull an account number from a sentence?" They hadn't checked: "does the agent correctly update its working context when the user provides one number and then immediately corrects it?"

The root cause: the agent's prompt was designed to extract and store account numbers at turn 1. When the user corrected themselves at turn 1.5, the correction was processed as a separate turn, but the original extracted entity wasn't being overwritten — it was being added to a list. The agent was using whichever entity appeared first when it needed to look up the account.

A scenario test using the "Correction-Prone User" persona would have surfaced this in the first test run. The fix was straightforward once identified. But it took three weeks of production support tickets to find it — during which period, some percentage of corrected account numbers were causing lookups to fail silently.

This is the pattern scenario testing is designed to break. The failure wasn't in any individual component. Every component was working exactly as specified. The failure was in the composition of components across a sequence of turns — which is precisely the territory that scenario tests are designed to cover.

Integrating Scenario Testing Into Your Development Workflow

The most common mistake when adopting scenario testing is treating it as a phase — something you run before launch, then put away. The teams that get the most value treat it as an ongoing loop integrated directly into their development workflow.

In practice, that means four things:

Pre-launch coverage audit: Before any new agent capability ships, verify that your scenario library covers the behavioral domains that capability introduces. If you're adding a payment processing flow, you need scenarios that test correction loops, incomplete information handling, and failure cases for the payment API.

Regression gates on changes: Every prompt update, model version change, or configuration change triggers a full scenario test run. Changes that drop any scorecard dimension below threshold don't ship.

Production-to-scenario pipeline: When production support tickets reveal a failure mode, write a scenario test that reproduces it before fixing it. This ensures the fix actually resolves the scenario, and adds coverage for that failure mode going forward.

Adversarial expansion sprints: Periodically (monthly works well for most teams), run a focused effort to add adversarial scenarios to your library. Bring in your most creative QA engineers and challenge them to break the agent. Every scenario that surfaces a real failure mode is a pre-production bug catch.

Tools like Chanl's scenario testing platform can automate much of the test execution and scorecard evaluation pipeline, making it practical to run hundreds of scenario tests on every change without manual review bottlenecks. The test execution time that might make a manual approach impractical becomes much more manageable when evaluation is automated.

Start Testing the Conversations Your Unit Tests Miss

See how scenario testing with adversarial personas catches edge cases before they reach production.

Explore Scenarios

Building Toward Continuous Quality

Unit tests give you confidence that your components work. Scenario tests give you confidence that your agent works — as a conversational system, across the messy variety of real human communication.

The teams shipping AI agents with consistently high quality aren't the ones with the most sophisticated models or the most complex architectures. They're the ones who have built systematic practices for finding failure modes before their users do. Adversarial personas, synthetic test conversations, behavioral scorecards, and regression-gated deployments are the tools that make that possible.

Your unit test suite will keep catching the regressions it's always caught. Your scenario library will catch the ones that actually make it to your support queue — before they get there.

That's not a replacement for unit testing. It's the layer on top of it that turns a good testing practice into a complete one.

For a deeper look at how automated quality scoring works alongside scenario testing, see our coverage of AI call scorecards and evaluation. And if you're thinking about how scenario testing fits into a broader monitoring strategy, the monitoring and alerting features are worth exploring alongside it.


Chanl Team

AI Agent Testing Platform

Building the platform for AI agents at Chanl — tools, testing, and observability for customer experience.

Get AI Agent Insights

Subscribe to our newsletter for weekly tips and best practices.