Test Generation

How GPT Driver converts plain-language requirements into deterministic test cases using Llama-3, prompt templates, tagging, and drift control with test case hash consistency.

This page explains how GPT Driver turns plain‑language requirements into deterministic, automated test cases.

Key Points

  • Uses an internal fine‑tuned Llama‑3 70B model with tool‑calling to expand steps and data sets.

  • Idempotent: the same requirement + version always yields the same test case hash.

  • Supports escape‑hatch directives like @no‑ui or @auth‑mock in the requirement body.

Prompt Template

  1. Settings → Test Generation → Prompt Template.

  2. The default prompt converts Given/When/Then or bullet lists into:

    1. title

    2. preconditions[]

    3. steps[]

    4. expected[]

  3. Edit cautiously; malformed JSON will be rejected at save time.

Heuristics And Tags

  • Priority is inferred from Jira priority or the keyword critical in the text.

  • Components map to tags; multiple components create multiple tags.

  • Data sets are generated when the requirement contains a table or csv: block.

Regeneration And Drift Control

  • A requirement edit triggers a diff; only impacted cases are regenerated.

  • If team members hand‑edit a generated case in TestRail, the link is marked broken and regeneration is skipped until the edit is reverted.

Sample Output

caseId: TBD
hash: 1e4c9d2
priority: high
tags: [login, android]
preconditions:
  - user installed latest build
steps:
  - open app
  - tap "Login"
  - enter invalid password "badpw"
expected:
  - toast "Wrong password" appears

Troubleshooting

  • status: drift in the case header means the source requirement changed but regeneration failed validation.

  • Use Re‑generate Now from the case sidebar to attempt again.

Last updated