--- name: test-the-tests description: Checks whether a project's tests would actually catch a broken implementation, using mutation testing, coverage of the claim's code, and a read for tests that assert nothing or test mocks. Use when a claim rests on "all tests pass", or when verifying an agent's or contractor's finished task. --- # Test the tests "All tests pass" says nothing until you know the tests can fail. This skill breaks the code on purpose and checks the tests notice. Part of the Verification Bench (case file: see `verify`). ## Steps 1. **Run the suite as shipped** (in the sandbox) and record the counts: passed, failed, skipped, xfail. Skips and expected failures on the claim's code are findings. 2. **Coverage of the claim's code only.** Overall coverage hides the gap that matters. | Language | Command | |---|---| | Python | `pytest --cov= --cov-report=term-missing` | | Rust | `cargo llvm-cov --text` | | JS/TS | `npx vitest run --coverage` or `npx jest --coverage` | | C | build with `--coverage`, run, `gcovr -r .` | 3. **Mutation testing** on the claim's files. Each surviving mutant is a change to the code that no test noticed. | Language | Command | |---|---| | Python | `mutmut run --paths-to-mutate ` then `mutmut results` | | Rust | `cargo mutants --file ` | | JS/TS | `npx stryker run` (set `mutate` to the claim's files) | | C | `mull-runner` or a hand mutation (below) | 4. **Hand mutation, always.** Replace the claim's core function body with the dumbest thing that type-checks (return the input, return zero, call the baseline) and rerun the suite. If it still passes, the tests don't test the claim. Revert afterwards. 5. **Read the tests** that cover the claim's code, looking for: - assertions that can't fail (`assert result is not None`, `assert True`, comparing an output with itself); - mocks of the very thing being claimed; - expected values computed by the code under test; - tests that catch every exception; - the test inputs matching a cache or fixture (`hardcode-hunt`). ## Entry ```markdown ### test-the-tests · · PASS | FAIL | INCONCLUSIVE - Suite: ; claim's code line coverage: - Mutation: / on ; survivors: - Hand mutation (): suite - Weak tests: ```