find-untested-sources

Identify source files lacking test coverage via static Roslyn or tree-sitter parsing.

5.3k|403|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/dotnet/skills --skill find-untested-sources
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: find-untested-sources
Source: https://github.com/dotnet/skills/tree/main/plugins/dotnet-test/skills/find-untested-sources
Command: npx skills add https://github.com/dotnet/skills --skill find-untested-sources

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Microsoft.CodeAnalysis.CSharp, tree-sitter-language-pack, and includes scripts (resource) components.

What problem does it solve?

Before writing new tests, developers need to know which source files have no corresponding test file. Coverage tools require a green build and a full test run, which can take minutes; this Skill answers the question statically in seconds by parsing source code without compilation, producing a deterministic source-to-test pairing map.

Core Features & Use Cases

  • Dual analysis engines: A Roslyn-based C# analyzer with strict namespace disambiguation for .NET-only repos, and a tree-sitter polyglot analyzer supporting Python, TypeScript/JavaScript, Go, Java, Rust, C#, and Ruby.
  • Structured JSON output: Reports untested sources ordered by declaration count, suggested test file paths, source-to-test pairings, and orphan test files.
  • Use Case: Before invoking a test-generation agent on a large repository, run the analyzer to get a prioritized worklist of untested source files with suggested test locations, then verify newly written tests pair correctly.

Quick Start

Ask the agent to find which source files in this repository have no corresponding tests and suggest where new test files should go.

Frequently Asked Questions about find-untested-sources

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

FAQPage Schema
How do I find source files without tests in a repository?

Run the analyzer script against the repository root: dotnet run scripts/Find-UntestedSources.cs for C# repos, or python scripts/find_untested_sources.py for polyglot repos. Both emit JSON listing untested sources ordered by declaration count with suggested test paths.

Roslyn vs tree-sitter for finding untested code, which should I use?

Use the Roslyn engine for .NET-only repositories because its namespace-aware disambiguation is more accurate on duplicated short names like Settings or Context. Use the tree-sitter engine when the repo contains Python, TypeScript, Go, Java, Rust, or Ruby alongside or instead of C#.

Does static test pairing replace code coverage analysis?

No. Static pairing only answers whether a test file references a source file's declared types; it provides no line, branch, or Cobertura coverage data. For real coverage metrics, CRAP scores, or test prioritization, run an actual coverage tool on the triaged candidates.

What languages does the tree-sitter untested-source analyzer support?

The polyglot analyzer supports Python, TypeScript, TSX, JavaScript, Go, Java, Rust, C#, and Ruby. It requires Python 3.10+ and the tree-sitter-language-pack package, which bundles parsers for all supported languages in a single wheel.

Why does the analyzer miss some tested source files?

Types resolved only through reflection, dependency injection strings, or extension methods invoked as instance methods never appear by name in test source, so no pairing is detected. Short identifiers under four characters are also dropped in the polyglot engine to avoid noisy matches.