| Component | Purpose |
|---|---|
| Role | Who answers? |
| Instruction | What to do? |
| Context | Background info |
| Input Data | Concrete data |
| Constraints | Limitations |
| Output Format | Define format |
| Technique | When? |
|---|---|
| Zero-Shot | Simple tasks |
| One-Shot | Show format |
| Few-Shot | Learn patterns |
| Persona | Need expertise |
| Chain-of-Thought | Visible logic |
System: Personality
You are a conservative
code reviewer... User: Specific task
Review this endpoint: Test Cases:
You are a QA engineer.
User Story: """..."""
Constraints:
- Given-When-Then
- Happy Path + Edge Cases
- Max 8 test cases
Output:
| ID | Description |
| Steps | Expected | Bug Analysis:
Analyze step by step:
1. Categorize bug
2. Estimate severity
3. Find root causes
4. Next steps
5. Add tests | Problem | Solution |
|---|---|
| Too unstructured | Improve Output Format |
| Too generic | Expand Context |
| Wrong focus | Precise Instruction |
| Too long | Add Constraints |
| Inconsistent | Use Few-Shot |
| Mistake | Better |
|---|---|
| "Test this" | "Generate 5 test cases for..." |
| No context | Include User Story |
| No format | Define format explicitly |
| Too complex | Break into sub-steps |
1. Negative Prompting
Avoid:
- Too similar tests
- Non-testable steps
- Vague formulations 2. LLM-as-a-Judge
Evaluate by:
1. Completeness
2. Clarity
3. Testability
4. Edge Cases
5. Score 1-5