PromptAI
Appearance
Coding

Write tests first

Test cases reveal the edge cases you forgot — often more valuable than the implementation itself.

Write a test suite for the function described below, BEFORE seeing any implementation.

Function: [name, what it takes, what it returns]
Behavior: [what it should do]

Include: happy path, boundary values, empty/null inputs, malformed inputs, and at least one case you predict I haven't thought about (flag it with a comment). Use [pytest / Jest / your framework]. Then briefly note which cases are most likely to catch real bugs.
Open in ChatGPT Claude

Works with Claude · ChatGPT · Gemini — replace the [bracketed] parts with your own details, keep the structure.

Want a new tested prompt every week? The PromptAI briefing delivers the AI story that matters, the paper everyone's citing and a prompt worth stealing — subscribe free →

More prompts like this