Generate Boundary Condition Unit Tests for GitHub Copilot
Get a comprehensive unit test suite focusing on edge cases, null pointers, and arithmetic overflows for any function you paste.
Agent prompt for ChatGPT and Claude
Prompt
mkdir -p .agents/skills/generate-boundary-condition-unit-tests-for-github-copilot && curl -sL "https://prompts-gpt.com/prompts/generate-boundary-condition-unit-tests-for-github-copilot/raw" -o .agents/skills/generate-boundary-condition-unit-tests-for-github-copilot/SKILL.md---
name: generate-boundary-condition-unit-tests-for-github-copilot
description: "Get a comprehensive unit test suite focusing on edge cases, null pointers, and arithmetic overflows for any function you paste."
---
# Generate Boundary Condition Unit Tests for GitHub Copilot
Get a comprehensive unit test suite focusing on edge cases, null pointers, and arithmetic overflows for any function you paste.
## Prompt
```
Act as a Senior Software Engineer. I will paste a code function below. Your task is to generate a comprehensive suite of unit tests focusing exclusively on boundary conditions. Follow these rules: 1. Create a table of test cases that includes the input scenario, the expected behavior, and the specific boundary condition being tested. 2. Write the actual test code using a standard testing framework like PyTest, JUnit, or Jest. 3. Ensure no external mocks are used; if a dependency is required, suggest the minimal structural change instead. 4. Include tests for empty collections, null inputs, maximum integer values, and off-by-one errors. Output format: 1. Test Case Table 2. Unit Test Code Block. Please wait for me to paste the code after you acknowledge this request.
```
## Usage Notes
Copy this prompt into GitHub Copilot Chat, ChatGPT, or Claude. After the model acknowledges, paste your function code. This is ideal for identifying logic gaps in critical utility functions before committing code to your repository.
Act as a Senior Software Engineer. I will paste a code function below. Your task is to generate a comprehensive suite of unit tests focusing exclusively on boundary conditions. Follow these rules: 1. Create a table of test cases that includes the input scenario, the expected behavior, and the specific boundary condition being tested. 2. Write the actual test code using a standard testing framework like PyTest, JUnit, or Jest. 3. Ensure no external mocks are used; if a dependency is required, suggest the minimal structural change instead. 4. Include tests for empty collections, null inputs, maximum integer values, and off-by-one errors. Output format: 1. Test Case Table 2. Unit Test Code Block. Please wait for me to paste the code after you acknowledge this request.Example output
Tips and common edits
Why this works
- Forces the model to identify edge cases before writing code.
- Uses a table format to ensure all boundary types are covered.
- Bans mocks to keep tests fast and focused on pure logic.
Copy this prompt into GitHub Copilot Chat, ChatGPT, or Claude. After the model acknowledges, paste your function code. This is ideal for identifying logic gaps in critical utility functions before committing code to your repository.
Common edits
- Specify the testing framework if the model defaults to the wrong one.
- Add a rule to include performance tests if the function processes large data.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Design Mock Tool Fixtures for Agent Trajectory Testing
Generate deterministic mock tool responses to test agent decision trees, edge-case failures, and schema-breaking payloads without live API usage or costs.
Generate Reproducible Bug Fix Specs for Coding Agents
Get a standalone reproduction test script and a precise technical plan to fix a bug, ensuring your AI agent stays focused and avoids unnecessary file changes.
Sync Test Factories and Fixtures with Database Migrations
This prompt updates your test factories, JSON fixtures, and contract tests to match new database schema changes, ensuring your test suite remains consistent with production code.
Debug Regex and Parsers with GitHub Copilot
Generate an automated audit of regular expressions or parser snippets that flags catastrophic backtracking, isolates edge cases, and produces unit test fixtures.
Evaluate Coding Agent Test Suites for False Positive Traps
Audits agent-generated unit tests to catch tautological assertions, over-mocking, and tests that still pass when core business logic is disabled.
Turn Sentry Errors into Reproducible Codex Test Cases
Transforms a production Sentry stack trace and context payload into a self-contained failing unit test designed for Codex repo tasks.
- Unit Test Plan and Test Code for an Existing Function
- Merge Three AI Coding Solutions and Rank What to Test First
- Document module behavior from its test suite
- Refactor nested legacy loops into flat readable helper functions
- Build a workflow test checklist with edge cases
- Design a fair test comparing two system prompts