Skip to content
← All case studies

Case study 04

Building an AI test case generator with human approval

A Claude Code skill that reads a ticket, checks what's already covered, and drafts only the missing test cases. A person approves every case before it reaches the regression suite.

Claude Code · Agent Skills · MCP · Jira · Qase · Zapier

0
cases reach the suite without human approval
Coverage-first
searches existing cases before drafting
2
modes: interactive and scheduled agent

The problem

New features often ship without test cases, because writing them is the step QA skips under pressure. Regression suites fall behind the product, and when a bug escapes there's no case to point to.

Getting an LLM to write test cases is easy. Getting test cases a team will trust is harder: duplicates, vague steps and cases that test nothing visible all erode confidence in the suite.

What I did

  1. 1.Where it started

    At Sitemate I built and deployed an AI-powered test authoring workflow that connects Jira, Qase, Claude and Slack, with coverage deduplication and human review before any case is accepted. The open-source version described here follows the same design, using a synthetic ticket and none of Sitemate's data or prompts.

  2. 2.Decide whether there's anything to test

    The skill reads the ticket, acceptance criteria and linked specs and designs, through MCP or from pasted text. A relevance gate stops it early when the change has no user-visible behaviour, such as a dependency bump or a refactor.

  3. 3.Check coverage before writing anything

    Before drafting, it searches the existing library by ticket key and feature area. It writes only what's missing, proposes updates to cases that are now out of date, and suggests deprecating cases the new feature replaces. That way the library can shrink as well as grow.

    generate-test-cases/SKILL.md (excerpt)
    ## Steps
    1. Read the ticket, its acceptance criteria and any linked spec or design.
    2. Relevance gate: if nothing user-visible changes, stop and say why.
    3. Coverage check: search existing cases by ticket key AND feature area.
       - Already covered      -> list the case IDs, write nothing
       - Partly covered       -> propose an update, not a new case
       - Superseded behaviour -> propose deprecation
    4. Draft only the missing cases:
       - one behaviour per case, real values, observable expected results
       - no API-level checks; any tester must be able to run it
    5. Save as DRAFT. Never mark a case as approved.
  4. 4.Drafts only, and a person decides

    Everything is saved as a draft in the test management tool, or as Markdown or CSV if no tool is connected. A person approves, edits or rejects each case. In agent mode the same skill returns structured output for a scheduled workflow, for example a Zapier trigger when a ticket reaches UAT, with approval by Slack reaction.

Outcome

Lessons learned

Code samples are original demonstrations written for this site. They show the pattern, not any employer’s implementation.

Next case studyEvaluating an AI bug severity grader →