Comprehensive testing skill for developing and maintaining high-quality tests across analysis, smell detection, strengthening, characterization tests, TDD workflow, and Humble Object refactoring.
A technology-agnostic skill for building and maintaining high-quality test suites, grounded in established testing principles from Kent Beck, Vladimir Khorikov, Gerard Meszaros, and Michael Feathers.
See philosophy.md for the full theoretical foundation.
/testing-ultimate analyze-testsProduce a quality dashboard for the project's test suite.
Steps:
*.test.*, *.spec.*, __tests__/, *_test.*, test directories)Output format:
# Test Suite Analysis
## Summary
- Test files: X | Tests: Y | Avg length: Z lines
- Mock usage: X% | Assertion density: X/test
## Coverage gaps
| Module | Complexity | Tests | Risk |
| ------ | ---------- | ----- | ---- |
| ... | ... | ... | ... |
## Recommendations
1. [Priority action with rationale]
/testing-ultimate find-test-smellsDetect common test smells in existing test files. See smells.md for the full catalog.
Steps:
| Smell | Detection rule |
|---|---|
| Obscure Test | >30 lines without helpers; unclear naming; no assertion messages |
| Eager Test | >4 assertions on different concerns in one test |
| Conditional Logic | if, for, while, switch inside test body |
| Fragile Test | Assertions on private/internal state; strict mock call-order verification |
| Mystery Guest | Direct file system, network, or DB access without explicit fixtures |
| Test Duplication | Near-identical test bodies (>80% similarity) |
| Assertion Roulette | Multiple assertions without distinct messages |
| File | Test | Smell | Severity | Suggested fix |
| ---- | ---- | ----- | -------- | ------------- |
/testing-ultimate strengthen-testsImprove existing tests to increase their value according to Beck's Desiderata and Khorikov's 4 goals.
Steps:
[scenario]_[expected outcome] or equivalent conventionConservative approach: Never change what a test verifies — only improve how it's expressed.
/testing-ultimate add-characterization [path]Add characterization tests to legacy/untested code (Feathers approach).
Steps:
[path]:
// Characterization test — documents existing behaviorKey rule: Characterization tests document reality. If the test fails, the test is wrong (not the code).
/testing-ultimate enforce-tddRun a guided Red-Green-Refactor TDD loop.
Steps:
RED — Write the test first:
GREEN — Make it pass minimally:
REFACTOR — Clean up with safety net:
Log each iteration:
## TDD Log
### Cycle 1: [Behavior description]
- RED: Added test `test_X_does_Y` → ❌ failed as expected
- GREEN: Implemented X → ✅ all pass
- REFACTOR: Extracted helper → ✅ all pass
Rules:
/testing-ultimate refactor-to-humble [path]Apply the Humble Object pattern to make untestable code testable.
Steps:
[path]:
Examples of Humble Object splits:
See checklists.md for operational checklists used across all workflows.
| Situation | Workflow |
|---|---|
| Starting a new project or feature | enforce-tdd |
| Inheriting code without tests | add-characterization → find-test-smells |
| Tests exist but feel brittle | find-test-smells → strengthen-tests |
| Want a health check | analyze-tests |
| God class mixing logic and I/O | refactor-to-humble |
| AI agent is refactoring production code | enforce-tdd or strengthen-tests first |