ThinkWithPrompt by SynotticThinkWithPrompt

Write unit tests for my code

Comprehensive unit tests covering happy paths, edge cases, and failures.

Software DevelopmentRTFStandardCodingWriteCodeFill-in Template

The prompt

Write unit tests for this code. Language and test framework: [e.g. Python + pytest, TypeScript + Vitest] Code under test: [PASTE] Cover: - Happy paths for each public function/method. - Edge cases: empty, null, boundary values, large inputs, unusual types. - Error handling and exceptions. - Mock external dependencies (network, database, time, randomness). Return the test file(s), a coverage map (which behaviors each test covers), and any bugs or untestable design you discovered while writing tests.

Highlighted [brackets] are blanks to replace with your own details.

Fill in the blanks and use this promptMore Software Development prompts

What to fill in

  • e.g. Python + pytest, TypeScript + Vitest
  • PASTE

How this prompt is built

This prompt follows the RTF structure (Role, Task, Format). RTF tells the model who to be, what to do and what shape the answer should take. It is the quickest structure that still gives noticeably better results than a bare request.

Related prompts

Find more prompts like this