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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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
- Use the narrowest repository or package root named by the caller. Do not scan a parent workspace when the request identifies a subdirectory.
- Execute the appropriate analyzer once. Do not replace analyzer execution with
manual globbing, filename matching, or visual inspection.
For polyglot analysis, pass
--include-testedwhen 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. - Base the result on the analyzer's JSON. Preserve its paired/unpaired classification and suggested relative path; do not guess a different path.
- When the caller named a subdirectory, prefix analyzer-relative paths with that subdirectory so reported paths are workspace-relative.
- 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) orassertion-quality.
Roslyn engine (C#)
Prerequisites
- .NET SDK that supports file-based apps (
dotnet run script.cs). Pinned in the repo'sglobal.json(SDK 11 preview or later). - No internet access required beyond the initial NuGet restore of
Microsoft.CodeAnalysis.CSharpon 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.
댓글
- …
이 저장소의 다른 스킬
create-custom-agent
5.8k에이전트가 자체 도구, 지침, 다른 에이전트로의 핸드오프를 가진 VS Code 커스텀 에이전트 파일을 만들도록 돕습니다.
create-skill
5.8k에이전트가 올바른 이름, 명확한 트리거 설명, 표준을 따르는 SKILL.md 파일로 새 에이전트 스킬을 만들도록 돕습니다.
csharp-scripts
5.8k에이전트가 .NET 명령줄 도구로 작은 C# 프로그램을 전체 프로젝트 없이 단일 파일로 실행하도록 돕습니다.
dotnet-pinvoke
5.8k에이전트가 .NET에서 네이티브 C나 C++ 라이브러리를 올바르게 호출하도록 돕습니다. 시그니처, 문자열 처리, 메모리, 안전 핸들을 다룹니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.