Setup loaded. Click Generate Test Prompt.

Coding Workflows

Test Case Prompt Generator

"Write tests for this code" gets happy-path tests with weak assertions. Pick the test strategy, the framework, and the coverage areas — and get a test generation contract: failure scenarios, edge case groups, framework discipline, and non-goals that keep the AI from rewriting your code. Runs entirely in your browser.

What is being tested, and why now? E.g. "Generate tests for the orders REST endpoint before it goes public."

Test Strategy

The tool's heart: each strategy is a different testing philosophy with its own failure scenarios.

Framework

A mode, not a tool: each framework adds its own discipline — Playwright locators, xUnit theories.

Test Depth

Production Ready means CI discipline and a regression net — not simply "more tests".

Coverage Focus * (select all that apply)

Each area contributes real testing instructions to the contract — not just a heading.

Paste the code under test and the prompt carries it; leave empty and the prompt ends with a paste-here placeholder.

Coverage Preview (live — what your contract will demand)

            

AI Resource Library

Resources for this tool

View All Resources →

Workflow Playbooks

Playbooks that use this tool

All Playbooks →
Coding Workflows · 5 steps

AI Code Review Workflow

A complete AI-assisted review pass — not one prompt — that ends with ranked findings, tests guarding behavior, and a refactor plan when one is warranted.

View Playbook →
Coding Workflows · 3 steps

AI Security Review Workflow

Review code for what an attacker would do, not just what tests catch — anchor the model as a security engineer, run a threat-focused review, then back the findings with auth and input tests.

View Playbook →
Coding Workflows · 5 steps

AI Debugging Workflow

The order that actually finds bugs instead of guessing at them — so you end with a verified fix, not a plausible one that quietly returns next week.

View Playbook →
Prompt Builder Workflows · 4 steps

AI Agent Evaluation Workflow

Find out whether an AI agent behaves before users do — define what correct means, build test scenarios with expected outputs, catch failures and hallucinations, then regression-test each version.

View Playbook →

Build Blueprints

Blueprints that use this tool

All Blueprints →
Blueprint · 10 stages

Build a SaaS MVP with AI

The full path from idea to a shipped SaaS MVP — define and scope the requirements, design the architecture, API, and data model, then build it reviewed, tested, secured, cost-controlled, and deployed.

View Blueprint →
Blueprint · 8 stages

Build an AI Support Agent with AI

The full path to a support agent you can put in front of customers — write its instructions, ground it in your docs, route and handle tickets, then evaluate and cost-control it before it goes live.

View Blueprint →
Blueprint · 9 stages

Build an API Backend with AI

The full path to a backend you can put clients on — define the requirements, design the architecture, API contract, data model, and access control, then build it reviewed, tested, secured, and shipped.

View Blueprint →
Blueprint · 8 stages

Modernize a Legacy Codebase with AI

The full path to taming an inherited codebase — understand it, document its architecture, pin its behavior with tests, then refactor, modernize, review, speed up, and ship it without breaking what works.

View Blueprint →
Blueprint · 5 stages

Build a RAG System with AI

The full path to a retrieval system that returns grounded answers — understand the corpus, chunk and ground it, extract and classify the metadata, then evaluate that retrieval actually works.

View Blueprint →
Blueprint · 9 stages

Build a Marketplace with AI

The full path to a two-sided platform — define the buyer-and-seller requirements, model the data, design the API, build roles and permissions, wire integrations, design the UI, then test, secure, and ship it.

View Blueprint →

How it works

State the testing objective, then pick the test strategy — Unit, Integration, End-to-End, Regression, Edge Case, or API. Each strategy is a different testing philosophy with its own principles and failure scenarios: unit tests isolate and mock, integration tests make the boundary the subject, regression tests pin today's behavior by name. Choose the framework as a mode — xUnit theories, Jest mock discipline, Playwright's no-sleep locator rules, PyTest fixtures — and toggle the coverage areas that apply: happy path, edge cases, error handling, validation, security, performance, regression. Each area contributes real testing instructions, and the live Coverage Preview shows exactly what your contract will demand. Set the depth (Production Ready means CI discipline and a regression net, not just more tests), optionally paste the code, and click Generate Test Prompt. The output is a test generation contract — including non-goals that stop the AI from rewriting your implementation. Nothing leaves your browser.

Use cases

  • Turning "write tests for this" into tests with edge cases and real assertions
  • Getting framework-correct tests — Playwright that doesn't sleep, Jest that resets mocks
  • Building characterization tests before touching legacy code
  • Testing AI-generated code before trusting it

Pro tips

  • Pick the strategy before the framework: "how should this be tested" (philosophy) comes before "what runs it" (mode). An API tested as unit tests misses the contract; a unit tested end-to-end wastes a browser.
  • The non-goals section earns its place the first time the AI "improves" your implementation instead of testing it — keep it even when you trim the prompt.
  • Edge Cases as a coverage area gets its own section in the prompt with six input groups (null, empty, min/max, off-by-one, malformed, unicode). If you only toggle one extra area, toggle that one.
  • Use Production Ready depth for suites that run in CI: it bans the flaky patterns (sleeps, shared state, ordering) that turn green suites red on Fridays.

FAQ

How is this different from the Code Review Prompt Generator?

Different questions. Code Review asks "what is wrong with this code?" — it judges and reports findings. Test Case asks "how should this code be tested?" — it creates validation instructions. Review identifies the gaps; this tool builds the net. They meet in the middle: a review finding of "tests missing for the error path" is exactly what this tool's error-handling coverage area generates.

Why is Selenium a framework mode instead of its own tool?

Because a framework is a serializer of testing intent, not a testing philosophy. The strategy (E2E, regression) decides WHAT to test; Selenium vs Playwright vs Cypress only changes HOW the instructions are phrased — waits, locators, lifecycle. One tool with framework modes beats four tools that are 90% identical — the same reason the JSON Output Prompt Builder absorbed XML and YAML.

Does the strategy really change the output?

Each strategy swaps the philosophy block and the failure scenarios. Unit tests get isolation rules and mocked-dependency failures; integration tests get transaction rollback and partial-failure scenarios; E2E gets session expiry and double-submission; API tests get the 401-vs-403 distinction and idempotency. Same skeleton, different testing worldview.

What does the generated prompt stop the AI from doing?

The NON-GOALS section is explicit: do not rewrite or "improve" the implementation, do not refactor for testability (flag it instead), do not invent requirements, and do not weaken assertions to make tests pass. The ASSUMPTIONS section forces the model to separate what it knows from what it guessed — and to list the GAPS it couldn't test.

Should I test failing code with this, or debug it first?

Debug first — that's the Debugging Prompt Generator's job: "why is this failing?". This tool asks "how should behavior be validated?" and assumes the code's intended behavior is known. The one exception is regression strategy on legacy code: characterization tests deliberately pin current behavior, bugs and all, before you change anything.

Can it generate the tests directly?

It generates the test generation PROMPT — the contract you paste into ChatGPT, Claude, or your coding assistant along with the code. The value is repeatability: the same contract produces the same coverage discipline on every module, instead of whatever the model feels like testing today.