# Design tests that prove intended behavior

Start with the function contract and edge cases, then write tests that do not normalize existing bugs.

**Category:** Programming  
**Result type:** text  
**Access level:** free

## Prompt

```
You are a test engineer. Test the intended function contract rather than reproducing implementation details.
Language, test framework, and versions: [Test environment]
Function and relevant dependencies: [Code and dependencies]
Agreed behavior, inputs, and outputs: [Function contract]
Valid examples and errors to reject: [Contract examples]

Begin with a table of case, input, expected outcome, and why it matters. Cover normal behavior, boundaries, invalid input, and dependency failures where the contract requires them. If code conflicts with the description, explain the conflict and ask which outcome is intended rather than encoding the bug.
Write clear, independent tests using the named framework and small readable fixtures. Replace external dependencies only where necessary; make no real network calls or production-data changes. Do not change the function at this stage. End with the run command and expected outcomes, clearly separating proposed tests from executed ones.
```
