- Coding
- Agent
- Intermediate
- Claude Code
- Cursor
- GitHub Copilot
- Published
Edge-Case Test Suite for One Function in Your Existing Test Framework
Writes tests for a single function that cover normal inputs, boundaries, bad input and error paths, in the test framework your project already uses.
You get: the behaviour list as a table (Case, Input, Expected result, Why it matters), then the test file in one code block, then likely bugs found, then any assumptions and missing…
The prompt
mkdir -p .agents/skills/edge-case-test-suite-for-one-function-in-your-existing-test-fram && curl -sL "https://prompts-gpt.com/prompts/edge-case-test-suite-for-one-function-in-your-existing-test-framework/raw" -o .agents/skills/edge-case-test-suite-for-one-function-in-your-existing-test-fram/SKILL.mdAct as a test engineer who hunts for edge cases. Write tests for the function below.
Rules:
1. Use the test framework and style already in the project. If you cannot tell which one, ask me before writing code.
2. Before writing tests, list the behaviours to test: normal cases, boundaries (empty, zero, one, maximum, off-by-one), invalid input, error handling, and any time, locale or concurrency effects.
3. One behaviour per test, with a name that states the expected result.
4. Do not change the function. If a test reveals a likely bug, keep the test, mark it as expected to fail, and explain the bug.
5. No mocking of the function under test; mock only external calls.
Output format: the behaviour list as a table (Case, Input, Expected result, Why it matters), then the test file in one code block, then likely bugs found, then any assumptions and missing information, such as unclear intended behaviour.
{paste the function and its imports}Tips and common edits
Paste one function at a time. In Claude Code, Cursor or GitHub Copilot, point it at the file instead and ask it to run the tests and report which fail.
Questions about this prompt
More like this
More in CodingCharacterization Tests Before a Refactor
Writes tests that lock in a module's current behavior, including edge cases and quirks, so you can refactor safely.
Unit Test Plan and Test Code for an Existing Function
Builds a behavior-based test matrix for a function or module and then generates test code in your framework. Covers edge cases, failures, and mocking boundaries, with coverage gaps stated honestly.
Codebase Tour for a Specific Task
Explores a repo through the lens of your task and explains the architecture, key files and data flow, then says where to start.
Debug an Error From the Message and the Code Around It
Finds the most likely cause of an error from the message and the relevant code, ranks other possible causes, and gives the smallest fix plus a way to prove it worked.
Explain a Codebase Folder to a New Developer on Their First Day
Produces an onboarding guide for one folder of a codebase: what it does, how data moves through it, the files to read first and the traps a new developer should avoid.
Failing Test First Bug Fix
Reproduces a bug with a failing test, finds the root cause, applies the smallest fix and shows the test passing.
Plain-English Question to a Correct SQL Query for Your Schema
Writes a SQL query from a plain-English question using your real table definitions, explains each part, checks it for common mistakes and suggests indexes if it will be slow.
Test-First Bug Fix Skill: Reproduce, Fix, Prove (SKILL.md)
A SKILL.md that forces your coding agent to reproduce a bug with a failing test before changing code, apply the smallest fix, and prove it with the test suite.
Pull Request Review with Merge Recommendation
Reviews a diff against your standards and returns a merge, merge-with-changes, or do-not-merge recommendation. Findings are ranked by severity, with evidence, suggested fixes, and open questions.
Regex Builder With Match and No-Match Test Cases
Builds a regular expression from a plain-English description and example strings, explains each part, and proves it against strings that should and should not match.
Root Cause Analysis from Stack Trace and Logs
Turns an error report, stack trace, and logs into ranked root-cause hypotheses. Includes the cheapest checks to confirm each one, a fix proposal, and a regression test plan.
Release Notes From Git Log Skill for Users and Developers (SKILL.md)
A SKILL.md that writes release notes from the commits between two tags, split into a plain-language section for users and a technical changelog for developers.