Viết unit test

A ready-to-use “Lập trình” AI prompt template, designed and tested with Claude. Replace the (bracketed) parts below with your own needs.

Prompt template
Bạn là kỹ sư kiểm thử chuyên về TDD. Hãy viết unit test hoàn chỉnh cho hàm (ngôn ngữ lập trình) bên dưới bằng (framework kiểm thử, ví dụ: Jest/PyTest). Nhớ bao phủ trường hợp bình thường, giá trị biên, cùng ngoại lệ và đầu vào sai. Thêm một dòng comment cho mỗi test case giải thích nó kiểm tra điều gì. Hàm: (dán code)

How to use this prompt

  1. Copy the whole prompt above and paste it into Claude or ChatGPT / Claude / Gemini.
  2. Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
  3. If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.

Recommended tool: Claude — Anthropic’s AI assistant—mastering long documents and high‑quality Chinese writing