Ninety-four checkout tests. All green. Launch day arrived, and checkout broke anyway.

The team had tested every scenario they could think of. Unit tests, integration tests, end-to-end flows. The test suite was thorough by any reasonable measure. But when customers started applying discount coupons, the system failed in ways none of the tests ever considered.

The tests were not bad. They tested every decision the requirement actually made. The failure lived in what the requirement never decided.

This pattern repeats across teams: a well-tested feature ships, breaks in production, and the postmortem reveals that the bug was born upstream. Not in the code. Not in the tests. In a requirement that left a decision unmade.

AI-assisted test generation makes this pattern harder to ignore. When a model struggles to generate useful scenarios, the struggle itself is diagnostic. The requirement is not ready.

The Better Question

Most teams evaluate AI test generation by asking: "Can AI generate tests from this story?"

The better question is: "What does AI struggle to generate, and what does that reveal about the requirement?"

When AI sees vague, contradictory, or incomplete requirements, it has three bad options: invent behavior the team never specified, produce shallow tests that avoid the ambiguity, or flag that it cannot proceed. None of these are failures of the model. They are signals about the input.

That signal is useful. It tells the team where the requirement is weak before the code is written, before the tests are automated, before the feature ships.

The Coupon Story That Looks Done

Consider a story that appears ready for sprint. This is the same coupon checkout example from the first article in this series, now examined through a different lens:

As a checkout user,
I want to apply a discount coupon,
so that I pay less for my order.

Acceptance Criteria:
- The coupon should work at checkout.

Three lines. Groomed. Estimated. Prioritized. It looks like dozens of stories that ship every sprint.

Now interrogate it with seven questions:

Code Gap Core Question
L1 Untestable Criterion What proves this passed?
L2 Contradiction Which rule wins?
L3 Ambiguous Actor Who exactly?
L4 Missing Negative Path What must not happen?
L5 Missing Precondition What state must exist first?
L6 Missing Non-Functional Criterion What limit matters?
L7 Implicit Requirement What are we assuming?

Gap 1: Untestable Criterion

Core question: What observable evidence proves this passed?

"The coupon should work" is not a testable claim. It describes intent, not behavior. A tester cannot write an assertion against "should work" because there is no defined outcome to verify.

What AI struggles with: No specific expected outcome. The model cannot generate a Then step because the requirement never specified what success looks like.

What humans must decide: Does the order total change? Is a discount line shown in the summary? Is there a confirmation message? Is tax recalculated on the reduced amount?

A clearer version:

Scenario: Valid percentage coupon reduces order total
  When a valid 10% coupon is applied at checkout
  Then the order summary shows a "10% discount" line
  And the payable total is reduced by 10%

Now the test has something to assert.

Gap 2: Contradiction

Core question: When two rules collide, which one wins?

In many organizations, coupons sit at the intersection of competing policies. Marketing says coupons should stack to drive campaigns. Finance says one coupon per order to protect margin. Both rules exist in official documentation. Both are "authoritative."

What AI struggles with: Two valid sources imply incompatible behavior. The model cannot generate consistent scenarios because the rules conflict.

What humans must decide: Which policy has priority? Who owns the exception? What should the system do when a second coupon is entered?

Until someone decides, the requirement contains a hidden fork that will surface in production.

Gap 3: Ambiguous Actor

Core question: Who exactly is allowed to do this?

"Checkout user" could mean a guest, a logged-in customer, a loyalty member, a support agent acting on behalf of a customer, or an admin testing in production. The story does not specify.

What AI struggles with: The actor boundary is unclear. The model cannot determine which scenarios apply to which user type.

What humans must decide: Can guests apply coupons, or only registered users? Are some coupons member-only? Can support agents apply coupons manually? Can admins override expired coupons?

Different actors imply different permission checks, different UI flows, and different test scenarios.

Gap 4: Missing Negative Path

Core question: What must not happen?

The story describes successful coupon application. It says nothing about failure. What happens when the coupon is expired? Invalid? Already reused? Applied to an ineligible cart?

What AI struggles with: No behavior defined for invalid, expired, reused, or ineligible coupons. The model can only generate happy-path scenarios because the requirement only defines the happy path.

What humans must decide: Error message copy for each failure mode. Whether the user can retry. Whether the cart total changes on failure. Whether failed attempts are logged for fraud detection.

If a story only defines success, the tests will only protect success. Production will discover the rest.

