What problem does it solve?
This Skill helps you avoid common pitfalls that lead to ineffective, brittle, or misleading tests. It prevents you from testing mock behavior, polluting production code with test-only methods, and creating incomplete or misunderstood mocks.
Core Features & Use Cases
- Mock Behavior Prevention: Guides you to test real code behavior, not just the existence or functionality of your mocks.
- Production Code Purity: Ensures test-only methods don't creep into your production classes, maintaining clean separation of concerns.
- Dependency Understanding: Forces you to understand dependencies before mocking, preventing tests that pass for the wrong reasons.
- Use Case: When writing new tests or refactoring existing ones, consult this Skill to ensure your tests are robust. For example, if you're tempted to assert on a mock's internal state, this Skill will redirect you to test the actual component's behavior.
Quick Start
Announce skill usage
I'm using the testing-anti-patterns skill to review my test strategy.
The skill will then guide you through common pitfalls and their fixes.