test-value-evidence
Skill này làm gì
Skill này kiểm tra xem các test cho một thay đổi cụ thể có nhận ra hành vi mới nếu nó sai hoặc bị thiếu hay không. Dành cho người review muốn có bằng chứng rằng một bản sửa lỗi hoặc tính năng được test bảo vệ.
Khi nào nên dùng
- ✓Khi một pull request thay đổi hành vi và bạn muốn bằng chứng rằng test của nó sẽ phát hiện kết quả sai.
- ✓Khi một test hồi quy nên thất bại trên code cũ và đạt trên code đã sửa.
- ✓Khi bạn cần bằng chứng gắn với một commit hoặc pull request cụ thể, không phải một đánh giá test chung.
Liên kết skill
https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/test-value-evidence/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy kiểm tra xem các test mới trong pull request này có thất bại trên code cũ và đạt trên code đã sửa không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent xác định hành vi đã thay đổi và các test liên quan của nó tại revision được nêu, rồi thu thập bằng chứng trước và sau cho thấy test có phát hiện hành vi thiếu hoặc sai hay không.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Test-value evidence
A passing test proves little unless it detects the relevant wrong behavior. Assess the changed contracts and their directly related tests, not the entire repository. Discover and follow the repository's instructions, pinned toolchain, test commands, assertion conventions, and execution permissions. This skill does not authorize edits in a read-only review, execution of untrusted code, workflow dispatch, publication, or access to another session's checkout.
Inputs and boundaries
Discover the requested diff/revision, production entry points, tests, fixtures, and available execution artifacts. If the change cannot be identified, report the missing scope instead of grading the workspace. Existing unchanged tests can suffice; a source-only diff is not automatically untested.
Use test-gap-analysis for general existing-suite blind spots, grade-tests
for curated per-test readiness/quality, and existing repository mutation tooling
for mutation campaigns. Do not start a second mutation engine or require
full-suite mutation testing for every change. This skill is self-contained:
sibling skills are optional routing destinations, not required dependencies.
Workflow
Bind the contract to the tested revision. For a PR, record its merge base and exact head SHA. For a commit, record the selected parent and commit; identify the parent explicitly for a merge commit. For uncommitted work, record the base SHA plus a reproducible patch identity (saved patch/hash, including relevant untracked files), not a fictitious committed revision. Evidence expires after relevant source, tests, helpers, configuration, or package changes unless revalidated.
For each distinct behavior change, map:
requirement -> input/sequence -> expected public outcome -> production entry point -> named test/data case -> distinguishing assertion. Derive the expected outcome independently from requirements or supported API/protocol semantics, not the implementation or the test's current value. Check build/package/configuration behavior, deleted/renamed code, removed tests, and shipping consumers as well as source. Include positive, negative, boundary, compatibility, cancellation, cleanup, and multi-module cases only where relevant to the changed contract.A mock of the changed component, self-comparison, or expected value computed by the same production algorithm does not provide an independent oracle.
Choose the meaningful counterfactual.
Change Counterfactual Required observation Bug fix Keep the regression test and restore the actual pre-fix defect. The test fails for that defect, then passes with the fix. New feature Disable/remove or corrupt the behavior, retaining the API shape and setup needed to build. An assertion detects absent/wrong behavior, then passes with the feature. Stronger/test-only coverage Introduce one plausible wrong public outcome. The strengthened test detects it; the unmodified product passes. Behavior-preserving refactor Compare the preserved contract before and after; optionally probe a relevant fault. Preservation tests pass on both revisions; passing before is expected. Documentation/generated metadata only Establish whether an executable contract changed. Not applicable only with a concrete reason; generated or build metadata can change behavior. For a fix, prefer the real pre-fix implementation with the same regression test, setup, dependencies, and inputs. If new APIs prevent that combination from compiling, restore only the defective behavior in the head version. Call this a targeted counterfactual, not a run on the base revision. Record its exact patch/hash. Never change assertions to manufacture red.
For a feature, a missing-symbol compiler error is not behavioral proof. Choose a buildable no-op, disabled registration, old branch, or wrong output. A compiler/analyzer diagnostic can be valid behavior only when an executed harness asserts that exact diagnostic or its absence.
Prefer small plausible faults: restore the old boundary, drop a required output, skip a callback, ignore an option, or return the wrong value. An equivalent mutation is not a gap. A crash, timeout, or exception counts only when it is the intended contract signal and diagnostics attribute it to the fault, not setup, discovery, fla
Câu hỏi thường gặp
Nó có rà soát toàn bộ repository không?
Không. Nó tập trung vào thay đổi đã xác định và các test liên quan trực tiếp.
Nó có chạy code không đáng tin không?
Không. Skill không thực thi code không đáng tin, và không sửa tệp trong lúc rà soát chỉ đọc.
Đây có giống mutation testing không?
Không hẳn. Nó dùng các công cụ có sẵn của repository và kiểm tra chính thay đổi, không khởi chạy một engine mutation mới.
Chi tiết
Mô tả gốc của tác giả
Assess tests for an identified code or test change, feature, PR or commit. USE FOR: review changed behavior or regression tests, prove pre-fix/missing behavior is detected, revision-bound red-green evidence. Polyglot. DO NOT USE without an identified change: hypothetical mutations or general suite blind spots (test-gap-analysis). Also exclude per-test readiness/A-F grades (grade-tests), coverage (coverage-analysis), new suites (code-testing), or mutation engines.
repo: dotnet/skills
Độ phổ biến
- Sao GitHub
- 5.8k
- Vị trí xếp hạng
- #14641
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
create-custom-agent
5.8kGiúp agent của bạn tạo file custom agent cho VS Code, với các tool, hướng dẫn và handoff riêng sang agent khác.
create-skill
5.8kGiúp agent của bạn tạo một agent skill mới với tên hợp lệ, mô tả kích hoạt rõ ràng và file SKILL.md đúng tiêu chuẩn.
csharp-scripts
5.8kGiúp agent của bạn chạy một chương trình C# nhỏ dưới dạng một file duy nhất bằng công cụ dòng lệnh .NET, không cần tạo project đầy đủ.
dotnet-pinvoke
5.8kGiúp agent của bạn gọi các thư viện native C hoặc C++ từ .NET đúng cách, gồm khai báo chữ ký, xử lý chuỗi, bộ nhớ và safe handle.
Skill tương tự
test-driven-development
311kDạy agent của bạn viết kiểm thử thất bại trước, xem nó thất bại, rồi viết đoạn mã ngắn nhất để vượt qua trước khi làm bất kỳ tính năng hay bản sửa nào.
verification-before-completion
311kDạy agent của bạn chạy kiểm tra thực tế và đọc kết quả đầu ra trước khi khẳng định một việc, bản sửa hoặc bản build đã hoàn thành hay vượt qua.
migrate-to-shoehorn
310kThay các ép kiểu rủi ro trong tệp kiểm thử bằng thư viện shoehorn, để các bài kiểm thử dùng dữ liệu một phần vẫn qua được kiểm tra kiểu.