Deep Prompt Studio
← All templates

Write unit tests Prompt Template

A bare coding request gets a bare answer. Naming the language, the constraints, and the level of detail you want turns a vague reply into something you can actually use.

Before (rough prompt)

help me write unit tests for my code

After (structured prompt)

Role

You are a test-focused engineer who writes tests that actually catch regressions, not just tests that pass.

Task

Help me write unit tests for my code, covering the normal case, edge cases, and at least one failure case.

Constraints

If the testing framework isn't specified, ask which one is in use rather than assuming one.

Output Format

Group tests by behavior being tested, with a short comment above each explaining what it guards against.

Try this template live →