A good QA prompt works like a good requirement: it gives enough context, defines boundaries and asks for an observable result. Use AI to accelerate analysis and drafting, then verify every important output against the product and trusted sources.
On this practical guide
The three essentials
Context
What the product does, who uses it, the relevant requirement and the current project state.
Constraints
Scope, framework, format, rules, exclusions and quality expectations.
Clarity
One explicit goal, clear terminology and a precise definition of the expected output.
Simple rule: if a new team member could not complete the task from your prompt, the AI will probably need more context too.
A reusable prompt structure
Role: Act as a senior QA engineer.
Goal: Design acceptance tests for password reset.
Context:
- Web application for registered customers
- Requirement: [paste the relevant acceptance criteria]
- Reset link expires after 30 minutes
Constraints:
- Cover behaviour, not implementation details
- Include positive, negative, boundary and security scenarios
- Do not invent rules that are not provided
- Mark missing information as a question
Output:
- Risk list
- Gherkin scenarios
- Test data table
- Open questions
You do not need every field for a small question. Use the shortest prompt that still removes important ambiguity.
Useful prompting techniques
| Technique | When to use it | QA example |
|---|---|---|
| Zero-shot | The task is simple and the format is familiar. | Summarise this failed API response and list likely causes. |
| Few-shot | Style, classification or output consistency matters. | Provide two approved bug examples, then ask for the next report in the same format. |
| Decomposition | The request contains several dependent activities. | Analyse risks first, agree coverage second and generate tests last. |
| Iterative refinement | The first answer needs correction or more precision. | Add role-based cases, remove duplicates and rewrite outcomes to be measurable. |
| Structured output | The result will be reviewed, imported or processed. | Request Markdown, Gherkin, CSV columns or a defined JSON schema. |
| Retrieval-grounded | The answer must follow project-specific truth. | Use the current story, API contract and test conventions as named sources. |
Do not request hidden reasoning: ask for assumptions, evidence, checks and a concise rationale. These are more useful for review than a long internal thought process.
Practical prompts across QA work
Requirement review
Review the requirement below for ambiguity, missing rules,
conflicting statements and untestable acceptance criteria.
Return only:
1. Critical questions for the product owner
2. Testable acceptance criteria
3. Main product risks
Requirement: [paste text]
Test case design
Using only the requirement below, create a compact test set.
Apply equivalence partitioning, boundary values and a decision table
where relevant. Prioritise Gherkin for behaviour scenarios.
Separate confirmed cases from assumptions. Do not invent limits.
Requirement: [paste text]
Test strategy support
Propose a risk-based test approach for this feature.
Map each risk to the lowest sensible test level: unit, component,
API, integration or UI. Include what should remain exploratory.
Inputs:
- Architecture: [summary]
- Critical journeys: [list]
- Constraints: [time, environments and tools]
Automation review
Review this Playwright test against our conventions.
Check locators, assertions, waits, isolation, test data, cleanup
and failure diagnostics. Identify only material issues.
Conventions: [paste or reference]
Test: [paste or reference]
Defect investigation
Analyse the evidence without assuming the root cause.
Separate facts, hypotheses and next checks. Rank hypotheses by
likelihood and impact.
Expected: [behaviour]
Actual: [behaviour]
Logs: [relevant excerpt]
Recent changes: [list]
Manage context and tokens
- Share the relevant section, not an entire repository or long meeting history.
- Reference stable project files instead of repeating the same rules in every prompt.
- Remove duplicate logs, generated output and irrelevant stack traces.
- Summarise earlier decisions before starting a new phase.
- Use a new conversation when old context begins to distort the task.
- Ask the model to list missing information before producing a large deliverable.
- Keep requirements, examples and output schemas clearly separated.
Generate QA artefacts safely
| Artefact | Give the AI | Always review |
|---|---|---|
| Test plan | Scope, schedule, dependencies, environments and entry or exit criteria. | Ownership, feasibility, missing risks and alignment with delivery dates. |
| Test cases | Requirements, business rules, user roles and representative data. | Expected results, duplicates, assumptions and traceability. |
| Test strategy | Architecture, risks, test levels, pipelines and team constraints. | Test pyramid balance, non-functional needs and maintainability. |
| Test data | Field rules, boundaries, relationships and privacy constraints. | Validity, coverage, sensitive data and cleanup. |
| Automation code | Framework files, local conventions and one approved example. | Security, reliability, assertions, dependencies and unintended changes. |
Verification checklist
- Check factual claims against requirements, contracts or official documentation.
- Confirm all assumptions are visible and acceptable.
- Recalculate counts, dates, thresholds and formulas independently.
- Run generated code and make sure tests fail when the product behaviour is wrong.
- Check for omitted negative, boundary, role and state cases.
- Remove secrets, personal data and restricted information before prompting.
- Keep human approval for releases, defect closure and other consequential decisions.
Copy-ready prompt template
# Role
Act as [role and relevant expertise].
# Goal
[One specific task and desired outcome]
# Context
- Product / feature: [details]
- Source of truth: [requirements, files or links]
- Current state: [relevant facts]
# Constraints
- In scope: [items]
- Out of scope: [items]
- Standards / conventions: [rules]
- Do not: [important exclusions]
# Output
- Format: [table, Gherkin, JSON, code or short report]
- Required sections: [list]
- Level of detail: [brief / detailed]
# Quality checks
- Do not invent missing information
- Separate facts from assumptions
- List blocking questions
- Verify the result against [criteria]
Useful links
- GitHub prompt engineering guidance ↗ — practical principles for coding tasks.
- Anthropic prompting overview ↗ — techniques and evaluation guidance.
- OpenAI prompt engineering guide ↗ — structured instructions and examples.
- Gherkin reference ↗ — behaviour-focused scenario syntax.