testing-anti-patterns

Identify and prevent testing anti-patterns that degrade test quality.

4|Updated Oct 3, 2025
One-click install
npx skills add https://github.com/apexbusiness-systems/APEX-OmniHub --skill testing-anti-patterns-apexbusiness-systems
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/apexbusiness-systems/APEX-OmniHub/tree/main/.cursor/superpowers/skills/testing-anti-patterns
Command: npx skills add https://github.com/apexbusiness-systems/APEX-OmniHub --skill testing-anti-patterns-apexbusiness-systems

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams identify and prevent testing anti-patterns that degrade test reliability, such as mocking behavior, production pollution with test-only methods, and misguided dependency isolation.

Core Features & Use Cases

  • Detects and prevents common testing anti-patterns (testing mocks, testing production behavior, test-only production methods) to improve test validity.
  • Provides practical guidelines to maintain test hygiene, align tests with real behavior, and reinforce TDD discipline.
  • Use Case: Refactor a flaky unit test that relies on mocks to verify actual behavior of the code under test instead of mock semantics.

Quick Start

Audit your test suites for mock-centric assertions, test-only production methods, and overly complex mocks; refactor to validate real behavior and reduce false positives.

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 degrade test reliability?

Common unit testing anti-patterns include mock-centric assertions, test-only production methods, and incomplete mocks. These testing anti-patterns degrade test validity by verifying mock semantics instead of actual code behavior.

How do I refactor flaky unit tests that rely too heavily on mocks?

Refactor flaky unit tests by auditing mock-centric assertions and refactoring them to validate real behavior. Eliminate test-only production methods to reduce false positives and align tests with actual code behavior.

Why should I avoid adding test-only methods to production code?

Test-only production methods pollute production code and degrade code hygiene. Avoiding them maintains strict testing discipline and ensures tests validate real behavior without misguided dependency isolation.

How do I audit my test suite for mock-centric assertions?

Audit your test suites by identifying mock-only assertions and overly complex mocks. Refactor these tests to validate actual code behavior instead of mock semantics to improve overall test quality.

What is the best way to maintain TDD discipline and test hygiene across a codebase?

Maintain TDD discipline by avoiding testing anti-patterns like incomplete mocks and production pollution. Apply practical guidelines to align tests with real behavior and enforce strict testing rules across codebases.

When should I not use mocks in unit testing?

Avoid using mocks when they result in mock-only assertions that validate mock semantics rather than actual code behavior. Overly complex mocks create false positives and degrade test reliability.