testing-anti-patterns

Identify testing anti-patterns and enforce Test-Driven Development principles.

1|Updated Sep 26, 2025
One-click install
npx skills add https://github.com/pascallammers/mylo-travel-concierge-v2 --skill testing-anti-patterns-pascallammers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/pascallammers/mylo-travel-concierge-v2/tree/main/.factory/skills/testing-anti-patterns
Command: npx skills add https://github.com/pascallammers/mylo-travel-concierge-v2 --skill testing-anti-patterns-pascallammers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents common testing mistakes that lead to brittle, misleading, or unmaintainable tests, ensuring your tests accurately reflect real behavior and don't pollute production code.

Core Features & Use Cases

  • Avoid Mock Behavior Testing: Ensures tests verify actual component functionality, not just the presence of mocks.
  • Prevent Production Pollution: Stops test-specific methods from being added to production classes.
  • Understand Dependencies: Guides users to mock only when necessary and with a clear understanding of the system.
  • Use Case: When writing tests for a new feature, this Skill helps you avoid accidentally testing your mock apiClient instead of the actual fetchData function, or adding a _cleanupForTest method to your UserService class.

Quick Start

Use the testing-anti-patterns skill to review your current test suite 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
How do I stop unit tests from verifying mock behavior instead of actual component functionality?

To stop testing mock behavior, enforce Test-Driven Development principles that verify actual functionality. This ensures your tests check real component outputs rather than just confirming that a mock object was called.

Why does adding test-only methods to production code reduce maintainability?

Adding test-only methods to production code reduces maintainability by polluting your codebase with test-specific logic. Preventing production pollution ensures your classes maintain integrity and tests rely on actual public interfaces.

What is the best way to mock dependencies without understanding the system?

Mocking dependencies without understanding the system leads to misleading tests. You should mock only when necessary and with a clear understanding of system behavior to ensure integration testing accurately reflects real conditions.

How do I review my test suite for common testing anti-patterns?

To review your test suite for common testing anti-patterns, systematically evaluate your tests for mock behavior verification, production code pollution, and improper mocking. This process enforces TDD principles to improve test reliability.

When should I avoid mocking during integration testing?

You should avoid mocking during integration testing when verifying real behavior across system boundaries. Mocking without understanding dependencies creates brittle tests; mock only when necessary to maintain code integrity.