testing-anti-patterns

Enforce the Five Iron Laws to eliminate testing anti-patterns.

Updated Jan 7, 2026
One-click install
npx skills add https://github.com/Smooth-Operation/household-expense-tracker --skill testing-anti-patterns-smooth-operation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/Smooth-Operation/household-expense-tracker/tree/main/.claude/skills/testing/testing-anti-patterns
Command: npx skills add https://github.com/Smooth-Operation/household-expense-tracker --skill testing-anti-patterns-smooth-operation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams avoid critical testing mistakes by promoting observable behavior and guiding adherence to best practices over fake success signals from mocks or test-only code.

Core Features & Use Cases

  • Rule-based guidance: Enforces the Five Iron Laws to ensure tests verify actual system behavior rather than internal mocks.
  • Anti-pattern detection: Identifies patterns like testing mock behavior, test-only methods, and brittle isolation that reduce test value.
  • Guided improvements: Provides concrete steps to add integration tests, improve error-path coverage, and test through public APIs.

Quick Start

Audit your current test suite and implement the Five Iron Laws: remove test-only methods, stop testing mocks, ensure integration tests exist, cover error paths, and verify behavior through public interfaces.

Frequently Asked Questions about testing-anti-patterns

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

FAQPage Schema
Why are my unit tests passing but failing in production?

Unit tests passing in production often rely on mocks that verify internal interactions rather than observable behavior. Stop testing mock behavior and verify actual system outputs through public APIs to catch real failures.

When should I use mocks in integration testing?

Use mocks carefully in integration testing to isolate external boundaries, not internal components. Apply careful mocking by testing through public APIs and ensuring mandatory integration tests verify actual cross-component behavior.

What are common testing anti-patterns in software engineering?

Common testing anti-patterns include testing mock behavior, relying on test-only methods, and using brittle isolation. Eliminate these patterns by focusing on observable behavior and enforcing explicit error-path coverage.

How do I refactor tests to verify observable behavior instead of mocks?

Refactor tests by removing test-only methods and stopping mock behavior verification. Audit your suite against the Five Iron Laws, test through public APIs, and add explicit error-path coverage to verify real behavior.

Do I need integration tests if my unit tests have full mock coverage?

Yes, mandatory integration tests are required even with full mock coverage. Mocks provide fake success signals by testing internal interactions, whereas integration tests verify actual system behavior across components through public interfaces.

How do I ensure my test suite covers error paths explicitly?

Ensure error path coverage by explicitly testing failure scenarios through public APIs rather than mocking exceptions. Apply the Five Iron Laws to mandate explicit error-path coverage and verify actual system error handling behavior.