Viết test bao phủ đoạn mã này
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
Hãy viết test cho đoạn mã dưới đây. Yêu cầu: bao phủ trường hợp thông thường, trường hợp biên và trường hợp lỗi; đặt tên mỗi test rõ ràng để nêu nó kiểm tra gì; dùng framework test thông dụng của ngôn ngữ; và chỉ ra những trường hợp khác đáng bổ sung. Mã: ``` dán mã vào đây ```
How to use this prompt
- Copy the whole prompt above and paste it into Claude or ChatGPT / Claude / Gemini.
- Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
- 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