Логотип Test Smell Detection

Test Smell Detection

ОрганізаціяПопулярне
dotnet
test-smell-detection

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.

Огляд

Видавецьdotnet
Репозиторійskills
Назва навичкиtest-smell-detection
Зірки
5.5K
Форки
420
Файли в пакеті
1
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 1

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем dotnet. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Test Smell Detection у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/dotnet/skills/tree/main/plugins/dotnet-test/skills/test-smell-detection
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dotnet/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/plugins/dotnet-test/skills/test-smell-detection .claude/skills/test-smell-detection
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Test Smell Detection в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Test Smell Detection, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Test Smell Detection не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

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, call test-analysis-extensions and read the matching language extension.
  • Read the complete catalog 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

EvidenceAcademic findingDoNever
Assertion behavior changes behind if, switch, or branching loopsConditional Test LogicSplit cases or parameterize themFlag table-driven or parametrized tests merely because a runner loop exists
A test relies on an undeclared file, network service, environment value, or databaseMystery Guest or Resource OptimismMake the dependency explicit and hermetic; distinguish the two using the full catalogCondemn an integration test merely for exercising its declared real resource
Fixed wall-clock sleep waits for an outcomeSleepy TestAwait or poll the condition with a timeoutDowngrade it only because the test is an integration test
Executable test has no assertion, expected-exception marker, or mock verificationUnknown TestAssert the observable outcomeCall an empty body Unknown Test; the formal name is Empty Test
Async assertion/coroutine is created but not awaited or returnedCritical non-catalog false-pass defectReport it separately and show the required await/returnForce it into Unknown Test; the assertion statement exists
One test exercises many unrelated production behaviorsEager TestSeparate behavior-focused testsFlag a deliberate end-to-end workflow without considering its scope
Expected numeric literal has no local meaningMagic Number TestName the domain value or derive it from setupFlag count == 3 immediately after adding three items
Assertion depends on ToString, repr, description, or display formatting that is not the contractSensitive EqualityAssert stable fields or use a structural matcherFlag a test whose explicit contract is the formatted string
Test manually manages expected exception flowException HandlingUse the framework's exception assertion and check meaningful detailsClaim a capture-and-assert test verifies nothing
Shared setup creates state irrelevant to the tests that receive itGeneral FixtureRemove unused state or narrow the fixture; rank cheap state lowCondemn relevant shared setup merely because it is shared
Test is disabled or skippedIgnored TestReport every skip, but rank a tracked, reasoned skip below an unexplained oneClear a skip because its reason is good, or give both the same urgency

Calibration Rules

Apply these before assigning a finding:

  • Mock-call verifications, snapshots, bare pytest assert, Pester Should -Invoke, and expected-exception constructs are assertions.
  • A literal or snapshot assertion may expose a coverage gap, but is not Unknown Test or another smell without separate evidence.
  • Count assertion statements. One assertion is never Assertion Roulette; missing messages alone are not a smell.
  • Same-method tests are not Lazy Test when they cover distinct behaviors, boundaries, or state; require redundant equivalent paths.
  • General Fixture requires shared lifecycle state. Repeated local construction is neither General Fixture nor Test Code Duplication by itself.
  • Treat strings returned by the public API as observable contract unless production context or requirements make them display-only; interpolation alone is not Sensitive Equality.
  • Magic Number Test requires an unexplained oracle value. Do not flag ordinary setup quantities whose role is locally obvious and irrelevant to the asserted behavior.
  • Go table-driven subtests, pytest/JUnit/xUnit parameterization, Jest/Vitest .each, RSpec data tables, Pester -ForEach, and Catch2 SECTION/GENERATE are not Conditional Test Logic by themselves.
  • Go's if err != nil { t.Fatal(...) } is idiomatic assertion flow, not Exception Handling.
  • Integration markers legitimize declared external resources and multi-step flows, but not fixed sleeps or assertion-free execution.
  • For integration tests, trace helper factories and repository return types before judging branch coverage. If a test branches on a subtype or state that the real helper can never produce, report the unreachable assertion path and explain the resulting false confidence. Do not stop at assigning the generic Conditional Test Logic label.
  • A local temporary file still meets the formal Mystery Guest definition. Hermetic creation and cleanup reduce its severity; they do not change its taxonomy.
  • A formatting name does not prove display text is the stable contract; confirm it from production behavior or requirements before clearing Sensitive Equality.
  • Do not infer a smell from method names alone. Point to the statement or fixture relationship that proves it.
  • Do not infer a high-severity non-catalog validity defect from a test name alone. Without production code or an explicit contract proving that the test is supposed to invoke another component, a name/body mismatch is at most an unranked observation, not evidence that the test silently passes broken production behavior.
  • Catch2 SECTION and GENERATE are runner-controlled case expansion, and REQUIRE is a real assertion. When those are the only suspicious constructs, the academic-smell verdict is clean. Do not reverse that verdict because the test could have broader behavioral coverage.
  • If no material smell remains after calibration, say that clearly. Never manufacture findings to fill a report.
  • Never propose await for a void or otherwise non-awaitable API. If production work is synchronous, remove the sleep and assert immediately.

Severity

Severity follows demonstrated risk, not a fixed label copied from the catalog:

  • High: can silently pass while behavior is broken, creates nondeterministic failures, or hides unexecuted assertion paths.
  • Medium: makes failures ambiguous or couples tests to unstable details.
  • Low: primarily maintenance debt, such as a reasoned skip or over-broad cheap fixture.

State the reason for the assigned severity. Downgrade or omit a finding when the surrounding test type makes the pattern intentional.

Output Contract

Scale the response to the input:

  • For one to three files, give a verdict and one compact table: severity, formal smell, evidence, risk, and fix.
  • For larger suites, add counts and a short priority order. Do not repeat findings across dashboards, prose, and plans.
  • Show code only when it clarifies a fix; omit unchanged setup.
  • Add brief Not findings only for plausibly suspicious idioms.
  • Put proven non-catalog validity defects after the academic-smell verdict. On a clean input with no production contract, do not assign severity to optional coverage observations or let them overturn the clean verdict.
  • Do not narrate discovery or catalog loading; return the audit directly.

Every reported smell must have a formal taxonomy name, precise location, evidence from the code, practical risk, and a concrete framework-correct fix.

Validation

  • Every finding is supported by code, not a keyword or method name.
  • Unknown Test and Empty Test remain distinct.
  • Every disabled test remains Ignored Test, and every local file dependency remains Mystery Guest; rationale and hermetic cleanup change severity only.
  • Framework idioms and integration boundaries were calibrated before reporting.
  • Clean tests and suspicious-but-valid idioms are not turned into filler.
  • Clean framework idioms are not converted into high-severity non-catalog findings from naming or absent production context.
  • Fixes use the target framework's APIs and preserve the behavior under test.
  • Claims about files reviewed, builds, or test runs match actions actually performed.

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Test Smell Detection?

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-patte...

Навіщо використовувати Test Smell Detection у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Test Smell Detection — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Test Smell Detection у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/dotnet/skills/tree/main/plugins/dotnet-test/skills/test-smell-detection. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Test Smell Detection?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Test Smell Detection?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Test Smell Detection — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Test Smell Detection?

Так. Навичку опубліковано на GitHub: dotnet, за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