coverage-uplift

Adds non-vacuous unit, selftest, and E2E tests to raise coverage in the microsoft-ui-reactor repo.

625|52|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/microsoft/microsoft-ui-reactor --skill coverage-uplift
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coverage-uplift
Source: https://github.com/microsoft/microsoft-ui-reactor/tree/main/.github/skills/coverage-uplift
Command: npx skills add https://github.com/microsoft/microsoft-ui-reactor --skill coverage-uplift

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Raising test coverage often produces vacuous assertions that pass even when the code under test is deleted, giving a false sense of safety. This Skill closes coverage gaps in the microsoft/microsoft-ui-reactor repo with tests whose assertions genuinely fail if the targeted code path is removed, no-op'd, or returns a default value.

Core Features & Use Cases

  • Coverage baselining and gap classification: Runs tools/coverage scripts, parses merged Cobertura XML for exact uncovered lines, and classifies each gap into the right tier — headless xUnit unit tests, WinUI selftest fixtures, or E2E input tests.
  • Non-vacuous oracle patterns: Enforces proven assertion styles such as throw-position/arity oracles, differential isolation, reflection DeclaringType checks, and corrupt-then-recompute, and mutation-checks key assertions by breaking product code and confirming the test fails.
  • Repo-specific build and test discipline: Encodes the x64 platform flags, SkipSignaturesGen workaround, fixture registry registration rules, and the dotnet test switch trap (issue #1140) so runs actually execute instead of silently reporting zero tests.
  • Use Case: A contributor asks to "add tests for the PathDataParser". The Skill baselines coverage, identifies the internal tokenizer entry point as a unit-testable seam, writes narrowly-scoped xUnit tests with differential oracles, mutation-verifies them, and reports the coverage delta.

Quick Start

Ask the assistant to improve test coverage for a specific area of the microsoft-ui-reactor repo, for example by saying "raise coverage for the layout engine with non-vacuous tests".

Frequently Asked Questions about coverage-uplift

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve test coverage in the microsoft-ui-reactor repo?

Run the tools/coverage PowerShell script to produce a merged Cobertura report, parse it for uncovered lines, classify each gap into unit, selftest, or E2E tier, then add narrowly-scoped tests whose assertions fail if the target code is deleted.

What makes a test assertion vacuous in code coverage work?

An assertion is vacuous if it still passes when the code under test is deleted, no-op'd, or returns a default value, such as bare non-null checks or no-throw assertions on void methods. Non-vacuous alternatives include differential isolation, throw-position oracles, and corrupt-then-recompute checks.

Can headless unit tests construct WinUI controls?

No. Headless unit tests cannot construct any Microsoft.UI.Xaml object, including controls, brushes, geometries, or AutomationPeer-derived types, because doing so throws a COMException. Such targets must be tested as selftest fixtures or dropped with a documented reason.

Why does dotnet test report zero tests ran with MSBuild switches?

dotnet test does not accept MSBuild switches like -m:1 or -nodereuse:false, so the test host exits before running anything and reports zero tests, which reads as green. Keep those switches on the dotnet build line only and run tests via a separate dotnet test --no-build command.

When should I use a selftest fixture instead of a unit test?

Use a selftest fixture whenever the target touches a live WinUI control, reconciliation, or mounting, since those require a running app host. Reserve E2E fixtures for real keyboard, pointer, focus routing, or UIA scenarios that need an interactive desktop.