test-removal-criteria
БесплатноБез исполняемых скриптовНе проверенUse when a suite has outgrown its value and someone is about to delete tests. Sorts candidates into duplicate, tautology, trivial, dead-signal and orphan, and…
от testland★ 18 звёзд на GitHubОб этом скилле
test-removal-criteria
The axis: removal, not selection
Two questions about a large test suite get confused, and they have very different risk profiles:
| Question | What it decides | Effect of a wrong answer |
|---|---|---|
| Which tests run on this change? | A per-change subset of an unchanged suite. | Recoverable: the skipped test still exists and runs on the next full pass. |
| Which tests should stop existing? | The contents of the suite itself. | Not recoverable in practice: the behavior stops being asserted, and nothing in CI announces the loss. |
This skill owns the second question only. Anything about narrowing a single run (impacted-set computation, previously-failing sets, fallback triggers, nightly safety runs) belongs to per-change selection and is deliberately out of scope here.
The asymmetry is the whole reason this skill is written conservatively. Meszaros names the end state of a bad removal a Lost Test, whose symptom is that "the number of tests being executed in a test suite has dropped (or has not increased as much as expected)", and lists it as a direct cause of Production Bugs: untested code has "no automated tests to tell the developer when they have introduced a problem" (Meszaros, Production Bugs). A deleted test and a disabled test produce the same silence.
How to use
- Classify each candidate into exactly one removal class -
duplicate,tautology,trivial,dead-signal, ororphan(Step 1); anything that fits no class is not a candidate. - Apply that class's test to confirm the classification (Step 2), honouring the never-remove list.
- Run the four-condition delete gate; any failed or missing-input condition
reverts the verdict to
keep(Step 3). - Choose the action -
keep,rewrite,fold, orremove(Step 4). - Record the pass as a ledger plus a kept table, packaged by confidence - templates and the confidence-to-action rules are in references/removal-ledger-and-report-format.md (Step 5).
The burden of proof sits on removal
Five rules govern every decision below. They are not advisory.
- Keep is the default verdict. A test stays unless a removal case is affirmatively made. "No case was made either way" resolves to keep, never to delete.
- Every removal carries a stated reason and a named reviewer. The reason names the removal class and the evidence; the reviewer is a person, not a team alias, who signed off on that specific row. A removal without both is not eligible to ship. (Practitioner convention, not a standard: teams that skip the named-reviewer column end up with rubber-stamped bulk deletes.)
- "It never fails" is not evidence a test is worthless. A test that has passed for years while its subject churned may be the load-bearing guard that is passing because the code is still correct. Absence of failure is absence of evidence, in both directions.
- Coverage-tool output alone is not grounds for removal. Coverage finds untested code; it does not measure test quality. Per Fowler, "if you make a certain level of coverage a target, people will try to attain it. The trouble is that high coverage numbers are too easy to reach with low quality testing" (Fowler, TestCoverage). A redundant-coverage number is one input to the delete gate below, never the whole case.
- Never remove a test to make a signal go away. Meszaros is explicit about the temptation with an intermittently failing test: "we may be tempted to remove the failing test from the suite to 'Keep the Bar Green' but this would result in an (intentional) Lost Test" (Meszaros, Erratic Test). Flakiness is a diagnosis problem, not a removal class. Quarantine and fix.
Step 1 - Classify the candidate into one removal class
Each candidate gets exactly one class. If two fit, take the more conservative one (the one lower in this table).
| Class | Signal that puts a test in this class | Default action |
|---|---|---|
duplicate |
Two tests with the same normalized setup and the same normalized assertion arguments. | Keep one, remove the other. |
trivial |
The body has no assertion at all, or its only assertion is self-satisfying (expect(true).toBe(true), expect(1).toBe(1), expect(undefined).toBe(undefined)). |
Remove. |
orphan |
The test imports a module or calls a function that no longer exists. | Remove, and name the missing module in the change description. |
tautology |
The expected side of the assertion recomputes the behavior under test. | Rewrite to a known-good literal. Remove only if the rewrite has no value left. |
dead-signal |
Zero failures |
Установить test-removal-criteria в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл test-removal-criteria?
Use when a suite has outgrown its value and someone is about to delete tests. Sorts candidates into duplicate, tautology, trivial, dead-signal and orphan, and deletes only when all four gate conditions hold, with a written reason, coverage evidence and a named reviewer.
Как установить скилл test-removal-criteria?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-removal-criteria запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic