Test generation prompt builder
Good tests are tedious to write and easy to skimp on, which is exactly why LLMs help — if you ask correctly. A loose “write some tests” yields a couple of happy-path cases. The test generation prompt builder assembles a prompt that names your language and framework, your coverage goals, and the rules for real assertions, so the model returns a suite that exercises edge cases, boundaries, and failure modes too.
How it works
You pick a language and a matching test framework, paste a function signature, docstring, or full implementation, and check the coverage categories you want — happy path, edge cases, boundary values, failure modes, and idempotency or side effects. The tool composes a prompt that requires idiomatic framework structure, behavior-describing test names, a specific assertion in every test, and explicit flags for any behavior the spec leaves ambiguous. It runs locally with no API key. You paste the prompt into your LLM and review the suite it produces.
Tips and notes
- Lead with a clear spec. The model derives expected values from your docstring — a precise spec yields correct assertions.
- Always run the output. Generated tests are a draft; run them and fix any that encode a wrong assumption rather than trusting them blind.
- Add failure modes deliberately. Untested error paths are where bugs hide; keep that box checked for anything user-facing.
- Pair with debugging. When a test surfaces a real bug, feed it into the debugging prompt builder to get a targeted fix.