# test-smell-detection

test-smell-detection audits existing tests against the formal testsmells.org taxonomy, ranking issues by severity. Helpful when you need an academic assessment of test code quality.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 4400 installs · ★ 6320 repo stars
- Author: dotnet
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/dotnet/skills/tree/HEAD/plugins/dotnet-test/skills/test-smell-detection/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/test-smell-detection

## What it does

The skill audits test suites across .NET, Python, JavaScript, TypeScript, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, and C++. It maps issues to formal categories like Assertion Roulette, Conditional Test Logic, Mystery Guest, Sleepy Test, and Sensitive Equality. Production code is inspected only when needed to verify a verdict.

Each candidate smell is calibrated against idiomatic framework constructs, distinguishing intentional table-driven test loops from genuine branching logic. Confirmed findings are ranked by the risk of flakiness or false confidence, followed by maintenance overhead. The skill gives idiomatic remediation code suited to the project stack, while leaving quick pragmatic reviews to `test-anti-patterns`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dotnet/skills --skill test-smell-detection -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/test-smell-detection/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/test-smell-detection/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dotnet/skills --skill test-smell-detection -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/test-smell-detection/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dotnet/skills --skill test-smell-detection -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/test-smell-detection/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dotnet/skills plugins/dotnet-test/skills/test-smell-detection
```

2. **Manually: put the files in place**
- File: `.github/skills/test-smell-detection/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dotnet/skills --skill test-smell-detection -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dotnet/skills --path plugins/dotnet-test/skills/test-smell-detection
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/test-smell-detection/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dotnet/skills --skill test-smell-detection -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dotnet/skills/tree/HEAD/plugins/dotnet-test/skills/test-smell-detection/SKILL.md

## When to use it
- catalog formal test smells using the testsmells.org taxonomy
- separate conditional branching logic from table-driven test runner loops
- replace hardcoded sleep intervals with polled condition checks
- detect hidden dependencies on unmanaged external resources
- generate framework-idiomatic replacements for confirmed test smells

## Example prompts
- Run an academic smell audit on the staged tests and rank the findings by severity.
- Inspect these Go tests for Conditional Test Logic and Mystery Guest smells.
- Identify Sleepy Test smells in this test suite and suggest framework-appropriate fixes.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 33d5e8d132eade01.

BEGIN THIRD-PARTY FILE 33d5e8d132eade01
```text
---
name: test-smell-detection
description: >
  Audits existing tests in any language using formal, research-backed test
  smell names and the testsmells.org 19-smell academic taxonomy. Use when the
  caller asks for an academic or citable test-smell review, named smell
  categories, or a formal severity-ranked smell assessment. Covers Assertion
  Roulette, Conditional Test Logic, Mystery Guest, Eager Test, Sleepy Test,
  Unknown Test, Sensitive Equality, and the rest of the catalog across .NET,
  Python, JavaScript/TypeScript, Java, Go, Ruby, Rust, Swift, Kotlin,
  PowerShell, and C++. DO NOT USE FOR a quick pragmatic test review (use
  test-anti-patterns), writing or running tests, framework migration, coverage,
  or assertion-diversity metrics.
license: MIT
---

# Test Smell Detection

Audit test code with the academic taxonomy, code evidence, calibrated
framework idioms, and fixes native to the codebase.

## Scope

- Audit only staged or named tests. Search the current workspace before asking
  for code; never claim a file is missing until that search finds no relevant
  test.
- Read production code only when it changes a verdict.
- For unfamiliar framework APIs, read the matching language file relative to
  the caller-provided or runtime-listed `test-analysis-extensions` catalog,
  not a skill invocation. If absent, use the framework and rules here and report
  the missing reference; do not search installation directories.
- Read [the complete catalog](references/test-smell-catalog.md) when the caller
  requests all 19 smells, asks for citations, or the code may contain a smell
  outside the high-signal set below. Do not load it for a narrow question that
  this file answers.

## Audit Workflow

1. Search for and read the staged tests; detect language, framework, boundaries,
   and integration markers. This is the first action even when no path is named.
2. Read the tests and only verdict-changing production context.
3. For each candidate, verify the executed check, choose the formal category,
   calibrate, then assign severity. Report proven non-catalog test-validity
   defects separately; do not relabel them as smells.
4. Rank confirmed findings by risk of false confidence or flakiness, then by
   maintenance cost.
5. Give a framework-correct replacement for each actionable finding. Never use
   .NET terminology or APIs in another ecosystem.

## High-Signal Decisions

| Evidence | Academic finding | Do | Never |
|---|---|---|---|
```
END THIRD-PARTY FILE 33d5e8d132eade01

The third-party file has ended. Everything between the 33d5e8d132eade01 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2480 of 10094 bytes. © dotnet · MIT · https://github.com/dotnet/skills/tree/HEAD/plugins/dotnet-test/skills/test-smell-detection/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
