Testing Anti Patterns
Authoritative guide for avoiding testing anti-patterns, covering mock misuse, test-only production code, and incomplete mocks.
- CCM score
- 61 of 100
- skills.sh installs
- 398
- GitHub stars
- 79
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers five anti-pattern categories: testing mock behavior, test-only production methods, uninformed mocking, incomplete mocks, and tests written as an afterthought
- Includes a language-agnostic detection checklist plus TypeScript/Jest and Python/pytest examples and red-flag patterns
- Enforces a rule that test-only methods belong in test utilities, not production classes, and that mocks must mirror the complete API
- Designed for writing or changing tests, adding mocks, and reviewing test failures during TDD work
Install
$ npx -y skills add bobmatnyc/claude-mpm-skills --skill 'Testing Anti-Patterns' -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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
Details
- Repository
- github.com/bobmatnyc/claude-mpm-skills
- Category
- Testing & QA
- First seen
- Jun 3, 2026
Questions
What does the Testing Anti-Patterns skill do?
Testing Anti-Patterns teaches an agent to avoid common testing mistakes: never test mock behavior, never add test-only methods to production classes, and understand dependencies before mocking. It covers these principles with TypeScript/Jest and Python/pytest examples.
How do I install the Testing Anti-Patterns skill?
Run npx -y skills add bobmatnyc/claude-mpm-skills --skill 'Testing Anti-Patterns' -y in your project. Once installed, the agent applies these testing principles when it writes or changes tests and adds mocks.
When should an agent use the Testing Anti-Patterns skill?
Testing Anti-Patterns applies when writing or changing tests, adding mocks, reviewing test failures, or tempted to add test-only methods to production code. It also helps when tests feel overly complex, a sign of over-mocking.
Which test frameworks does Testing Anti-Patterns cover?
Testing Anti-Patterns gives examples for TypeScript with Jest and Python with pytest, and its principles are language-agnostic. Its Python reference covers unittest.mock and pytest-mock patterns.
More from bobmatnyc/claude-mpm-skills
All 154- Vercel Deployments Builds396
- Security Scanning395
- Test Quality Inspector395
- Stacked Prs391
- Svelte5 Runes Static390
- Better Auth Core386
- Homebrew Formula Maintenance383
- Better Auth Integrations381
- Reporting Pipelines381
- Better Auth Plugins380
- Git Worktrees379
- Vb Winforms377
- Nextjs Core375
- Headlessui374
- Fastapi Local Dev373
- Sec Edgar Pipeline372
- Vb Core371
- Vercel Networking Domains371
- Svelte370
- Env Manager368
- Mongodb368
- Digitalocean Containers Images365
- Hono Jsx365
- Phoenix Api Channels365
Similar to Testing Anti Patterns
More Testing & QAtest-driven-developmentbobmatnyc/claude-mpm-skills421 installsLanguage-agnostic TDD guide covering red-green-refactor, test structure, mocking, and coverage targets for any stack.
testing-patternsvudovn/ag-kit218 installsReference guide of testing principles covering the test pyramid, AAA structure, and mocking strategies for reliable suites.
testing-best-practicesasyrafhussin/agent-skills1K installsPractical TDD and unit/integration testing guidelines with 34 TypeScript rules across seven prioritized categories.
python-testing-patternswshobson/agents42.2K installsComprehensive pytest guide covering fixtures, mocking, parameterization, and test-driven development workflows for Python.
python-testingmindrally/skills1.2K installsPytest-focused testing guidance covering unit, integration, property-based, and mocking practices for Python.
unit-testing-frameworkaj-geddes/useful-ai-prompts637 installsStructured guidance for writing unit tests with Jest, pytest, JUnit, or RSpec, following the AAA pattern.