The Katalon Blog

Rethinking Coverage – What to Measure When You’re Not Testing a Flow

Written by Richie Yu | Aug 21, 2025 1:01:07 PM

“Our coverage report said 95%. Users still flagged unpredictable AI behavior every day.”

That’s not a gap in execution.  That’s a broken definition of coverage.

The Old Coverage Model Is Failing Quietly

Let’s be honest:
Test coverage has always been a comfort metric.  It helps us say, “We’ve tested enough.” But it’s built on one assumption:

The system follows known paths.

When that’s true, “coverage” makes sense:

  • Did we test every function?
  • Did we cover every user story?
  • Did we walk every path?

But agentic AI doesn’t follow paths.  It generates them.

Why Traditional Coverage Doesn’t Work for Agentic AI

Agentic systems don’t run the same way twice. They reason through goals, make choices, and adapt.

So even if you hit “all the paths” in your code or UI, you’re still blind to:

  • Alternate reasoning chains
  • Unexpected tool sequences
  • Memory-based behavior shifts
  • Subtle goal interpretation changes

The system might say “yes” 10 different ways — and only 2 of them are safe.

That’s not code path variance. That’s behavioral variance.

What Should You Be Measuring?

You still need coverage. But it’s time to redefine what that means.

Here’s a new lens:

1. Goal Alignment Coverage

What it is:
You’re testing whether the agent correctly understood the user’s intent — not just whether it returned a valid answer.

Example scenario:
The user prompt is:

“I’d like to cancel my subscription.”

The AI responds with:

  • Option A: “Would you like to downgrade instead?”

  • Option B: “Your subscription has been canceled.”

  • Option C: “We can pause your account and resume later.”

  • Option D: “You may be eligible for a refund.”

Questions a tester should ask:

  • Did the AI understand the user’s core intent?

  • Did it present all viable options (cancel, pause, downgrade, refund)?

  • Did the response match business policy or constraints?

  • Would a user feel their request was fulfilled accurately and respectfully?

What counts as “good enough”?

  • Pass: The AI recognizes the goal (cancellation) and offers a set of aligned options, ideally reflecting company policy — e.g., pause, downgrade, full cancel, refund.

  • Fail: The AI tries to retain the user with only one option (e.g., downgrade) or avoids the cancel intent entirely.

  • ⚠️ Flag: The AI offers valid paths, but with incomplete reasoning or inconsistent policy logic (e.g., only refunding some users).

Takeaway for QA teams:
To validate Goal Alignment Coverage:

  • Define the expected intent space for key prompts

  • List acceptable behavioral responses (not just outputs)

  • Test with variants of the prompt (e.g., “get rid of my plan,” “I’m done with this service”)

  • Assert that the AI response stays aligned with the user's goal — and doesn’t prioritize business incentives over user intent

If your tests only check the output, you're missing the goal.
Goal alignment means testing how the AI interprets and fulfills intent.

2. Reasoning Path Coverage

What it is:
You’re testing whether the agent is reasoning through tasks using safe, complete, and policy-aligned steps not just getting the answer right.

Example scenario:
User prompt:

“I forgot my password.”

The AI may reason through several paths:

  • Path A: Send a reset email → confirm identity → unlock account
  • Path B: Ask security questions → generate new password
  • Path C: Refer to account manager for manual reset

Questions a tester should ask:

  • What intermediate steps did the AI take to solve the problem?
  • Were any critical steps skipped or added?
  • Did it allow business logic — or improvise its own flow?
  • Would a human support rep consider the same steps reasonable?

What counts as “good enough”?

  • Pass: The AI takes one or more valid paths that include all required steps (e.g., verification before reset)
  • Fail: It skips key steps (e.g., resets password without verifying identity) or invents unsupported flows
  • ⚠️ Flag: It takes unusual but plausible reasoning paths that may need policy review or escalation

Takeaway for QA teams:
To validate Reasoning Path Coverage:

  • Define acceptable decision trees or flow variants for each goal
  • Use tools that log reasoning chains or intermediate steps
  • Validate that all critical business constraints are represented in the logic
  • Run prompt variations to uncover how many different reasoning paths the agent takes

Correct output doesn’t mean correct thinking.
You’re testing how the AI got there - not just where it landed.

✅ 3. Tool Invocation Coverage

What it is:
You’re testing whether the agent uses available tools (e.g. APIs, plugins, calculators, external systems) correctly and appropriately for the task.

Example scenario:
User prompt:

“Can you update my shipping address?”

The agent has access to:

  • getUserInfo()
  • validateAddress()
  • updateShippingAddress()
  • notifyUserOfChange()

Questions a tester should ask:

  • Did the agent use the correct tool for the task?
  • Were all required tools invoked  in the right order?
  • Did it avoid unnecessary or redundant calls?
  • Could the same goal have been achieved more efficiently?

