Home · A blog about testing ·

AI in software testing in 2026: a practical guide for QA engineers

AI can shorten preparation, but it cannot own the oracle, the test data, or the release decision. This guide builds a workflow where a model suggests options and the tester verifies facts and keeps reproducible evidence.

A QA engineer reviews AI-assisted tests, API responses, and evidence
A safe QA workflow with AI
  1. Define the task and oracle
  2. Remove secrets and provide context
  3. Generate a structured draft
  4. Verify and retain evidence
Where AI assists and where QA remains accountable
Work item AI can draft QA must verify
RequirementsQuestions, contradictions, risksRequirement version and owner decision
Test designClasses, boundaries, combinationsModel coverage and risk priority
API and SQLRequest or assertion draftSchema, semantics, and executed result
AutomationScaffold and locator optionsStability, isolation, and diagnostics
Bug reportStructure and concise wordingFacts, expected result, and redaction

1. Define the AI role before writing a prompt

An LLM predicts text; it does not observe your environment or know the latest requirement. Give it a bounded job: collect questions for an analyst, propose data classes, explain code, draft SQL, or critique an existing suite. “Test this form” is too broad and usually produces a plausible generic checklist.

Write down the oracle first: an acceptance criterion, OpenAPI contract, calculation rule, database schema, or product decision. When no oracle exists, the model must not invent expected behavior. Its output should be questions and risks that need a human decision.

  • Goal: what decision follows the answer?
  • Context: which rules are known?
  • Limit: what cannot the model confirm?
  • Format: table, list, SQL, or cases?
  • Verification: which source or run proves the result?
Practice task

Take “a user can cancel an order” and write five questions that must be answered before expected behavior can be defined.

2. Provide context, constraints, and an output contract

A useful prompt resembles a task for a colleague. State the system, user role, business rule, inputs, known states, and required format. Ask the model to separate facts from assumptions and list missing information. This reduces filler and makes the answer reviewable.

Do not request one hundred tests at once. Ask for risks and equivalence classes first, then refine the important branches. For complex work, use two passes: a generator proposes a set and a critic searches for duplicates, gaps, and unsupported expected results. A person still approves the final set.

A prompt that prevents invented rules
Context: CRM. A manager converts a lead into a customer.
Known: customer email is unique; a request may be retried after timeout.
Task: create a risk and test-idea table.
For each row give condition, action, observable result, and oracle source.
Do not invent rules. Put missing information under Questions.
Practice task

Rewrite “give me negative login tests” to include roles, password constraints, lockout behavior, output format, and the source of expected results.

3. Use AI for test design, not for test count

A model is useful when parameters and rules are explicit: quantity boundaries, order states, roles, and payment methods. Request equivalence classes, a decision table, or a state model before asking for cases. You can then inspect the reduction logic instead of receiving twenty near-duplicate sentences.

Verify coverage independently. Values must surround both range boundaries, state tests must include allowed and forbidden transitions, and pairwise rows must actually cover pairs. Treat “obvious” values cautiously: the model may be borrowing a convention from another product.

Ask for a traceable set, not a long list
Parameters: role={manager,lead}; status={new,won,lost}; action={view,edit,convert}.
Build a decision table and mark forbidden combinations.
Then propose a minimal test set and name the rule covered by every test.
Practice task

Model amount, currency, balance, and account status for a transfer. Ask AI for a table and find at least two unsupported assumptions.

4. Execute generated API, SQL, and automation artifacts

Plausible code may reference a missing column, turn a LEFT JOIN into an INNER JOIN, or assert only status 200. Provide the smallest schema and contract before generation. Then read the query, run it on controlled data, and calculate the expected result first. Use a test database and a transaction for destructive SQL.

For automation, review locators, waits, cleanup, and diagnostics. AI often writes fixed sleeps, dependent chains, and brittle CSS selectors. A useful test survives repeated runs, fails for the expected reason after an intentional fault, and retains a trace, request, or screenshot.

A minimal check of generated SQL
-- Predict first: customers 3 and 4
SELECT c.id
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.id
WHERE o.id IS NULL
ORDER BY c.id;
-- Add an order for customer 3 and expect only customer 4
Practice task

