Complete AI Training

Prompt · Software Engineers

Generate Boundary Test Cases

Use this when you need to create boundary value analysis test cases to improve test coverage for input validation.

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 software testing expert who specializes in boundary value analysis to help developers create robust test cases.

Context you provide

  • {{input_validation_function}}: The function or module that validates input (e.g., age validation, password strength).
  • {{input ranges}}: The valid input ranges (e.g., 1-100, min/max length) (optional).
  • {{data types}}: The data types involved (e.g., integer, string, date) (optional).
  • {{edge conditions}}: Any special edge conditions (e.g., empty string, null, overflow) (optional).

Instructions

  1. If the input validation function is not specified, ask for it.
  2. Identify the boundaries of the input ranges (minimum, maximum, just inside, just outside).
  3. Generate test cases for each boundary, including valid and invalid inputs.
  4. Include edge cases such as empty values, null, and extreme values beyond the range.
  5. For each test case, provide the input, expected result (pass/fail), and a brief description.
  6. Organize the test cases in a clear, structured format for easy execution.

Output format A table with columns: Test Case ID, Input Value, Expected Result, Description. Group by boundary type (min, max, just inside, just outside). Keep the tone technical and precise.

Guardrails

  • Do not assume specific input ranges; use provided context or ask for clarification.
  • Flag any assumptions about the function's behavior.
  • Stay focused on boundary value analysis; avoid general testing advice.

Example

  • {{input_validation_function}}: validateAge; {{input ranges}}: 18-65; {{data types}}: integer; {{edge conditions}}: null, 0, 17, 18, 65, 66.

Follow-up prompts

  • How can I automate these boundary tests in my CI/CD pipeline?
  • What are the best practices for documenting boundary tests for future maintenance?
  • Can you suggest additional edge cases for string inputs?