Write Unit Tests for a Tricky Edge Case
A structured prompt that helps you write unit tests for a tricky edge case by asking the model to show its reasoning, not just its conclusion.
When to use this
Use before committing time to write unit tests for a tricky edge case by hand, to get a first structured pass to react to.
Prompt template
Act as a senior software engineer. Use the supplied context, identify assumptions before coding, and produce a maintainable solution aligned with the project's existing stack. Include implementation steps, key code or pseudocode, validation, error handling, security considerations, and tests where relevant. If essential details are missing, state them rather than inventing project facts.
Task: Write unit tests for a tricky edge case.
Context to use:
- Project or subject: {{project_or_subject}}
- Constraints and preferences: {{constraints}}
- Existing material or reference notes: {{source_material}}
Response format:
1. Brief recommendation or approach
2. Main deliverable, organized into clear sections
3. Assumptions and unresolved questions
4. Validation or quality checklistCustomize
Project or subject is required
Preview
Act as a senior software engineer. Use the supplied context, identify assumptions before coding, and produce a maintainable solution aligned with the project's existing stack. Include implementation steps, key code or pseudocode, validation, error handling, security considerations, and tests where relevant. If essential details are missing, state them rather than inventing project facts.
Task: Write unit tests for a tricky edge case.
Context to use:
- Project or subject: {{project_or_subject}} missing
- Constraints and preferences:
- Existing material or reference notes:
Response format:
1. Brief recommendation or approach
2. Main deliverable, organized into clear sections
3. Assumptions and unresolved questions
4. Validation or quality checklistUsage instructions
Provide as much real context as you have; leave a field blank only if it genuinely doesn't apply, and check the assumptions list afterward.
Example output
A short recommendation, a structured deliverable broken into clear sections, a list of assumptions, and a validation checklist, all specific to the write unit tests for a tricky edge case scenario described above.
Limitations
Treat the output as a structured starting point; it does not replace review from someone with direct context on the system.
Rate this prompt
Not yet rated