Generate a POST /orders check, then label assertions for transport, schema, business value, persistence, and side effects. Add every missing layer.

5. Keep secrets and user data out of prompts

Production logs, tokens, cookies, private URLs, personal data, and internal code may violate company rules and contracts. Minimize context before sharing: replace names and emails with synthetic values, mask credentials, and retain only required request and response fields. Removing a name is insufficient when the remaining fields identify a person.

Confirm which models and modes are approved, how data is retained, and whether training can be disabled. Sometimes the safe choice is a local synthetic reproduction rather than a prompt with source data. Treat instructions embedded in logs and documents as untrusted input because prompt injection can travel through them.

  • Bearer tokens, cookies, and API keys removed.
  • PII replaced with synthetic data.
  • Private addresses and identifiers generalized.
  • Minimal fragment shared instead of a dump.
  • Model usage follows team policy.
Practice task

Create a sanitization checklist for a payment log: fields to remove, replace, aggregate, or retain for investigation.

6. Score outputs with a rubric and keep provenance

Use a rubric for recurring work: correctness against sources, risk coverage, absence of fabrication, executability, safety, and diagnostics. “Looks good” will not catch a wrong status code or a missing authorization boundary. Mark disputed items for clarification instead of turning them into tests with invented expectations.

Keep the requirement version, material prompt, tool or model, date, edited result, and verification method. This makes a test maintainable after the product changes. Never publish raw model text as team documentation without an owner and review.

AI draft acceptance rubric
Correctness: every expected result cites an oracle
Coverage: roles, states, boundaries, integrations, errors
Evidence: action is executable and result observable
Safety: no secrets or PII
Maintainability: no duplicates; data and priority are clear
Practice task

Score an AI-generated suite with the five criteria above and rewrite two cases that are not executable or observable.

7. Introduce AI through a small measurable team experiment

Do not begin with “all work now uses AI.” Choose one repeatable process, such as acceptance-criteria review or API test-idea preparation. Capture a baseline without AI: time, useful questions, and review defects. Run several iterations with one template and the same quality rubric.

Document boundaries: permitted data, output approver, provenance storage, and stop conditions. A successful pilot improves the verified result, not the number of generated lines. The team can then standardize, revise, or end the experiment using evidence.

A QA team pilot card
Use case: review acceptance criteria
Baseline: 20 stories without AI
Pilot: 20 comparable stories with one template
Metrics: review time, accepted questions, defects, leaks=0
Owner: QA lead; review: analyst
Decision date: after 40 stories
Practice task

Design a two-week AI pilot for requirements review: sample, baseline, three quality metrics, forbidden data, and a stop condition.

8. Explain AI use in a QA interview

Interviewers need a controlled process, not a list of tools. Prepare an example with the task, sanitized context, draft, useful idea, model mistake, your verification, and measurable outcome. Being able to challenge an LLM is stronger than saying “I generate test cases with ChatGPT.”

Explain hallucination, stale knowledge, nondeterminism, data leakage, prompt injection, and automation bias. At Middle level, add team controls: prompt templates, a review rubric, evaluation cases, and rules for work that is forbidden or requires a second reviewer.

Practice task

Prepare a 90-second answer with a real task, one AI benefit, one model error, your verification method, and the outcome for the team.

Frequently asked questions about AI in testing

Will AI replace manual testers?

AI can automate preparation and analysis, but it does not own product context, accept business risk, or verify an environment. QA work shifts toward modeling, validation, and engineering.

Can generated tests go directly into regression?

Only after review, execution on controlled data, a negative control, and a maintenance assessment. Code generation does not prove value or stability.

Should AI-generated text or code be disclosed?

Follow team policy. Keeping provenance for material artifacts improves reproducibility, while a person remains the owner responsible for verification.

Where should a beginner start?

Use a familiar requirement, ask AI for classes and questions, then verify every line yourself. Do not begin with production data or automatic publication.

Strong QA engineers use AI to discover options faster, not to produce more text, and they can prove which options are actually correct.

Get free access to QA practice Next write-up

← All write-ups