Prompt engineering deliberately designs natural-language inputs, instructions, constraints, delimiters, and examples to increase the likelihood that a probabilistic large language model returns a useful, desired output. section 2.3 section 2.8
Build prompts around a specific task and make the expected result explicit:
- Assign a useful role or perspective, such as an expert software tester, without treating the model as genuinely inhabiting that role. section 4.2
- State constraints for scope, quality characteristics, numbering, length, and output structure; detailed instructions outperform broad questions. section 2.3 section 2.8
- Use delimiters to separate rules and task data, then provide examples when format or context matters. section 2.8 section 6.1.1
- Break complex work into subtasks and ask the model to check assumptions or evaluate its solution before returning it. section 2.4.6 section 2.8
From a broad request to a testable prompt
A weak request such as “Create tests for a file upload feature” invites generalized cases. A stronger version assigns a tester role, delimits the behavior, and requests exhaustive cases: “You are an expert software tester. Generate as many test cases as possible for the behavior delimited by three hashes. ### An Authorization API takes a token from another API and checks whether it is valid and in date before responding positively or negatively. ###” The resulting cases can target valid and expired tokens, but a human must still verify relevance, completeness, and factual correctness. section 10.1 section 2.2.3
% room_name | string | random % type | string | 'single' or 'double' % beds | integer | 1 to 6 % accessible | boolean | true or false % image | string | random url % description | string | random max 20 characters % features | array[string] | 'Wifi', 'TV' or 'Safe' % roomPrice | integer | 100 to 200
A delimited schema demonstrates how to specify field names, data types, allowed values, and randomization rules when generating test data. section 6.1.1
Prompt engineering improves the odds of relevance, rule-following, and usable structure; it does not remove hallucinations, weak assumptions, inconsistent relationships, or privacy risks. Treat generated content as assistance requiring human judgment, and avoid sharing business or user information without authorization. section 2.2.3 section 6.1.1





