Scenario: Expired coupon is rejected with a clear message
  Given I have items in my cart totaling $50
  And I have an expired coupon "OLD20"
  When I apply the coupon
  Then I should see "This coupon has expired"
  And my cart total should remain $50

Gap 5: Missing Precondition

Core question: What state must exist before this runs?

The story assumes checkout is already in a valid state. But what state? The requirement does not specify.

What AI struggles with: No setup rules. The model has to guess what Given steps are required.

What humans must decide: Must the cart contain items? Is there a minimum order value for coupons? Can coupons apply to already-discounted items? Can coupons apply after shipping is selected, or only before?

Preconditions are often "obvious" to the team that wrote the story and invisible to everyone else.

Gap 6: Missing Non-Functional Criterion

Core question: What limit makes this acceptable?

The story defines function but not performance, reliability, or abuse constraints. It says what the system should do, not how fast, how often, or under what load.

What AI struggles with: No bounds for latency, concurrency, or throughput. The model generates functional scenarios but cannot address capacity or resilience.

What humans must decide: How fast must coupon validation respond? What happens during a Black Friday spike with 10,000 redemptions per minute? Is there a rate limit per user to prevent abuse? Are redemption attempts audited?

Non-functional requirements often live in a separate document, a different team's head, or nowhere at all.

Gap 7: Implicit Requirement

Core question: What is assumed but written nowhere?

Everyone on the team "knows" how refunds work when a coupon was applied. But nobody wrote it down. The knowledge exists in conversation, in tribal memory, in "we have always done it that way."

What AI struggles with: Generated scenarios have to guess at behavior that is implied but never stated. The model may invent something plausible that contradicts the team's unstated assumption.

What humans must decide: If an item is returned, is the refund based on full price or discounted price? What happens with partial returns? Can a coupon be reused after order cancellation? What if the coupon expires after purchase but before refund?

Scenario: Refund applies discounted price for returned item
  Given I purchased two items with a 20% coupon applied
  And I return one item
  When the refund is processed
  Then I should receive 80% of that item's original price
  And the coupon remains used and cannot be reused

Implicit requirements are dangerous because nothing looks missing until production proves otherwise.

The Annotated Story

The same three-line story. Seven undecided questions.

Code Gap Core Question
L1 Untestable Criterion What observable evidence proves this passed?
L2 Contradiction When two rules collide, which one wins?
L3 Ambiguous Actor Who exactly is allowed to do this?
L4 Missing Negative Path What must not happen?
L5 Missing Precondition What state must exist before this runs?
L6 Missing Non-Functional Criterion What limit makes this acceptable?
L7 Implicit Requirement What is assumed but written nowhere?

The AI did not create these gaps. It made them impossible to ignore.

What To Do Monday

Three moves, no tool required.

Audit five stories. Take the top five stories from the next sprint. Run the seven questions against each one. Thirty minutes, one highlighter. Write down the unanswered decisions.

Upgrade Definition of Ready. Add one line: "Negative path identified." That single gate forces grooming to discuss failure modes before estimation.

Share findings, not tests. Bring the requirement owner the list of undecided questions. Do not silently fix the acceptance criteria alone. The conversation prevents bugs. The silent fix just moves them.

A lightweight table helps track decisions:

Story Gap Decision Needed Owner
Coupon checkout L4 Behavior for expired coupons Product
Coupon checkout L6 Response time under promo load Tech lead
Coupon checkout L7 Refund rules for partial returns Finance

Where Tooling Fits

These seven checks can be run manually with a highlighter and a checklist. That works for five stories. It does not scale to a backlog of 500.

Specification linting automates the scan. It flags likely gaps before generation begins, turning a manual audit into a pre-flight check. The questions remain the same. The coverage increases.

Calibrating what the AI generates once the input is clean is a separate discipline. Reference examples teach the model your team's terminology, structure, and voice.

But the questions are the point. The tooling is how you run them at scale.

What Comes Next

Cleaner requirements reduce risk, but they do not eliminate it. AI-generated tests can still fail in ways that have nothing to do with the input specification: hallucinated assertions, misunderstood domain logic, scenarios that are syntactically valid but semantically wrong.

Validating the output is the next problem.

Summary

AI does not just generate test cases. It reveals the decisions your requirements never made.

The seven gaps, untestable criteria, contradictions, ambiguous actors, missing negative paths, missing preconditions, missing non-functional criteria, and implicit requirements, are not AI problems. They are requirements engineering problems that AI makes visible.

The most valuable output of AI-assisted testing is not a pile of test cases. It is a list of questions your team never asked.

AI can expose them. Only you can answer them.