dotnet-testing-code-coverage-analysis

dotnet-testing-code-coverage-analysis is a skill for Claude Code, Codex from kevintsengtw/dotnet-testing-agent-skills. It costs 175 tokens per session (2,893 once invoked), scanned A, original, MIT.

A guide to code coverage, a measurement of which parts of a program run while tests execute. It explains coverage reports, Coverlet, Visual Studio, and VS Code, and notes that a high percentage alone does not prove the tests are good.

In plain words
What is it for?
Use it to collect .NET coverage reports, inspect line or branch coverage, use Visual Studio or VS Code views, and add coverage checks to CI/CD, automated build and test pipelines.
Why use it?
It helps find code that tests never exercise and supports decisions about where more testing is needed without treating the percentage as a guarantee of correctness.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to collect .NET coverage reports, inspect line or branch coverage, use Visual Studio or VS Code views, and add coverage checks to CI/CD, automated build and test pipelines.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-code-coverage-analysis
Clone the repo
git clone --depth 1 https://github.com/kevintsengtw/dotnet-testing-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dotnet-testing-code-coverage-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis/github.svg)](https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis)
Your own site
<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dotnet-testing-code-coverage-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-code-coverage-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 175 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,893 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00175 $0.02893
Opus 5.5 $0.00070 $0.01157
Sonnet 5.5 $0.00035 $0.00579
Haiku 4.5 $0.00017 $0.00289

Measured 22d ago against content hash 719ae470d19e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dotnet-testing-code-coverage-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 22d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/dotnet-testing-code-coverage-analysis/SKILL.md · 213 lines

How it starts

The opening of the file, as written. The whole thing — 213 lines — stays where its author put it; the contents beside it link to each section on GitHub.

程式碼覆蓋率分析指南

Code Coverage 核心概念

程式碼覆蓋率 (Code Coverage) 是一種測量指標,用來統計測試執行時實際執行了多少程式碼。

實際價值: 找出測試盲點、評估測試完整性、輔助重構決策、增加測試信心。

常見誤解:

  • 涵蓋率 100% 不代表沒有 Bug — 只代表程式碼有被執行,不代表驗證了正確行為
  • 涵蓋率數字越高不一定越好 — 重點是測試的有效性
  • 把涵蓋率當作 KPI 會適得其反 — 開發者會為了衝數字而寫沒有 Assert 的測試

覆蓋率工具選擇

工具 優點 適用場景
Visual Studio Enterprise 內建整合,完整 UI 僅 Enterprise
Fine Code Coverage(推薦) 免費,即時顯示,編輯器直接標示 VS 所有版本
.NET CLI + Coverlet 跨平台,CLI 自動化 CI/CD 流程
VS Code 內建 跨平台,無需額外擴充套件 VS Code 開發

Fine Code Coverage 設定

  • 安裝方式: Visual Studio 延伸模組管理 → 搜尋 "Fine Code Coverage" → 安裝
  • 必要設定: 工具 → 選項 → Fine Code Coverage → Enable: True、Editor Colouring Line Highlighting: True

VS Code 內建測試覆蓋率

  1. 安裝 C# Dev Kit 擴充套件
  2. 開啟測試總管(燒杯圖示)
  3. 點選「執行涵蓋範圍測試」
  4. 查看結果:測試涵蓋範圍視圖、編輯器內顯示、檔案總管顯示

執行覆蓋率分析

# .NET CLI(推薦用於 CI/CD)
dotnet test --collect:"XPlat Code Coverage"
dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage

# Fine Code Coverage:在 VS 中執行測試後自動顯示
# VS Code:開啟測試總管 → 點選「執行涵蓋範圍測試」

方法說明

方法 工具 操作步驟
.NET CLI Coverlet + CLI 執行 dotnet test --collect:"XPlat Code Coverage"
Fine Code Coverage VS 擴充套件 在 VS 中執行測試後自動顯示
VS Code C# Dev Kit 開啟測試總管 → 執行涵蓋範圍測試

設定 Coverlet

測試專案需安裝 coverlet.collector 套件,並可透過 runsettings 檔案進行進階設定(排除規則、閾值、報告格式)。

完整 csproj 配置範例請參考 references/coverlet-csproj-config.md

解讀覆蓋率報告

顏色標示: 綠色(已覆蓋)、黃色(部分覆蓋)、紅色(未覆蓋)

覆蓋率指標:

  1. Line Coverage(行覆蓋率) — 被執行的行數 / 總行數,最基本的指標
  2. Branch Coverage(分支覆蓋率) — 被執行的分支數 / 總分支數,比行覆蓋率更準確
  3. Method Coverage(方法覆蓋率) — 被執行的方法數 / 總方法數

Read the full file on GitHub · 213 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 22d ago Changed · -1 lines · -41 tokens per session 719ae470d19e
  2. 1mo ago First seen · 214 lines · 216 tokens per session scan A 20ecf6d67b7e

Subscribe to this mod's changes

dotnet-testing-code-coverage-analysis is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (30 stars, last pushed 18d ago), licensed MIT. It adds 175 tokens to every session and 2,893 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

author-test

Generate a test given sample. Parameters: C# SDK repository root; Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; the sample to use as a starting point for the test.

Azure/azure-sdk-for-net · 68 tokens

migrate-mstest-v3-to-v4

Use this skill before answering, planning, or editing any MSTest 3.x-to-4.x upgrade or post-upgrade failure. Triggers include "MSTest v4 breaking changes"; CS0507/CS0103/CS1061/CS1615; ExecuteAsync, CallerInfo, DisplayName, or custom TestMethodAttribute; ClassCleanupBehavior; ContainsKey; ThrowsExactly or…

managedcode/dotnet-skills · 179 tokens

migrate-xunit-to-mstest

Convert .NET tests from xUnit.net v2/v3 to MSTest v4 while preserving VSTest or MTP. Use for replacing xunit packages, Fact/Theory/InlineData/MemberData, assertions, IClassFixture/ICollectionFixture, ITestOutputHelper, TestContext cancellation, traits/Owner, skips, timeouts, and xUnit parallelization. Also use when a…

managedcode/dotnet-skills · 141 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

managedcode/dotnet-skills · 149 tokens

csharp-dotnet

Use when writing, reviewing, testing, or shipping C# / .NET code — ASP.NET Core APIs (minimal APIs vs controllers), EF Core data access, async correctness, solution layout in .cs/.csproj/.sln. NOT a Java/Spring backend (that is spring-boot), NOT a Node/TypeScript backend (that is nestjs), NOT framework-neutral REST…

ericrisco/rsc-harness · 89 tokens

archunitnet

Use the open-source free ArchUnitNET library for architecture rules in .NET tests. Use when a repo needs richer architecture assertions than lightweight fluent rule libraries usually provide. USE FOR: the repo uses or wants ArchUnitNET; architecture testing needs richer modeling than simple dependency checks. DO NOT…

managedcode/dotnet-skills · 104 tokens