Skip to content
QAcademy — QAcademy

Prompt engineering ·

The structured prompt for testers: role, context, instruction, input data, constraints, output format

By Wael Badri

Illustration for the article "The structured prompt for testers"

A vague prompt gets a vague answer. For a test task, that is not just a matter of comfort: an imprecise output means coverage you do not control. The ISTQB® CT-GenAI syllabus proposes a simple structure with six components to write prompts that produce usable results. It is also one of the core topics of chapter 2, the heaviest chapter of the exam.

The six components

Component What it is for
Role The perspective the model should take: tester, test manager, test automation engineer…
Context Background information: the test object, the functionality in scope, the environment.
Instruction The task to perform, stated in a clear, imperative and concise way.
Input data What the model needs to work with: user story, acceptance criteria, code, existing test cases, screenshots…
Constraints The limits and rules to follow when applying the instruction to the input data.
Output format The expected shape of the answer: table, list, Gherkin, JSON…

The order matters less than completeness: every missing component is a decision you leave to the model.

A complete example: analyzing a user story

Here is a test analysis prompt built with the six components.

ROLE
You are an experienced test analyst specialized in consumer web applications.

CONTEXT
We are testing the "Password reset" feature of an online banking application.
Testing covers the user journey, not the infrastructure.

INSTRUCTION
Identify the test conditions covering the user story and its acceptance criteria.
Flag any ambiguity or missing requirement.

INPUT DATA
User story: "As a customer, I want to reset my password by email
so that I can regain access to my account."
Acceptance criteria:
1. The reset link expires after 30 minutes.
2. The new password must comply with the password policy.
3. The link can only be used once.

CONSTRAINTS
- Only rely on the user story and criteria provided; do not invent rules.
- Cover nominal, error and boundary cases.
- If information is missing, ask instead of making an assumption.

OUTPUT FORMAT
A table: ID | Test condition | Criterion covered | Type (nominal / error / boundary),
followed by an "Open questions" list.

What each component brings here:

  • the role steers toward test analysis rather than a developer's answer;
  • the context limits the scope (the journey, not the infrastructure);
  • the constraints reduce the risk of hallucination ("do not invent rules") and make gaps visible;
  • the output format makes the result easy to review and traceable to the criteria.

Always review

A structured prompt improves the output; it does not make it reliable by default. Check that every condition maps to a criterion, look for what is missing and for what was added without basis: that is exactly the evaluation habit the syllabus expects (section 2.3).

Going further: combine with prompting techniques

The structure combines with the syllabus's three core techniques:

To place this topic in the overall program, see the CT-GenAI certification guide.

Sources

  • ISTQB®, Certified Tester Specialist Level Syllabus – Testing with Generative AI, v1.1, section 2.1 (prompt structure and prompting techniques).

Take the next step

You have just read. Now see where you stand: 10 questions, your score chapter by chapter, free and without signing up.

Take the free test (5 min)

Already decided to practise?

Opening soon: prices and contents are on the Pricing page.