Canva lists this among the skills it scores, and AI can't do it for you until you know what you want.
Before writing anything, find out: what goes in, what comes out, how big it gets, and what counts as correct.
Then split the work into pieces small enough to test alone. Each piece should have a clear input and output.
Write down what must be true when you finish. That list becomes your tests, and your prompts.
- What four things do you pin down first in any problem?
- The input, the output, the scale, and what counts as correct.
- What's a good size for one piece of work?
- Small enough to test alone, with a clear input and output: usually one or two functions.
- What are the first questions for an ambiguous product problem?
- Who uses it, how often, what a failure costs, and what's explicitly out of scope.
- What should you write before coding?
- A short list of must-pass behaviours, including edge cases. It becomes your tests.