Testing Anti Patterns

Guide test reviews to verify real behavior instead of mocks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams avoid common testing anti-patterns that erode test quality by forcing real behavior verification, guarding production cleanliness, and supporting robust test design.

Core Features & Use Cases

  • Anti-pattern detection: guides reviews of mock usage, fixture design, and data setup across languages and frameworks.
  • TDD-driven improvements: promotes red–green–refactor cycles and discourages test-only production code.
  • Test-data completeness: emphasizes complete mock structures and realistic data to prevent silent failures.

Quick Start

  • Review existing test files for patterns such as testing mocks that assert mock existence or call counts.
  • Refactor tests to verify real behavior with concrete dependencies and complete fixtures.
  • If needed, implement test utilities to encapsulate repetitive setup without polluting production code.

Frequently Asked Questions about Testing Anti Patterns

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

FAQPage Schema
What are common unit testing anti-patterns related to mocking?▼

Common mocking anti-patterns include writing tests that merely assert a mock's existence or verifying call counts instead of verifying real behavior. This skill guides teams in detecting these patterns and refactoring tests to use concrete dependencies and complete fixtures.

How do I refactor tests to verify real behavior instead of mocks?▼

To refactor tests for real behavior verification, replace mock existence assertions with concrete dependencies and realistic test data. This skill helps you review existing test files, identify mock-heavy patterns, and implement test utilities to encapsulate repetitive setup without polluting production code.

How does TDD workflow prevent testing anti-patterns in code?▼

TDD prevents testing anti-patterns by enforcing the red-green-refactor cycle, ensuring tests drive real behavior verification. This skill promotes TDD-driven improvements by discouraging test-only production code and guiding robust test design across languages and frameworks.

Why do incomplete mock structures cause silent test failures?▼

Incomplete mock structures cause silent test failures because they lack realistic data needed to trigger actual execution paths. This skill emphasizes test-data completeness by guiding you to use complete mock structures and realistic fixtures that prevent silent failures across unit and integration tests.

Does this testing anti-pattern detection work with any test framework?▼

Yes, testing anti-pattern detection applies across languages and test frameworks. This skill provides framework-agnostic guidance for reviewing mock usage, fixture design, and test data management in both unit and integration tests.

When should I avoid using mocks in unit tests?▼

You should avoid mocks when they only assert call counts or mock existence rather than verifying real behavior. This skill guides you to replace such mock-heavy patterns with concrete dependencies and complete fixtures to ensure robust test design and prevent silent failures.