bobmatnyc avatar

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-code

Installs 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
1community-access avatartesting-strategycommunity-access/accessibility-agentsAccessibility testing decision trees, browser/AT compatibility matrices, manual vs. automated test coverage, regression testing patterns, and acceptance criteri215skills.sh installs
2supabase avatare2e-studio-testssupabase/supabaseRun e2e tests in the Studio app. Use when asked to run e2e tests, run studio tests, playwright tests, or test the feature.211skills.sh installs
3personamanagmentlayer avatartesting-expertpersonamanagmentlayer/pclExpert-level software testing with unit tests, integration tests, E2E tests, TDD/BDD, and testing best practices203skills.sh installs
4itechmeat avatarvitestitechmeat/llm-codeVitest testing framework: Vite-powered tests, Jest-compatible API, mocking, snapshots, coverage, browser mode, and TypeScript support. Use when writing or confi201skills.sh installs
5oguzhan18 avatarangular-testingoguzhan18/angular-ecosystem-skillsALWAYS use when writing tests for Angular applications, including unit tests, component tests, service tests, or E2E tests with Jasmine, Karma, Vitest, or Cypre197skills.sh installs
6warpdotdev avatarwebapp-testingwarpdotdev/oz-skillsTest local web applications with Playwright. Use when asked to verify frontend functionality, debug UI behavior, capture browser screenshots, or inspect browser192skills.sh installs