remove-tautological-tests

Detect and rewrite tautological tests that mirror implementation code without catching defects.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/brandhaug/skills --skill remove-tautological-tests-brandhaug
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: remove-tautological-tests
Source: https://github.com/brandhaug/skills/tree/main/remove-tautological-tests
Command: npx skills add https://github.com/brandhaug/skills --skill remove-tautological-tests-brandhaug

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test suites accumulate change-detector tests that mirror the code under test, break on any behavior-preserving refactor, and catch no real defects. This Skill identifies those tautological tests and guides you to rewrite them against real behavioral contracts or delete them safely. ## Core Features & Use Cases - Litmus Test for New Tests: Apply a three-question check (derivative, refactor-fragile, no oracle) before keeping any newly written test. - Pattern Checklist for Sweeps: Systematically scan existing tests for seven anti-patterns including checksum assertions, echo assertions, duplicate-algorithm tests, snapshots without an oracle, and mock-theater call-graph transcription. - Rewrite-or-Delete Decision Framework: For each flagged test, find the contract it should protect, then rewrite assertions against observable behavior or delete tests with no contract while preserving coverage of critical logic. - Use Case: After a behavior-preserving refactor breaks dozens of tests, run a sweep over the affected test files to separate genuine regression signals from change-detector noise, then rewrite or delete the offenders. ## Quick Start Review the tests in src/services and flag any tautological tests that just mirror the implementation, then rewrite or delete them.

Frequently Asked Questions about remove-tautological-tests

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

FAQPage Schema
How do I find tautological tests in my test suite?▼

Apply the three-question litmus test to each test: could a correct and incorrect implementation both pass it, would it fail on a behavior-preserving refactor, and does its expected value come from the code under test itself. One strong signal is enough to flag it.

What is a change-detector test?▼

A change-detector test is a transformation of the same information as the code under test, so it breaks on any change including behavior-preserving refactors while passing correct and incorrect implementations equally. The term comes from Google Testing on the Toilet's 2015 article on the topic.

Should I delete snapshot tests that have no oracle?▼

Delete snapshots recorded from whatever the code currently produces unless you can hand-derive expected values from requirements. Replace lost coverage with higher-level tests through the public seam that carry the actual logic.

When is mock verification acceptable in unit tests?▼

Interaction verification is acceptable only when the interaction itself is the contract, such as an email sent, event published, or API called with a payload. Assert on what crossed the boundary, never on sequencing between internal collaborators.

What should I do when deleting a test removes coverage of critical logic?▼

Land the replacement coverage in the same change, never leave a gap. Test the collaborator that actually holds the logic, or add one integration test through the public seam to cover the behavior.