Testing Anti-Patterns

Detect testing anti-patterns like mock behavior and incomplete mocks.

3|1|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/trae-community/trae-templates --skill testing-anti-patterns-trae-community
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Testing Anti-Patterns
Source: https://github.com/trae-community/trae-templates/tree/main/templates/tools-devops/superpowers-trae-init/.trae/skills/testing-anti-patterns
Command: npx skills add https://github.com/trae-community/trae-templates --skill testing-anti-patterns-trae-community

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill clarifies the frequent anti-patterns in testing practices, helping developers write effective, accurate tests by avoiding common mistakes.

Core Features & Use Cases

  • Anti-Pattern Identification: Detects issues such as testing mock behavior, test-only methods, incomplete mocks, and over-mocking.
  • Best Practice Guidance: Provides strategies to write meaningful tests aligned with TDD principles and proper mocking techniques.
  • Use Case: A developer reviews their test suite and receives recommendations to replace mock overuse with integration tests, improving test reliability.

Quick Start

Ask the AI to review your test code for anti-patterns to receive actionable advice and best practices for effective testing.

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?

Frequent unit testing anti-patterns include testing mock behavior instead of actual logic, using test-only methods in production code, over-mocking dependencies, and creating incomplete mocks that reduce overall test reliability.

How do I review my test code for over-mocking and other anti-patterns?

To review test code for anti-patterns, analyze your test suite to detect mock overuse and incomplete mocks, then replace excessive mock assertions with integration tests to improve maintainability and align with TDD best practices.

Why does testing mock behavior make my unit tests unreliable?

Testing mock behavior makes unit tests unreliable because it verifies the mock's internal implementation rather than the actual software logic, causing tests to break unexpectedly when mock configurations change without real defects occurring.

When should I replace mock overuse with integration tests?

You should replace mock overuse with integration tests when unit tests heavily verify mock interactions instead of real outcomes, ensuring your test suite validates actual software behavior and maintains high reliability across development workflows.

Does using test-only methods in production code violate TDD best practices?

Using test-only methods in production code violates TDD best practices by exposing internal implementation details purely for testing, which degrades software maintainability and couples your tests to internal code structure.