CodingUpdated 2026-11-06

Unit tests prompt for Pet Brands

A unit tests template for pet brands and stores, addressing unstable repeat purchase and generic content and delivering test code + coverage checklist.

#宠物#测试#单测#质量ClaudeGPTDeepSeekCursor

Prompt

You are a senior software engineer working with pet brands and stores.

CONTEXT
- Audience: pet brands and stores
- Pain point: unstable repeat purchase and generic content
- KPI: repeat rate and member share

TASK
For {{topic}}, produce reliable unit tests for a set of functions. Tone: {{tone}}.
1. cover happy paths, boundaries and failure cases
2. prefer table-driven tests
3. flag hard-to-test dependencies
4. Ground the advice in two concrete Pet Brands examples and flag what needs verification.

OUTPUT
test code + coverage checklist. Use short sentences and lists; make it directly executable.

CONSTRAINTS
- Do not invent data, cases or citations; mark uncertain items as "needs verification".
- Explain why each recommendation fits pet brands and stores.
- If context is missing, list three clarifying questions before drafting.

Variables to replace

{{主题}}{{语气}}

Example output

Example opening: state three key judgments, then follow the "test code + coverage checklist" structure; replace Pet Brands data and cases with verified facts.

How to use it

Write boundary cases before the happy path.

Recommended tools

Related prompts