
Testing Anti Patterns
This is one of those skills that catches you doing the thing you know you shouldn't do but do anyway. It pushes back when you're mocking too much or testing mock behavior instead of real code behavior. The core principle is simple: test what the code does, not what the mocks do. It activates when you're writing tests, adding mocks, or about to add test-only methods to your production code. Works best if you're already following TDD, and it pairs with bobmatnyc's separate TDD skill. Think of it as a linter for your testing habits rather than your code.
- skills.sh installs
- 226
- GitHub stars
- 79
- last updated
- Aug 21, 2026
Install
$ npx -y skills add bobmatnyc/claude-mpm-skills --skill 'Testing Anti-Patterns' --agent claude-codeInstalls into .claude/skills of the current project.
Files
Testing Anti-Patterns
Overview
Tests must verify real behavior, not mock behavior. Mocks are a means to isolate, not the thing being tested.
Core principle: Test what the code does, not what the mocks do.
Following strict TDD prevents these anti-patterns. See the Test-Driven Development skill (available in the skill library) for the complete TDD workflow.
When to Use This Skill
Activate this skill when:
- Writing or changing tests - Verify tests cover real behavior
- Adding mocks - Ensure mocking is necessary and correct
- Reviewing test failures - Check if mock behavior is the issue
- Tempted to add test-only methods - STOP and reconsider
- Tests feel overly complex - Sign of over-mocking
The Iron Laws
1. NEVER test mock behavior
2. NEVER add test-only methods to production classes
3. NEVER mock without understanding dependencies
4. NEVER create incomplete mocks
5. NEVER treat tests as afterthought
Core Anti-Pattern Categories
Sponsors
Details
- Repository
- github.com/bobmatnyc/claude-mpm-skills
- Categories
- Testing & QA, Python
- First seen
- Jun 3, 2026
More from bobmatnyc/claude-mpm-skills
All 158- Root Cause Tracing216
- Mcp206
- Tauri Event System203
- Condition Based Waiting199
- Mcp Builder188
- Writing Plans187
- Dispatching Parallel Agents185
- Requesting Code Review182
- Webapp Testing Patterns181
- Langchain Framework165
- Django Framework159
- React State Machines158
- Neon Serverless Postgres156
- Nextjs Env Variables153
- Pyright Type Checker153
- Dspy Framework152
- Espocrm Development151
- Netlify Deployment Platform150
- Datadog Observability142
- Internal Comms 3p Updates136
- Brainstorming Ideas Into Designs
- Drizzle Orm4.3K
- Playwright E2e Testing2.7K
- Pydantic2.2K