exp-test-maintainability
能自动定位并给出前后对比的改造建议,适合大型测试套件整洁化。
分析 .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).
帮我安装这个 skill:https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-experimental/skills/exp-test-maintainability/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-experimental/skills/exp-test-maintainability/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