Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions plugins/dotnet-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ Skills and agents for running, generating, analyzing, migrating, and improving .

| Skill | Description |
|---|---|
| **test-anti-patterns** | Quick pragmatic scan for ~15 common test quality issues with severity ranking |
| **test-smell-detection** | Deep formal audit using academic test smell taxonomy (19 smell types) |
| **test-anti-patterns** | Comprehensive audit of existing tests for anti-patterns and smells (severity-ranked findings with concrete fixes; includes the testsmells.org-based formal smell catalog as an internal reference) |
| **assertion-quality** | Measure assertion variety and depth — find shallow tests that barely verify anything |
| **test-gap-analysis** | Pseudo-mutation analysis to find test blind spots that coverage numbers miss |
| **test-tagging** | Tag tests with standardized traits (smoke, regression, boundary, critical-path, etc.) |
Expand Down
14 changes: 6 additions & 8 deletions plugins/dotnet-test/agents/test-quality-auditor.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ Classify the user's request and route to the appropriate skill:
| User Intent | Route To | Plugin |
|---|---|---|
| "Are my assertions good enough?" / shallow testing / assertion diversity | `assertion-quality` skill | dotnet-test |
| "Find test smells" / comprehensive formal audit | `test-smell-detection` skill | dotnet-test |
| "Pragmatic anti-pattern check" within a broader audit context | `test-anti-patterns` skill | dotnet-test |
| "Find test smells" / "audit my tests" / comprehensive test audit | `test-anti-patterns` skill (includes the testsmells.org-based formal smell catalog) | dotnet-test |
| "Find test duplication" / boilerplate / DRY up tests | `exp-test-maintainability` skill | dotnet-experimental |
| "Are my mocks needed?" / over-mocking / mock audit | `exp-mock-usage-analysis` skill | dotnet-experimental |
| "Would my tests catch bugs?" / mutation analysis / test gaps | `test-gap-analysis` skill | dotnet-test |
Expand All @@ -78,8 +77,8 @@ When the user asks for a broad quality assessment (e.g., "audit my test suite",

Run these in order. Each step builds context for the next. Stop early if the user's scope is narrow or the codebase is small.

1. **Anti-patterns** — `test-anti-patterns` skill
- Quick pragmatic scan for the most impactful issues
1. **Anti-patterns and smells** — `test-anti-patterns` skill
- Comprehensive scan for the most impactful issues (anti-patterns + smell catalog)
- Produces severity-ranked findings (Critical → Low)

2. **Assertion quality** — `assertion-quality` skill
Expand All @@ -96,10 +95,9 @@ Run these in order. Each step builds context for the next. Stop early if the use

### Optional follow-ups (offer but don't run automatically)

5. **Test smells** — `test-smell-detection` skill (if step 1 found many issues and the user wants a deeper formal audit)
6. **Maintainability** — `exp-test-maintainability` skill (if the test suite is large and duplication is suspected)
7. **Mock audit** — `exp-mock-usage-analysis` skill (if over-mocking was flagged in step 1)
8. **Test tagging** — `test-tagging` skill (if the user wants to understand test type distribution)
5. **Maintainability** — `exp-test-maintainability` skill (if the test suite is large and duplication is suspected)
6. **Mock audit** — `exp-mock-usage-analysis` skill (if over-mocking was flagged in step 1)
7. **Test tagging** — `test-tagging` skill (if the user wants to understand test type distribution)

### Synthesizing results

Expand Down
34 changes: 21 additions & 13 deletions plugins/dotnet-test/skills/test-anti-patterns/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
---
name: test-anti-patterns
description: >
Detection-focused review of .NET test code for anti-patterns that
undermine reliability and diagnostic value.
USE FOR: audit test quality, review test code, find test anti-patterns,
tests pass but don't verify anything, flaky tests, ordering dependency,
duplicate tests, magic values, missing/no assertions, swallowed
exceptions, always-true assertions, over-mocking, test coupling, coverage
touching, coverage inflation.
DO NOT USE FOR: writing new tests (use writing-mstest-tests), direct
MSTest API rewrites or implementation-only fixes such as swapped
Assert.AreEqual argument order, running tests (use run-tests), migrating
between frameworks (use migration skills), deep formal audit based on
academic test smell taxonomy (use test-smell-detection).
Audits existing .NET test code (MSTest, xUnit, NUnit, TUnit) for
anti-patterns and smells that undermine reliability and diagnostic
value — produces a severity-ranked report (Critical / Warning / Info)
with concrete code-level fixes and acknowledgement of what the tests
do well. Includes the testsmells.org 19-smell academic catalog as a
reference.
INVOKE THIS SKILL when the user asks to audit, review, rank, or find
problems in existing tests — including: "audit my tests", "audit for
.NET test anti-patterns", "test smell audit", "formal smell audit",
"rank by severity", "are these tests good", no/missing assertions,
swallowed exceptions, always-true / self-comparing / self-referential
assertions, broad exception types, flakiness (Thread.Sleep,
DateTime.Now), ordering dependency, shared static state, reflection
coupling, duplicated tests, magic values, coverage touching.
DO NOT USE FOR: writing new tests (use writing-mstest-tests); running
tests (use run-tests); framework migration (use migration skills).
license: MIT
---

Expand All @@ -37,7 +41,7 @@ Quick, pragmatic analysis of .NET test code for anti-patterns and quality issues
- User wants to run or execute tests (use `run-tests`)
- User wants to migrate between test frameworks or versions (use migration skills)
- User wants to measure code coverage (out of scope)
- User wants a deep formal test smell audit with academic taxonomy and extended catalog (use `test-smell-detection`)
- User wants raw academic-only smell catalog research data without an audit context (this skill includes a smell catalog reference, but is audit-focused — not a literature export)

## Inputs

Expand Down Expand Up @@ -153,3 +157,7 @@ If there are many findings, recommend which to fix first:
| Rating cosmetic issues as Medium | Naming mismatches (e.g., method name says `ArgumentException` but asserts `ArgumentOutOfRangeException`) are Low, not Medium -- the test still works correctly. |
| Ignoring the test framework | xUnit uses `[Fact]`/`[Theory]`, NUnit uses `[Test]`/`[TestCase]`, MSTest uses `[TestMethod]`/`[DataRow]` -- use correct terminology |
| Missing the forest for the trees | If 80% of tests have no assertions, lead with that systemic issue rather than listing every instance |

## References

For deeper smell audits using the academic testsmells.org research taxonomy (Assertion Roulette, Duplicate Assert, Constructor Initialization, Default Test, Lazy Test, Redundant Print, Resource Optimism, Empty Test, and others not covered in the catalogs above), see [`references/test-smell-catalog.md`](references/test-smell-catalog.md). Use it when the user explicitly asks for the formal/research-backed 19-smell catalog or when the standard catalogs above leave a gap.
198 changes: 0 additions & 198 deletions plugins/dotnet-test/skills/test-smell-detection/SKILL.md

This file was deleted.

Loading
Loading