Langsung ke konten
Skillpedia
Testing5.8k Β· #14629

find-untested-sources

Fungsinya

Skill ini menemukan file sumber yang tidak dirujuk file pengujian mana pun, dengan pemindaian cepat terhadap kode alih-alih build penuh. Skill ini untuk pengembang yang memutuskan apa yang akan diuji berikutnya di basis kode dengan banyak file.

Kapan dipakai

  • βœ“Saat Anda ingin daftar file sumber yang belum punya pengujian sebelum menulis yang baru.
  • βœ“Saat Anda ingin tahu di mana file pengujian baru sebaiknya diletakkan dalam struktur repositori.
  • βœ“Saat basis kode besar membutuhkan peta cepat tentang file mana yang tercakup pengujian.

Link skill

https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/find-untested-sources/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/find-untested-sources/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œFile sumber C# saya yang mana yang belum punya pengujian? Sarankan di mana file pengujinya sebaiknya diletakkan.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mengurai file sumber tanpa membuildnya, mencocokkan tipe yang dideklarasikan dengan file pengujian, lalu mendaftar sumber yang belum diuji beserta saran lokasi pengujian.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Find Untested Sources

Purpose

Coverage tools answer "which lines were executed?" β€” they require a green build and a passing test run, which is minutes-to-tens-of-minutes on a real repo. The question this skill answers is different and much cheaper:

Which source files have no test file referencing any of their declared types/symbols?

That's the question an agent asks before writing a new test β€” and it can be answered statically in a few seconds by parsing source files, with no build, no dependency resolution, and no compilation. The output is a deterministic test-pairing map that lets the agent pick the next file to test without reading the entire codebase first.

Two engines β€” pick one

This skill ships two interchangeable analyzers with a compatible JSON contract:

Engine Script Use when
Roslyn (C#) scripts/Find-UntestedSources.cs The repo is .NET-only. Parses every .cs file with the Roslyn syntax API and does strict namespace disambiguation, so it is materially more accurate on duplicated short names like Settings or Context.
tree-sitter (polyglot) scripts/find_untested_sources.py The repo is not exclusively C#, or you want one tool across C#, Python, TypeScript/JavaScript, Go, Java, Rust, Ruby, Kotlin, Swift, PowerShell, and C++.

For a .NET-only repository, prefer the Roslyn engine β€” its namespace-aware pairing beats the polyglot engine's identifier overlap.

Required workflow

  1. Use the narrowest repository or package root named by the caller. Do not scan a parent workspace when the request identifies a subdirectory.
  2. Execute the appropriate analyzer once. Do not replace analyzer execution with manual globbing, filename matching, or visual inspection. For polyglot analysis, pass --include-tested when the answer must distinguish paired sources from unpaired sources. "Static pairing only" prohibits compiling the target repository and running its tests; it does not prohibit launching this skill's parse-only analyzer. State that distinction briefly when the caller also says "do not build." Treat analyzer dependencies as environment prerequisites: do not install packages, try the wrong engine, build the repository, or fall back to a manual scan when an analyzer invocation fails. Report the prerequisite failure instead.
  3. Base the result on the analyzer's JSON. Preserve its paired/unpaired classification and suggested relative path; do not guess a different path.
  4. When the caller named a subdirectory, prefix analyzer-relative paths with that subdirectory so reported paths are workspace-relative.
  5. Report the requested result plus the static-pairing coverage caveat. Do not append build, package-install, test-run, or coverage commands. When paired sources exist, name their covering test files so the unpaired classification is auditable.

When to Use

  • User asks "where should I add tests based on source pairing?", "which files have no tests?", "find unpaired source files", or "give me a static test gap list".
  • Before invoking a test-generation agent, to produce a source-pairing worklist.
  • After generating tests, to verify each new test file pairs to a source file.
  • To enumerate "weakly paired" source files (only one referring test) for follow-up depth checks.

When Not to Use

  • Line/branch coverage β€” use coverage-analysis.
  • Priorities derived from real coverage data β€” use coverage-analysis.
  • CRAP-score / risk hotspots β€” use coverage-analysis.
  • Are existing tests strong? β€” use test-gap-analysis (mutation reasoning) or assertion-quality.

Roslyn engine (C#)

Prerequisites

  • .NET SDK that supports file-based apps (dotnet run script.cs). Pinned in the repo's global.json (SDK 11 preview or later).
  • No internet access required beyond the initial NuGet restore of Microsoft.CodeAnalysis.CSharp on first run.

Usage

# From the skill folder
dotnet run scripts/Find-UntestedSources.cs -- <repo-root> [--top N]

# Save the report
dotnet run scripts/Find-UntestedSources.cs -- <repo-root> > pairing.json

# Iterate the untested list, highest-API-surface first
$report = Get-Content pairing.json | ConvertFrom-Json
$report.untested | Select-Object -First 10 source, decl_count, suggested_test_path

Diagnostics go to stderr; JSON goes to stdout.

Output schema

{
  "repo": 
Pertanyaan umum

Apakah skill ini membutuhkan build atau data cakupan?

Tidak. Ini pemindaian statis yang tidak perlu kompilasi, sehingga cepat.

Apakah skill ini memberi cakupan per baris?

Tidak. Data cakupan baris dan cabang berasal dari alat cakupan, dan skill ini menjawab pertanyaan yang berbeda.

Bahasa apa yang dicakup?

Skill ini menangani C# dengan analyzer khusus, dan juga mencakup Python, TypeScript, JavaScript, Go, Java, dan beberapa bahasa lain.

Detail

Deskripsi asli dari pembuat

MANDATORY for static source-to-test pairing: find or list source files/modules without corresponding tests, or suggest test locations from repository structure. Invoke even for a tiny package; do not substitute manual globbing. Uses Roslyn for C#/.NET and tree-sitter for Python, TS/JS, Go, Java, Rust, Ruby, Kotlin, Swift, PowerShell, and C++. DO NOT USE FOR: real line/branch/Cobertura data, coverage-backed test priorities, CRAP risk, or grading existing tests.

repo: dotnet/skills

Popularitas

Bintang GitHub
5.8k
Peringkat
#14629
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa