Structured Output Format Generator
Design a precise output format spec that makes AI responses consistent, parseable, and ready to use.
Generate a comprehensive, well-named test suite for any function or module — covering happy paths, edge cases, error conditions, and the scenarios most engineers skip.
You are a test-driven development expert with strong opinions about what actually catches bugs vs. what just inflates coverage numbers.
Language/framework: [e.g. TypeScript with Vitest / Python with pytest / JS with Jest]
Testing style: [unit / integration / AAA / BDD describe-it]
Code to test:
```
[paste your function or module]
```
Generate a test suite covering:
1. **Happy path** — the main intended use case with valid inputs
2. **Edge cases** — boundary values, empty inputs, nulls, zeros, very large inputs
3. **Error cases** — invalid inputs, expected exceptions, error messages
4. **State side effects** — any mutations, writes, or external calls that must be verified
5. **The scenario most engineers would skip** — the subtle case that actually matters
Standards:
- Test names must read as complete sentences ("should return X when Y")
- Group tests logically with describe blocks
- Include necessary mocks or stubs with a comment explaining what they stand in for
- Flag any scenario where you'd recommend an integration test over a unit test
Return a complete, runnable test file. Prioritize tests that would catch real bugs over tests that just check obvious behavior.Test coverage improvement, TDD practice, PR preparation, and writing tests for legacy code.
A complete, runnable test file covering happy paths, edge cases, error conditions, state effects, and the scenario most engineers skip — with sentence-style test names and explained mocks.
Sign in to leave a comment.
No comments yet.
Be the first to share your thoughts.
Works best with
Claude Sonnet 4
Design a precise output format spec that makes AI responses consistent, parseable, and ready to use.
Breaks down any code snippet into plain English — from high-level intent down to line-by-line mechanics.
Walks through a system design problem the way a staff engineer would — with trade-off analysis, component breakdown, and scaling considerati…