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 | Build interconnected test cases with logical reasoning | Test Case Generation | Chain-of-Thought Prompt
QE Category
Test Case Generation
Prompt Type
Chain-of-Thought
Typical SUTs and Quality Phases
Ideal for systems requiring sequential exploration, such as workflows with dependencies or complex business logic.
Prompt Template
Role: A QA engineer generating interconnected test cases for [Feature Description] using logical reasoning.
Context:
- **User Story**: [Insert User Story]
- **Acceptance Criteria**: [List Criteria]
- **Known Assumptions**: [System Assumptions or Risks]
- **Dependencies**: [List System Dependencies or Interactions]
- **Constraints**: [Constraints or Edge Cases]Task:
1. Begin with a question or assumption about the functionality.
2. Generate a test case to validate or challenge this assumption.
3. Log observations or results.
4. Use observations to inform the next test case logically.
5. Repeat steps 2-4 to build at least 5 interconnected test cases.Focus on:
- Logical flow between test cases.
- Coverage of dependencies, constraints, and edge cases.
- Generating insights that guide deeper exploration.
Example Usage
Role: A QA engineer generating interconnected test cases for a multi-region database replication feature.
Context:
- **User Story**: As a database administrator, I want real-time replication across regions so that data consistency is maintained globally.
- **Acceptance Criteria**:
- Data changes in one region must replicate to others within 5 seconds.
- Conflict resolution must follow 'last write wins' logic.
- Replication failures must be logged and retried automatically.
- **Known Assumptions**:
- Network latency may affect replication speed.
- Conflicts are rare but possible under concurrent updates.
- **Dependencies**:
- Regional database nodes.
- Network connections between regions.
- **Constraints**:
- High write loads during peak hours.
- Limited storage capacity on secondary nodes.Task:
1. Begin with a question or assumption about the functionality.
2. Generate a test case to validate or challenge this assumption.
3. Log observations or results.
4. Use observations to inform the next test case logically.
5. Repeat steps 2-4 to build at least 5 interconnected test cases.Output Example:
1. **Question**: How does the system handle concurrent updates to the same record?
- **Test Case ID**: TC-001
- **Title**: Validate conflict resolution during concurrent updates.
- **Preconditions**: Two users simultaneously update the same record in different regions.
- **Steps**:
1. Initiate concurrent updates on the record.
2. Observe the resolution logic.
- **Expected Results**: The 'last write wins' logic resolves the conflict correctly.2. **Observation**: Conflict resolution works but is not logged.
3. **Follow-Up**: Generate a test case to validate conflict logging.
- **Test Case ID**: TC-002
- **Title**: Validate conflict resolution logging.
- **Steps**:
1. Repeat the conflict resolution scenario.
2. Verify that a conflict log entry is created.
- **Expected Results**: A conflict log entry is recorded successfully.Continue this process to generate interconnected test cases that refine the exploration further.
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 mimics a tester’s logical reasoning, creating a sequence of interconnected test cases that uncover hidden insights.
Hands-On Exercise
Use the prompt to generate test cases for a workflow involving data synchronization. Explore edge scenarios like network partitions or high latency.
Want More?
Challenge the chain-of-thought process by introducing new dependencies or risks mid-process. Observe how the generated test cases evolve logically to address them.
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.