What counts as “good enough”?

  • Pass: The agent uses tools in a safe, efficient sequence aligned with the task
  • Fail: The agent skips required tools, invokes tools out of order, or uses irrelevant ones
  • ⚠️ Flag: The agent uses valid tools but relies too heavily on one or repeats calls inefficiently

Takeaway for QA teams:
To validate Tool Invocation Coverage:

  • Map the expected tool sequence(s) for common tasks
  • Instrument or log tool usage patterns in test runs
  • Write tests that assert safe, compliant sequences — not just output correctness

You’re not just checking if the system worked.
You’re checking how it used its toolbox to get there.

✅ 4. Memory Access & Recall Coverage

What it is:
You’re testing whether the AI retrieves and applies memory correctly  and whether it avoids leaking or misusing stored information.

Example scenario:
Prompt:

“Hey, use the same address I gave you last week.”

Expected behavior:

  • Retrieve the correct address from memory
  • Validate it belongs to this user
  • Apply it only if still valid and appropriate

Questions a tester should ask:

  • Did the AI recall the correct information from memory?
  • Did it misattribute or confuse users/data?
  • Did it over-share information without consent?
  • Did it forget critical facts it should have remembered?

What counts as “good enough”?

  • Pass: The system recalls relevant, correct context securely and appropriately
  • Fail: It recalls wrong, outdated, or misattributed data, or violates privacy
  • ⚠️ Flag: It recalls the right info, but in an unexpected or overly broad way

Takeaway for QA teams:
To validate Memory Access & Recall Coverage:

  • Test how the agent behaves across sessions (cold start vs. warm context)
  • Run tests with ambiguous pronouns or context references (e.g. “that email”)
  • Assert the system remembers just enough — and no more

Memory is powerful and risky.
Test what the system forgets, what it remembers, and what it shouldn’t.

✅ 5. Failure Path Coverage

What it is:
You’re testing how the agent behaves when things go wrong — including tool failures, unexpected inputs, blocked actions, or uncertainty.

Example scenario:
Prompt:

“Cancel my reservation for tonight.”

But:

  • The reservation system API is down

Questions a tester should ask:

  • Does the AI gracefully handle the error?
  • Does it offer alternatives (e.g. “I couldn’t cancel, but here’s how to call support”)?
  • Does it escalate when needed?
  • Does it retry, stall, or fail silently?

What counts as “good enough”?

  • Pass: The agent acknowledges failure, logs it, and takes a safe fallback (e.g. escalate to human)
  • Fail: The agent pretends success, crashes, loops, or provides false reassurance
  • ⚠️ Flag: The agent partially handles the failure but misses an obvious safety or escalation step

Takeaway for QA teams:
To validate Failure Path Coverage:

  • Simulate tool outages, malformed inputs, or rejected requests
  • Write assertions for safe failure, not just “any” failure
  • Include HITL triggers in test expectations where appropriate

The true test of intelligence is what it does when it doesn’t know what to do.
Failure paths deserve as much testing as happy paths — maybe more.

From Functional to Fractal

In traditional testing, coverage is linear.  You draw lines. You walk them. Done.

In agentic testing, coverage is fractal:

  • One prompt can lead to 20 different behaviors.
  • One goal can be interpreted in five legitimate ways.
  • One decision point can surface new risks — or new failures.

You’re not just testing features. You’re probing a possibility space.

 

A New Coverage Model

Here’s a concrete framework you can start using today.

Coverage Dimension

What You're Measuring

Old Equivalent

Goal Alignment

Does the agent interpret intent correctly?

Requirements traceability

Reasoning Paths

Are different logic chains tested?

Branch/path coverage

Tool Invocation Patterns

How tools are selected, ordered, reused

API integration coverage

Memory Usage

Accuracy, relevance, safety of memory recall

Data/state validation

Failure Behaviors

Does it fail safely and appropriately?

Negative test cases

Print this table. Bring it to your next sprint planning or QA strategy session. This is your new checklist.

 

So What Does “Good Coverage” Look Like Now?

It’s not 95% lines of code. It’s not 100% acceptance criteria pass rate.

“Good coverage” means you’ve tested how the AI reasons, where it might go wrong, and how it behaves across context shifts.

That’s harder to measure.  But it’s much more meaningful.

What to Do Next

Here’s how to get started today:

  • Pick one agentic system in flight.
  • Take your existing coverage model.
  • Add five new rows: goal, reasoning, tool use, memory, failure.
  • Start designing tests that probe behavior, not just assert outcomes.

Even doing this for a handful of cases will surface blind spots your current suite can’t touch.

Coming Next:

Blog 4 – “How to Design Tests for Unpredictable Behavior”
We'll give you specific techniques to test systems even when you can’t predict the output.