Critically review and refine tests generated during a coding session. Use this skill when the user asks to review tests, clean up tests, refine tests, prune tests, improve test quality, or remove useless/low-value tests. Also use when the user says 'review my tests', 'clean up tests', or mentions test quality after a coding session.
89
87%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Review all tests generated in the current session and eliminate low-value ones while strengthening the rest. The goal is a lean, high-confidence test suite — not maximum test count.
Look at the git diff or recent file changes to find all test files created or modified in this session. Read each one fully before making judgments.
Remove tests that fall into these categories:
Trivial tests — Tests that only verify getters, setters, or basic constructors without exercising meaningful logic. If the test would pass even with a broken implementation, it's not testing anything useful.
Weak assertions — Tests whose assertions only check for non-null values, basic type existence, or that "no exception was thrown" without validating actual functional outcomes. A test that asserts $result !== null when the interesting question is what $result contains is wasting space.
Improbable edge cases — Tests for scenarios that don't impact core functionality or risk areas. Testing that a method handles a 10,000-character input when the UI caps it at 255 characters adds maintenance cost without meaningful protection.
Brittle implementation tests — Tests that are tightly coupled to internal details (exact method call counts, specific query structures, internal state). These break on every refactor and create false failures that erode trust in the test suite.
For each test that survives pruning, check and improve:
assertEquals over assertTrue, assertDatabaseHas over checking a return value)it_rejects_enrollment_when_course_is_full)setUp()TenantTestCase, inline factories)$this->faker or fake() consistently with the rest of the codebaseAfter pruning, if important behaviors are left untested, suggest or write high-value tests for:
Run the refined tests to confirm they pass:
php artisan test --compact <test-file>If any test fails, fix it. A refined test suite that doesn't pass is worse than the original.
Summarize what you did:
32c20f1
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.