Universal testing test quality inspector

From bobmatnyc/claude-mpm · View interactive version

Universal testing test quality inspector is an AI agent skill from the GitHub repository bobmatnyc/claude-mpm. Verify that a test is actually testing what it claims to test: semantic correctness, mutation-style reasoning, and mock hygiene for any language or framework

How to use this skill

Skill file

Test Quality Inspector

Overview

A passing test is not the same as a good test. This skill inspects tests for semantic correctness — whether the test actually verifies the behavior it claims to verify, not just whether it runs without error.

Apply this skill to any test file or suite, in any language or framework.

When to Use

Activate when:

Arguments

This skill accepts optional arguments:

Five-Step Inspection Process

Step 1: Read the Test

Read the test file completely. Identify:

Step 2: Read the Implementation

Find and read the actual code being tested. Identify:

Step 3: Apply the Five Checks

Run all five checks. See checks.md for detailed guidance.

Check 1 — Name-to-Assertion Alignment

Does the test name describe what the assertions actually verify? A test named test_returns_empty_list_when_no_results that only asserts len(result) == 0 without checking the type is subtly misleading.

Check 2 — Meaningful Assertions (No Tautologies)

Would the assertion pass even if the implementation returned garbage? Examples of hollow assertions:

Check 3 — Mutation Failure Check

If the implementation were deliberately broken in the most obvious way (wrong return value, off-by-one, missing branch), would this test catch it? Mentally apply one mutation at a time and ask: does the test fail?

Check 4 — Edge Case Coverage

If the test name references edge cases ("when empty", "when None", "at boundary"), verify those conditions are actually set up in the arrange phase and exercised in the act phase.

Check 5 — Mock Hygiene

Are mocks replacing so much real behavior that the test no longer exercises the code under test? Signs of hollow mocking:

Step 4: Produce a Verdict

Issue one of four verdicts with specific evidence. See verdicts.md for verdict criteria and templates.

| Verdict | Meaning |

|---------|---------|

| CORRECT | Test accurately names its behavior, assertions are meaningful, would catch real bugs |

| MISLEADING | Test passes but the name or description does not match what is actually asserted |

| INCOMPLETE | Test covers some of the claimed behavior but misses important assertions or edge cases |

| BROKEN | Test would not catch an obvious bug in the code it claims to test |

Step 5: Suggest Fixes

For any verdict other than CORRECT, provide:

Quick Check Summary

Would this test FAIL if I:
  - Changed the return value to None?        → Check assertions
  - Removed the main branch logic?           → Check coverage
  - Swapped two arguments in the call?       → Check specificity
  - Deleted the function entirely?           → Check mock depth
  - Added a new edge case to the spec?       → Check name accuracy

Red Flags — STOP and Inspect

Stop and apply full inspection when:

Navigation

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.