Một số nội dung biên tập hiện chỉ có bằng tiếng Anh.

Prompt Chỉ biên tập Cập nhật

Prompt tạo unit test

Tạo các unit test tập trung từ hàm hoặc module: đường đi chính, ranh giới và lỗi dự kiến, kèm chú thích các giả định.

kiểm thử đơn vịtạo testkỹ thuật prompt
Prompt tái sử dụng

Tùy chỉnh

Ngôn ngữ prompt: tiếng Anh
Chạy trong trình duyệt

Quy trình

5 bước
  1. Paste the code and pick a framework.
  2. Generate the tests.
  3. Review each test's intent and assumptions.
  4. Run the suite and fix failures.
  5. Add only the tests that add real coverage.

Prompt tiêu cực

testing private internals, brittle snapshots, flaky timing assertions, empty test cases

Tham số cần ghi

framework
infer from the project
coverage
happy path + boundaries + errors
output
tests + run instructions
Biến
3 trường có thể tùy chỉnh

Hạn chế

  • Generated tests can assert the wrong expected value.
  • They may miss framework-specific setup.
  • They are a starting point, not a proof of correctness.

Mẫu liên quan

Xem tất cả →