Testing Anti-Patterns
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.
The Iron Laws
1. NEVER test mock behavior
2. NEVER add test-only methods to production classes
3. NEVER mock without understanding dependencies
Anti-Pattern 1: Testing Mock Behavior
More from obra/superpowers-skills
getting started with skills
Skills wiki intro - mandatory workflows, search tool, brainstorming triggers
292test-driven development (tdd)
Write the test first, watch it fail, write minimal code to pass
10brainstorming ideas into designs
Interactive idea refinement using Socratic method to develop fully-formed designs
10writing plans
Create detailed implementation plans with bite-sized tasks for engineers with zero codebase context
8systematic debugging
Four-phase debugging framework that ensures root cause investigation before attempting fixes. Never jump to solutions.
8code review reception
Receive and act on code review feedback with technical rigor, not performative agreement or blind implementation
7