testing-anti-patterns

Audit test suites for mocking anti-patterns and revise tests to validate real behavior.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/liamtran96/msm-car-booking --skill testing-anti-patterns-liamtran96
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/liamtran96/msm-car-booking/tree/main/.claude/skills/testing-anti-patterns
Command: npx skills add https://github.com/liamtran96/msm-car-booking --skill testing-anti-patterns-liamtran96

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write robust tests by identifying and avoiding common anti-patterns that undermine test reliability, such as asserting on mocks, introducing test-only production code, or mocking without understanding dependencies.

Core Features & Use Cases

  • Anti-pattern awareness: Identifies and explains the most common testing mistakes that lead to brittle or misleading tests.
  • Guided fixes: Provides concrete rewrites to verify real behavior, avoid test-only methods, and improve test isolation.
  • Use Case: When reviewing a test suite, apply this Skill to audit tests for mock overreach, incomplete mocks, and over-mocked dependencies, then adjust tests to validate real code paths.

Quick Start

Run a quick audit of the current test suite to identify mocks testing internal behavior and to remove test-only production code.

Frequently Asked Questions about testing-anti-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop unit tests from asserting on mock artifacts instead of real behavior?

To stop unit tests from asserting on mock artifacts, you must identify testing anti-patterns where mocks verify internal behavior. Rewriting tests to validate real code paths and avoiding test-only production code ensures tests verify actual behavior rather than mock interactions.

What are common testing anti-patterns that make TDD suites brittle?

Common testing anti-patterns include asserting on mocks, introducing test-only production code, and mocking without understanding dependencies. These mistakes undermine test reliability and lead to brittle, misleading test suites that fail to verify real behavior.

How do I audit my test suite for mock overreach and incomplete mocks?

You can audit your test suite for mock overreach and incomplete mocks by applying anti-pattern detection rules during code reviews or CI checks. This process identifies tests verifying internal behavior and provides concrete fixes to improve test isolation and validate real code paths.

Does this testing guidance apply to both frontend and backend test suites?

Yes, this testing anti-pattern guidance applies to both frontend and backend test suites. It helps developers enforce TDD principles and fix common testing mistakes during development, code reviews, and CI checks across the entire tech stack.

Why does introducing test-only production code reduce code quality?

Introducing test-only production code reduces code quality because it pollutes the production codebase with methods or branches solely made for mocking. Removing this code and verifying real behavior keeps tests honest and reduces production pollution from tests.

When should I not use mocking in my unit tests?

You should avoid mocking when it leads to over-mocked dependencies or incomplete mocks that verify interactions rather than outcomes. If mocking lacks understanding of the dependency, validating real code paths instead ensures tests remain robust and honest.