Note: From the below post, "Prompt Template" and "Example Usage" are for you to copy/modify/reuse. The remaining fields are added for you to gain more knowledge about the Prompt. Happy learning!
Purpose
Any Functionality | Iteratively refine and expand test cases with feedback | Test Case Generation | Multi-Shot Prompt
QE Category
Test Case Generation
Prompt Type
Multi-Shot
Typical SUTs and Quality Phases
Well-suited for complex features requiring iterative refinement, such as during exploratory testing or regression planning.
Prompt Template
Role: A QA engineer iteratively refining and expanding test cases for [Feature Description] based on the user story below.
Context:
- **User Story**: [Insert User Story]
- **Acceptance Criteria**: [List Criteria]
- **Priority**: High/Medium/LowIteration 1:
- Generate 3 high-level test cases that broadly cover the acceptance criteria.Iteration 2:
- Refine the test cases by adding step-by-step details, ensuring each includes:
- Preconditions
- Test Steps
- Expected Results
- Add at least one edge case or error-handling scenario for each test case.Iteration 3:
- Expand the test suite by generating 3 additional test cases to cover missed scenarios or areas needing deeper exploration.Task:
Provide outputs in an iterative format, ensuring each round builds on the previous one, progressively refining and expanding the test suite.
Example Usage
Role: A QA engineer iteratively refining and expanding test cases for a resource allocation feature in a project management tool.
Context:
- **User Story**: As a project manager, I want to allocate resources to tasks dynamically so that project deadlines are met efficiently.
- **Acceptance Criteria**:
- Allocation must not exceed available capacity.
- Resources must be reassignable with immediate effect.
- Notifications must be sent for over-allocations.
- **Priority**: HighIteration 1:
- Generate 3 high-level test cases:
1. Validate resource allocation within capacity.
2. Test reassignment of resources between tasks.
3. Check notification generation for over-allocated resources.Iteration 2:
- Refine the test cases with detailed steps:
1. **Validate resource allocation within capacity**:
- Preconditions: At least one resource is available.
- Steps:
1. Open the resource allocation dashboard.
2. Assign a resource to a task with remaining capacity.
- Expected Results: Resource is allocated, and task status updates correctly.
2. **Test reassignment of resources between tasks**:
- Preconditions: At least two tasks with assigned resources.
- Steps:
1. Select a resource from Task A.
2. Reassign the resource to Task B.
- Expected Results: Resource is removed from Task A and reassigned to Task B without errors.
3. **Check notification generation for over-allocated resources**:
- Preconditions: Resources are already fully allocated.
- Steps:
1. Attempt to assign an additional resource to an already over-allocated task.
- Expected Results: Allocation is blocked, and a notification is sent to the user.Iteration 3:
- Expand the test suite:
1. Validate behavior when no resources are available for allocation.
2. Test edge cases for resource capacity limits.
3. Check system behavior when reassignment fails due to network errors.
Tested in GenAI Tools
Extensively optimized for ChatGPT, Claude, Microsoft Copilot, Google Gemini, and Perplexity-- delivering reliable and actionable results across leading GenAI platforms.
Value of the Prompt
This prompt enables iterative improvement and coverage expansion, ensuring test cases are thorough and aligned with evolving requirements.
Hands-On Exercise
Apply this prompt to a task scheduling system. Refine the generated test cases iteratively, adding edge conditions like conflicting schedules or resource shortages.
Want More?
Challenge the iterative process by introducing new constraints or requirements mid-way and observe how the test cases adapt dynamically.
Author
Ashwin Palaparthi
© 2023 Ai4Testers.com™ All rights reserved | Made with ❤️ by ContentShastra.com™
Check your inbox to confirm your subscription to Ai4Testers™. In the coming days, you will receive the FREE E-Book, GenAI for Software Testers – An Intro by Ashwin Palaparthi, along with ongoing GenAI knowledge assets.