testing-anti-patterns

Identify and avoid common testing anti-patterns in unit, integration, and end-to-end tests.

Updated Aug 2, 2025
One-click install
npx skills add https://github.com/czer323/d3-item-salvager --skill testing-anti-patterns-czer323
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/czer323/d3-item-salvager/tree/main/.claude/skills/testing-anti-patterns
Command: npx skills add https://github.com/czer323/d3-item-salvager --skill testing-anti-patterns-czer323

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests must verify real behavior, not mock behavior; this guide helps teams identify and avoid common testing anti-patterns that undermine reliability, readability, and maintainability.

Core Features & Use Cases

  • Enforces the principle: never test mock behavior; test the real code paths instead.
  • Warns against test-only production methods and incomplete/misleading mocks.
  • Provides practical guidance, examples, and gatekeeping tips to improve test quality across unit and integration tests.

Quick Start

Review the anti-pattern examples and apply safer testing practices in your project immediately.

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 I should avoid?

Testing mock behavior is an anti-pattern because tests must verify real behavior, not mock behavior. Validating mocks only proves the mock works, not your actual code paths, which undermines test reliability and fails to catch real integration failures.

Why does testing mock behavior undermine test quality?

Testing mock behavior is an anti-pattern because tests must verify real behavior, not mock behavior. Validating mocks only proves the mock works, not your actual code paths, which undermines test reliability and fails to catch real integration failures.

How do I write robust unit and integration tests?

You should never introduce test-only production methods because they add hidden test hooks to your codebase, coupling production logic to test scenarios. This degrades maintainability and creates misleading test environments that do not reflect production reality.

When should I not use mocking in my test suite?

You should not use mocking when it leads to testing mock behavior or when mocks fail to reflect real dependencies. Over-mocking creates incomplete and misleading tests; avoid it when verifying actual integration points and real code paths is critical.

Do I need a specific testing framework to apply these anti-pattern rules?

No specific testing framework is required. The rules for identifying testing anti-patterns and improving test quality are applicable across unit, integration, and end-to-end tests in both frontend and backend codebases, guiding developers, testers, and QA engineers universally.