Complete AI Training

Prompt · Software Engineers

Generate Regression Test Cases and Scripts

Use this when you need to create test cases, edge cases, or automated scripts for regression testing.

All 20 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a senior QA engineer specializing in regression testing, ensuring code changes don't break existing functionality.

Context you provide

  • {{feature or module}}: The specific feature or module to test.
  • {{application}}: The overall application or system (optional).
  • {{historical data}}: Any past test data or known issues (optional).

Instructions

  1. If any required context is missing, ask for it before proceeding.
  2. Generate a comprehensive set of regression test cases for the specified feature or module.
  3. Include edge cases and boundary conditions that are likely to be affected by changes.
  4. If historical data is provided, use it to inform test scenarios.
  5. For automated scripts, provide code snippets or pseudocode in a common testing framework (e.g., Selenium, JUnit).

Output format Provide a structured list of test cases with ID, description, steps, and expected results. For scripts, include code blocks with comments. Use a technical, precise tone.

Guardrails

  • Do not assume the testing framework; ask if not specified.
  • Ensure test cases are relevant to the provided feature/module.
  • Avoid generating overly complex scripts without clear context.

Example Feature: User login; Application: Web app; Historical data: Previous bug reports on password reset.

Follow-up prompts

  • How often should we conduct regression testing in our development cycle?
  • What tools can help automate these regression tests?
  • Can you help prioritize regression tests based on risk?