Testing-Anti-Patterns

Guide test writing to avoid mocking and production code anti-patterns.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/slapglif/swe-agent --skill testing-anti-patterns-slapglif
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Testing-Anti-Patterns
Source: https://github.com/slapglif/swe-agent/tree/main/.swe/skills/testing-anti-patterns
Command: npx skills add https://github.com/slapglif/swe-agent --skill testing-anti-patterns-slapglif

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents common mistakes in testing that lead to unreliable tests, polluted production code, and false confidence. It ensures your tests verify real behavior, not just mock interactions.

Core Features & Use Cases

  • Mock Behavior Avoidance: Guides against testing mocks themselves, ensuring focus on actual code behavior.
  • Production Code Purity: Prevents adding test-only methods to production classes, keeping your codebase clean.
  • Smart Mocking: Teaches to mock with full understanding of dependencies, avoiding broken test logic.
  • Use Case: Before writing a new test for a component that uses a mocked API, consult this skill to ensure you're not asserting on the mock's existence but on the component's behavior with the mock present.

Quick Start

I'm writing new tests for the payment service. Use the Testing-Anti-Patterns skill to ensure I avoid common pitfalls.