Testing Anti-Patterns

Identify and remediate testing anti-patterns in unit and integration tests.

2|Updated Oct 16, 2025
One-click install
npx skills add https://github.com/spacholski1225/cc-config --skill testing-anti-patterns-spacholski1225
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Testing Anti-Patterns
Source: https://github.com/spacholski1225/cc-config/tree/main/skills/testing/testing-anti-patterns
Command: npx skills add https://github.com/spacholski1225/cc-config --skill testing-anti-patterns-spacholski1225

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers recognize and remediate common testing anti-patterns, ensuring tests verify real behavior rather than mocks, avoiding test-only production code, and encouraging proper dependency understanding.

Core Features & Use Cases

  • Anti-pattern awareness: Identify patterns like testing mock behavior, test-only production methods, and incomplete mocks, with practical fixes.
  • Guided TDD practices: Emphasizes Test-Driven Development to catch issues early and keep production code clean.
  • Mature testing discipline: Provides gate checks and best-practice recommendations to improve test reliability in unit and integration tests.

Quick Start

Review the anti-pattern descriptions and implement the recommended fixes in existing test suites. Before introducing mocks, reason about whether you are testing real behavior, and prefer testing at the correct level.

Frequently Asked Questions about Testing Anti-Patterns

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

FAQPage Schema
Why are my unit tests passing but the application breaks in production?

Your unit tests might be verifying mock behavior instead of real behavior. Testing anti-patterns like incomplete mocks or testing mock interactions create false confidence by validating that mocks were called rather than asserting actual business logic outcomes.

What are common testing anti-patterns when using mocks in TDD?

Common testing anti-patterns include testing mock behavior rather than real outcomes, creating test-only production code to enable mocking, and implementing incomplete mocks. These anti-patterns undermine TDD practices by failing to verify actual software behavior and deep dependency interactions.

How do I fix test-only production methods created just for unit testing?

To fix test-only production code, reason about deep dependency understanding and prefer testing at the correct integration level. Implement practical gate checks to curb unsafe mocks, enforcing TDD practices to keep production code clean and ensure tests verify real behavior.

When should I use mocks vs testing real behavior in integration tests?

Prefer testing real behavior in integration tests to verify deep dependencies. Before introducing mocks, reason about whether you are testing real behavior, and apply practical gate checks to curb unsafe mocks, ensuring your integration tests validate actual system interactions.

Does TDD help prevent testing anti-patterns and incomplete mocks?

Yes, TDD practices catch issues early and keep production code clean. Guided TDD practices enforce deep dependency understanding and provide practical gate checks to curb unsafe mocks and incomplete mocks, ensuring tests verify real behavior throughout development and refactoring.