testing-anti-patterns

Detect testing anti-patterns in unit and integration tests.

2|Updated Oct 25, 2025
One-click install
npx skills add https://github.com/robertpelloni/workspace --skill testing-anti-patterns-robertpelloni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/robertpelloni/workspace/tree/main/AI_COORDINATION/skills/superpowers-skills-main/skills/testing/testing-anti-patterns
Command: npx skills add https://github.com/robertpelloni/workspace --skill testing-anti-patterns-robertpelloni

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers recognize and avoid common mistakes and ineffective practices in software testing. By understanding testing anti-patterns, you can improve the quality, efficiency, and reliability of your test suites.

Core Features & Use Cases

  • Anti-pattern Identification: Describe common testing anti-patterns (e.g., fragile tests, over-mocking).
  • Correction Strategies: Suggest ways to refactor tests to avoid these pitfalls.
  • Use Case: If your test suite is slow and flaky, use this skill to analyze your tests and identify anti-patterns like "iceberg tests" or "mocking everything," then get advice on how to refactor them.

Quick Start

Analyze the attached 'tests/user_service_test.py' 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
How do I identify testing anti-patterns in my unit and integration tests?

Testing anti-patterns are ineffective practices like over-mocking, fragile tests, and test-only production code that reduce test reliability. Analyze your test suite for signs: tests that break on refactoring, mocks substituting for real behavior validation, or methods added solely to support testing. This skill identifies these patterns and suggests refactoring strategies to improve test quality.

What's the difference between testing mocks and testing real behavior?

Testing real behavior validates actual system logic; testing mock behavior only verifies the mock itself, providing false confidence. Anti-patterns occur when mocks shield you from catching production bugs. This skill enforces the rule of never testing mock behavior, ensuring your tests catch real failures by mocking dependencies while validating genuine code paths.

Why are my tests slow and flaky, and how do I fix them?

Slow, flaky tests often result from anti-patterns like mocking everything, iceberg tests with hidden dependencies, or unclear test-to-production boundaries. This skill analyzes test suites to identify these pitfalls and provides correction strategies, helping you refactor for speed and reliability.

Should I add test-only methods to my production code?

No. Adding test-only production methods is an anti-pattern that violates production code purity and creates maintenance debt. This skill enforces the rule that production code must remain independent of test requirements, recommending design refactoring instead of test-specific hooks.

How do I know when mocking dependencies is appropriate?

Mocking is appropriate when you isolate a component to test its logic without external side effects. However, anti-patterns emerge when you mock without understanding dependencies or mock production boundaries incorrectly. This skill provides gate checks and explicit examples to ensure mocks target the right scope and validate real behavior.

Can this skill work with Python tests, Java tests, or other languages?

Yes. This skill addresses testing anti-patterns across unit and integration test frameworks regardless of language. It focuses on universal principles—mock usage, test fragility, and production boundaries—applicable to any codebase, with examples demonstrating patterns and corrections.

Related Skills