test-smell-detection

Detects academic test smells in test code across multiple languages and frameworks.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill test-smell-detection-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-smell-detection
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-test/skills/test-smell-detection
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill test-smell-detection-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Test suites accumulate design flaws like conditional logic, sleeps, missing assertions, and external resource dependencies that make tests fragile, slow, and misleading. This Skill performs a formal audit of test code using the testsmells.org 19-smell academic catalog, producing a severity-ranked report with citable smell names, exact locations, and concrete fixes. ## Core Features & Use Cases - Polyglot smell detection: Analyzes tests in .NET (MSTest/xUnit/NUnit/TUnit), Python (pytest/unittest), JS/TS (Jest/Vitest/Mocha), Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell (Pester), and C++ (GoogleTest/Catch2) using language-specific extension files. - Research-backed taxonomy: Maps every finding to a named smell from the academic literature (Assertion Roulette, Mystery Guest, Sleepy Test, Eager Test, Sensitive Equality, Magic Number Test, and more) with calibrated severity levels. - False-positive calibration: Recognizes idiomatic patterns such as Go table-driven tests, pytest parametrize, mock verifications, and integration-test markers so legitimate patterns are not flagged. - Use Case: Point the Skill at a flaky xUnit test project and receive a dashboard of high/medium/low severity smells, code snippets showing each issue, remediation examples, and a prioritized fix plan. ## Quick Start Audit the tests in my test project directory using the full academic test smell catalog and give me a severity-ranked report with fixes.

Frequently Asked Questions about test-smell-detection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect test smells in my test suite?

Provide your test files or test project directory and request a formal smell audit. The Skill loads the matching language extension, scans each test method against the academic smell catalog, and returns a severity-ranked report with locations, code snippets, and fixes.

What test frameworks are supported for smell detection?

Supported frameworks include MSTest, xUnit, NUnit, TUnit, pytest, unittest, Jest, Vitest, Mocha, JUnit, TestNG, Go testing, RSpec, Minitest, Rust test, Swift Testing, Kotest, Pester, GoogleTest, and Catch2. Language extension files define framework-specific markers.

Does the audit flag Go table-driven tests as conditional logic?

No. Go's for-range table-driven pattern with t.Run, Rust rstest, pytest parametrize, Jest each, and xUnit Theory with InlineData are recognized as idiomatic parametrization and are explicitly excluded from Conditional Test Logic findings.

When should I use test-anti-patterns instead of this academic audit?

Use test-anti-patterns for quick pragmatic reviews covering the most common issues. Use this Skill only when you need the formal testsmells.org 19-smell catalog with citable research-backed smell names and severity calibration.

Why are integration tests treated differently in smell detection?

Integration tests legitimately use external resources, call multiple production methods, and may need delays for async coordination. The Skill detects integration markers like Trait attributes or pytest marks and downgrades Mystery Guest, Eager Test, and Sleepy Test severity for those tests.

Can mock verifications count as assertions in a test?

Yes. Mock-call verifications such as Moq Verify, Jest toHaveBeenCalledWith, Mockito verify, and Pester Should -Invoke are treated as real assertions, so tests using them are not flagged as Assertion-Free.