본문으로 건너뛰기
Skillpedia
테스트5.8k · #14629

find-untested-sources

하는 일

이 스킬은 전체 빌드 대신 코드를 빠르게 훑어서, 어떤 테스트 파일도 참조하지 않는 소스 파일을 찾습니다. 파일이 많은 코드베이스에서 다음에 무엇을 테스트할지 정하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓새 테스트를 쓰기 전에 테스트가 없는 소스 파일 목록이 필요할 때.
  • ✓새 테스트 파일을 저장소 구조의 어디에 둘지 알고 싶을 때.
  • ✓큰 코드베이스에서 어떤 파일이 테스트로 덮였는지 빠르게 파악하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/find-untested-sources/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 C# 소스 파일 중 테스트가 아직 없는 것은 무엇인가요? 테스트 파일을 어디에 두면 좋을지도 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 소스 파일을 빌드하지 않고 파싱하고, 선언된 타입을 테스트 파일과 맞춘 뒤, 테스트가 없는 소스를 제안한 테스트 위치와 함께 나열합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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": 
자주 묻는 질문

빌드나 커버리지 데이터가 필요한가요?

아니요. 컴파일하지 않는 정적 검사라서 빠릅니다.

줄 커버리지를 알려 주나요?

아니요. 줄과 분기 커버리지는 커버리지 도구에서 나오며, 이 스킬은 다른 질문에 답합니다.

어떤 언어를 다루나요?

C#은 전용 분석기로 다루고, Python, TypeScript, JavaScript, Go, Java 등 여러 언어도 다룹니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
5.8k
순위
#14629
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