exp-test-maintainability

仓库创建 2026年2月4日最近提交 18 小时前SkillHot 收录 20 天前
▸ 精选理由

能自动定位并给出前后对比的改造建议,适合大型测试套件整洁化。

这个 Skill 做什么

分析 .NET 测试代码中的复制粘贴、模板化重叠与可维护性问题并给出重构建议。

检查 .NET 测试套件里重复的 boilerplate、复制粘贴的测试和结构性维护问题,并给出明确的前后重构建议。在想减少重复、把重复测试改成参数化(DataRow/Theory/TestCase)、或优化 setup/teardown 时用。支持 MSTest、xUnit、NUnit、TUnit,只做分析并提出可执行的重构方案,不直接改代码。

▸ 展开 SKILL.md 英文原文

Detects duplicate boilerplate, copy-paste tests, and structural maintainability issues across .NET test suites. Use when the user asks to reduce repetition, consolidate similar test methods, convert copy-paste tests to data-driven parameterized tests, suggest a better test structure, or identify refactoring opportunities. Identifies repeated construction, assertion patterns, copy-paste methods convertible to DataRow/Theory/TestCase, redundant setup/teardown, and shared infrastructure. Produces an analysis report with concrete before/after suggestions. Works with MSTest, xUnit, NUnit, and TUnit. DO NOT USE FOR: writing new tests (use writing-mstest-tests), reviewing test quality or anti-patterns (use test-anti-patterns), or deep mock auditing (use exp-mock-usage-analysis).

开发编程测试重构可维护性.NET通用
4.8k
Stars
351
Forks
40
仓库内 Skill
+610
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-experimental/skills/exp-test-maintainability/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-experimental/skills/exp-test-maintainability/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Test Maintainability Assessment

Analyze .NET test code for maintainability issues: duplicated boilerplate, copy-paste test methods, and structural repetition across test methods and classes. Produce a report of refactoring opportunities with concrete before/after suggestions. The goal is analysis only — do not modify any files.

## When to Use

- User asks to find duplicated code or boilerplate in tests
- User wants to know where test code can be DRY-ed up
- User asks to reduce test duplication, improve test readability, or clean up test boilerplate
- User asks for refactoring opportunities in a test suite
- User wants to identify shared setup or teardown candidates
- User asks "what patt
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有