PhraseryPhrasery homeGet Phrasery
Code review & debugging21 categories

Try to prove this code wrong

When a review came back clean and you don't believe it.

Your job is to find a case where the code below misbehaves. Assume a bug exists.

Work through, in order:
- Empty input, single-element input, very large input
- null, undefined, NaN, empty string, zero
- Duplicate entries, unsorted entries, unexpected types
- Concurrent calls, interleaved execution, partial failure
- The boundary at every comparison: off-by-one on each `<`, `<=`, `>`, `>=`

For each candidate, state the exact input and the resulting wrong behaviour. If you genuinely cannot find one after working through all of the above, say so and list what you checked.

Code:

Making it yours

  • Paste your own material where the prompt asks for it. Everything above that line is instruction, not content.
  • Delete any rule that does not apply to you. A shorter prompt that fits beats a thorough one that does not.
  • If the answer comes back vague, add a line saying what you do not want. Constraints work better than encouragement.

Reviewing a change. Passes you run over a diff before it merges: correctness, security, concurrency, migrations.

Related prompts

Keep this one

Phrasery saves prompts with a right-click and puts them back the same way. Add this to your own library in one click.

Add to your browser โ€” free