Coding & Software
Code Review Checklist Prompt
A structured review prompt that checks correctness, failure handling, security and tests, and labels every finding by severity.
- Customizable fields
- 3 fields
Coding & Software
Generates focused unit tests for one function, covering normal cases, boundaries and invalid input without mocking more than needed.
Designed for general-purpose AI assistantsPublished November 2026
Fill in the fields and the prompt updates. What you type stays in this page and is never saved or sent.
Write unit tests for the function below using {{test framework}}.
The function should: {{expected behavior}}
{{code}}
Cover, in this order:
- The normal, expected cases.
- Boundary values: empty, zero, one item, maximum, minimum.
- Invalid or unexpected input, and the behavior I described for it.
- Cases where two inputs look similar but should give different results.
Rules:
- One behavior per test, with a name that describes the behavior rather than the function.
- No tests that only repeat the implementation.
- Do not mock anything unless the function touches the network, disk or clock, and say what you mocked and why.
- If my description and the code disagree, point that out before writing tests for either version.
Output only the test file, followed by a short list of behaviors you could not test and why.3 required fields are empty and will stay as a {{placeholder}} in the copied text.
Illustrative only. Real answers depend on your input and the assistant you use.
Function: parse_duration("1h30m") returns the number of seconds. Framework: pytest.
def test_parses_hours_and_minutes_together():
assert parse_duration("1h30m") == 5400
def test_accepts_a_single_unit():
assert parse_duration("45m") == 2700
def test_empty_string_raises_value_error():
with pytest.raises(ValueError):
parse_duration("")
def test_rejects_unknown_unit():
with pytest.raises(ValueError):
parse_duration("5x")
Not tested: very large values (the description does not say whether there is a maximum) and negative durations (the code accepts "-5m"; the description does not say whether it should).Ask for the tests first and the explanation second. That keeps the answer short enough to review in one pass.
Coding & Software
A structured review prompt that checks correctness, failure handling, security and tests, and labels every finding by severity.
Coding & Software
Finds why a test passes sometimes and fails other times, ranks the likely causes and gives an experiment to prove each one.
Coding & Software
Writes reference documentation for one API endpoint from its code, covering parameters, responses, errors and a working example.