testing-anti-patterns

Identify and resolve common testing anti-patterns in software test suites.

484|76|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/flora131/atomic --skill testing-anti-patterns-flora131
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/flora131/atomic/tree/main/.opencode/skills/testing-anti-patterns
Command: npx skills add https://github.com/flora131/atomic --skill testing-anti-patterns-flora131

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers identify and prevent common anti-patterns in their test suites, leading to more robust, maintainable, and reliable tests.

Core Features & Use Cases

  • Identify Mocking Issues: Detects and guides against testing mock behavior or incomplete mocks.
  • Prevent Test-Only Code: Ensures production code remains clean by separating test utilities.
  • Promote TDD: Encourages writing tests before implementation to catch issues early.
  • Use Case: A developer is unsure why their tests are brittle and often pass even when the underlying functionality is broken. This Skill provides clear rules and examples to refactor their tests for better accuracy and stability.

Quick Start

Use the testing-anti-patterns skill to review the provided test code for common anti-patterns.

Frequently Asked Questions about testing-anti-patterns

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

FAQPage Schema
Why do my unit tests pass even when the underlying functionality is broken?

Unit tests that pass despite broken functionality often stem from testing mock behavior rather than actual code execution. This testing anti-pattern occurs when improper mocking strategies or incomplete mock data structures fail to validate true integration, creating brittle and inaccurate test suites.

How do I prevent test-only methods from cluttering my production code?

To prevent test-only methods in production code, separate test utilities and ensure production code remains clean. This testing anti-pattern is resolved by refactoring test structures and adhering to TDD principles, which keeps test logic out of your production codebase entirely.

What is the best way to identify incomplete mock data structures in my test suite?

The best way to identify incomplete mock data structures is to review your tests for improper mocking strategies. By applying TDD principles and refactoring tests to match actual data contracts, you prevent mocks from missing critical fields that cause false positives.

When should I not use mocking in unit tests?

You should not use mocking in unit tests when it leads to testing the mock's behavior rather than the system under test. If mocking strategies require test-only methods in production code or create incomplete mock data, refactoring toward integration tests is necessary.

How do I refactor brittle tests to follow TDD principles?

Refactor brittle tests by writing tests before implementation to catch issues early, a core TDD principle. Remove improper mocking strategies and test-only methods, ensuring your unit and integration tests validate actual behavior rather than mock interactions.