Testing Anti-Patterns

Identify and prevent common testing anti-patterns in software development.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/MacPhobos/research-mind --skill testing-anti-patterns-macphobos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Testing Anti-Patterns
Source: https://github.com/MacPhobos/research-mind/tree/main/.claude/skills/universal-testing-testing-anti-patterns
Command: npx skills add https://github.com/MacPhobos/research-mind --skill testing-anti-patterns-macphobos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers identify and avoid common mistakes in unit and integration testing, ensuring tests are robust, reliable, and truly verify behavior rather than implementation details.

Core Features & Use Cases

  • Identifies 5 Core Anti-Patterns: Testing mock behavior, test-only methods, uninformed mocking, incomplete mocks, and tests as an afterthought.
  • Provides Detection Checklists: Offers language-agnostic and language-specific checks to quickly spot anti-patterns.
  • Use Case: When writing a new test suite or reviewing existing tests, activate this skill to run through the quick detection checklist and ensure adherence to best practices, preventing brittle and misleading tests.

Quick Start

Use the Testing Anti-Patterns skill to review the attached test file 'user_service.test.ts' for common testing anti-patterns.

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 that make tests brittle?

Common unit testing anti-patterns include testing mock behavior instead of real logic, creating test-only methods, uninformed mocking, incomplete mocks, and treating tests as an afterthought. These pitfalls cause tests to verify implementation details rather than actual behavior, leading to brittle test suites.

How do I check if my integration testing verifies real behavior?

To check if integration testing verifies real behavior, use detection checklists to identify uninformed or incomplete mocks, and ensure you are not testing mock behavior. These checks confirm your tests validate actual software functionality rather than fragile mock dependencies.

Why does testing mock behavior lead to misleading unit tests?

Testing mock behavior leads to misleading unit tests because it verifies that mocks were called as expected rather than checking if the code produces correct outputs. This approach couples tests to implementation details, breaking when internal logic changes even if behavior remains correct.

How do I review an existing test suite for common testing pitfalls?

Review an existing test suite for testing pitfalls by applying language-agnostic and language-specific detection checklists. This process identifies anti-patterns like test-only methods and uninformed mocking, guiding developers towards robust and reliable testing practices.

When should I not use mocking in unit testing?

You should not use mocking in unit testing when it results in uninformed or incomplete mocks that fail to accurately replicate real dependencies. Avoid mocking if it forces you to create test-only methods or causes tests to validate mock behavior instead of actual code functionality.