testing-anti-patterns

Identify mock misuse and test-only production code in test suites.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/MinhDuyDEV/mdpi --skill testing-anti-patterns-minhduydev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/MinhDuyDEV/mdpi/tree/main/.pi/skills/testing-anti-patterns
Command: npx skills add https://github.com/MinhDuyDEV/mdpi --skill testing-anti-patterns-minhduydev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents unreliable test suites caused by testing mocks instead of behavior, adding test-only production code, and using mocks without understanding dependencies.

Core Features & Use Cases

  • Mocking Guidance: Helps identify when mocks are misused, incomplete, or hiding real behavior problems.
  • Test Design Reviews: Provides checks for test-only methods, dependency boundaries, and meaningful assertions.
  • Use Case: Use this Skill when reviewing a pull request with new tests to ensure the suite validates real application behavior instead of artificial mock setups.

Quick Start

Use the testing anti-patterns skill to review my new tests for mock misuse and test design issues.

Frequently Asked Questions about testing-anti-patterns

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

FAQPage Schema
How do I identify mock misuse in my test suite?

To identify mock misuse, review whether tests validate real application behavior instead of artificial mock setups, check for incomplete mock structures, and ensure dependency boundaries are respected. This prevents unreliable tests caused by mocking without understanding dependencies.

What are common testing anti-patterns when writing unit tests?

Common testing anti-patterns include testing mocks instead of behavior, adding test-only production code, and using mocks without understanding dependencies. These flawed practices lead to unreliable test suites that fail to validate actual application behavior.

How do I review a pull request for invalid testing practices?

Review pull requests by validating test behavior, checking for test-only methods, ensuring complete mock structures, and verifying separation of production and test utilities. This confirms new tests validate real application behavior rather than artificial setups.

When should I not use mocks in software testing?

Avoid using mocks when they hide real behavior problems or when dependencies are not fully understood. Mocks are misused if tests validate the mock setups themselves rather than verifying meaningful application behavior and integration concerns.

Does test-driven development require removing test-only production code?

Test-driven development requires separating production and test utilities to prevent test-only production code. Adding methods solely for testing invalidates testing practices by polluting production code boundaries and obscuring real application behavior.