NashTech Blog

Verify a Ticket with AI – Part 1: Throwaway Tests That Find What the AC Missed

Table of Contents

Verify a Ticket with AI – Part 1: Throwaway Tests That Find What the AC Missed

Introduction

A developer moves a ticket to “Ready for QA”. The acceptance criteria (AC) say three things. You test those three things, they pass, you close the ticket. Two days later a bug comes in from a corner of the product that the ticket never mentioned, but the change touched.

Writing permanent automated tests for every ticket takes too much time. Moreover, not every ticket needs a permanent place in the regression suite. Manual testing based only on the AC can also miss side effects.

Our team found a middle path with an AI coding agent: throwaway automation. The agent reads the ticket and the code change, works out what to test, writes Playwright specs into a scratch folder, runs them, and gives a verdict. Nothing is saved into the regression, smoke, or production suites.

This two-part series shows how it works:

  • Part 1 (this post): where the test cases come from: the AC and the diff.
  • Part 2: comparing TEST and PRODUCTION, and the safety rules for running AI on production.

1. Why “throwaway” and not “add to regression”?

A regression suite requires long-term maintenance. Every new spec needs regular updates and must pass consistently. In addition, it uses CI resources every time the team runs the suite.

  • a one-off data fix,
  • a copy or label change,
  • a bug in a flow that is already well covered,
  • a feature still changing every week.

Therefore, for these tickets, we only need to answer one question: “Does this ticket work correctly right now?”

Our rule: the scratch folder is gitignored. If a throwaway spec turns out to be valuable, it is promoted to the regression suite through the normal authoring process, with review. It never gets there by accident.

2. Two sources of test cases

The key idea is that the agent derives cases from two places, not one.

Source 1: The acceptance criteria → main cases

This is what every tester does. Each AC line becomes at least one case, and each case has a clear expected result.

Source 2: The diff → side-effect cases

This is where AI provides the most value. The agent reviews the pull request linked to the ticket. Then, it checks which other parts of the application the change may affect.

  • A shared function was changed → which other screens call it?
  • A database column became nullable → which reports read it?
  • A new field in an API response → does the old mobile client still parse it?
  • A feature flag was added → what happens with the flag off?

For example, our team handled a ticket that aimed to stop a retry loop for one type of order. The AC only described that order type. After reviewing the diff, the agent found that the UI checkout flow also used the same retry code. It added a side-effect case for the checkout path. That case failed, and the fix had to be extended before release.

3. The workflow

Plain Text

1. Read the ticket          → AC, comments, linked bugs
2. Read the change          → PR diff, files touched, config/flags
3. Derive & approve cases   → Create a test list based on AC + diff, then human approves or edits the case list
4. Write scratch specs      → Reuse existing page objects + API helpers
5. Run & verdict per case   → Run tests and mark each result as pass / fail / blocked, with evidence

Step 4 is especially important. Before writing any code, the agent presents the test case list for human review. A tester can say, “case 5 doesn’t matter, but you missed the refund flow”. That review takes two minutes and makes the rest of the work count.

Step 5 is also important. The scratch specs are throwaway, but they are not sloppy. They import the same page objects and API helpers as the real suite, so they arrange data in seconds and use locators that already work:

Plain Text

// scratch/verify-ticket/retry-loop-ui-checkout.spec.ts

import { test, expect } from '@/fixtures/test';

test('UI checkout order does not re-enter the retry loop', async ({ api, orderPage }) => {
  const order = await api.orders.placeCheckoutOrder({
    forceLabError: true
  });

  await orderPage.open(order.id);

  await expect(orderPage.status).toHaveText('Failed');

  expect(await api.orders.retryCount(order.id)).toBe(1);
});

4. The verdict: pass, fail, or blocked

The output is a short table, not a wall of logs:

#CaseSourceResultEvidence
1Retry stops for automated ordersAC✅ PassretryCount = 1
2Status shows “Failed” in order listAC✅ Passscreenshot
3UI checkout orders also stop retryingDiff❌ FailretryCount = 100
4Behaviour with flag OFF unchangedDiff⏸ Blockedflag not configurable on TEST

Blocked is a first-class result. If the agent can’t create the condition (missing test account, a third-party payment iframe, a flag it can’t switch), it says so and explains why. It doesn’t quietly skip the case or mark it as passed.

5. What we learned

  • The diff finds more bugs than the AC. Most of the real defects we caught this way came from side-effect cases.
  • Reusing the framework is what makes throwaway tests cheap. Without page objects and API helpers, the agent spends its time on boilerplate instead of on the actual checks.
  • The human picks the cases, the agent does the typing. The two-minute plan review is the highest-value step in the whole flow.
  • Never let scratch leak. A gitignored folder and a rule that promotion always goes through review keep the regression suite clean.

Wrapping up

Throwaway automation fills the gap between “click through the AC by hand” and “write a permanent regression test”. With an AI agent, it takes minutes, and reading the code change finds the side effects that AC-only testing misses.

In Part 2, we look at the step most teams skip: checking that TEST and PRODUCTION are configured the same, and the guardrails we use before an AI agent is allowed anywhere near production.

Picture of Hien Ngo Thi

Hien Ngo Thi

Suggested Article

Scroll to Top