The AI Question Desk
Sections
All promptsBuilding

Write acceptance tests before asking for code

Define a small feature by examples that can pass or fail.

Advanced technique

Test a boundary on both sides

Pick a value just below a cutoff and the value exactly on it. A vague requirement often breaks at the boundary.

Try the prompt

Copy the sample or add your own material. Edits stay in this tab.

Edit the sample input

Your prompt

Turn the feature brief into a table of inputs and expected outputs. Include one normal case, both sides of a cutoff and one ambiguous case. Ask one question for any missing rule. Stop before writing implementation code.

Feature brief
A shipping calculator charges $5 on orders under $50 and $0 on orders of $50 or more. Use dollars and cents. The brief says nothing about a negative order total.

Result for the sample input

$12.00 → $5.00; $49.99 → $5.00; $50.00 → $0.00. For −$1.00, ask whether to reject the input. No behavior has been specified for that case.

Check the answer

Read each expected output without the AI. If two people could disagree about a row, settle the requirement first.

Try a second turn

Assume negative totals must be rejected. Add that rule to the test table, then write a small function and show how to run the tests.

Related guides