testing-anti-patterns

Identify and prevent testing anti-patterns in Flutter/Dart test suites.

6|Updated Apr 23, 2026
One-click install
npx skills add https://github.com/ImL1s/flutter-claude-skills --skill testing-anti-patterns-iml1s
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-anti-patterns
Source: https://github.com/ImL1s/flutter-claude-skills/tree/main/skills/testing-anti-patterns
Command: npx skills add https://github.com/ImL1s/flutter-claude-skills --skill testing-anti-patterns-iml1s

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests can drift into anti-patterns that degrade reliability and readability; this guide helps prevent testing mock behavior, production pollution with test-only methods, and over-mocking.

Core Features & Use Cases

  • Guidance on common anti-patterns: testing mock behavior, test-only production code, and over-mocking.
  • Practical fixes: show proper testing strategies including TDD, correct mock scope, and test utility usage.
  • Use Case: Teams maintaining Flutter/Dart test suites can adopt healthier practices across unit, widget, and integration tests.

Quick Start

Install the testing-anti-patterns skill and trigger it against your test suite to receive recommended refactorings.

Frequently Asked Questions about testing-anti-patterns

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

FAQPage Schema
What are common Flutter testing anti-patterns and how do I fix them?

Common Flutter testing anti-patterns include testing mock behavior, polluting production code with test-only methods, and over-mocking. You can fix them by enforcing TDD, maintaining clean separation of concerns, and using well-structured test doubles.

How do I stop polluting production Dart code with test-only methods?

To stop polluting production Dart code with test-only methods, you should enforce clean separation of concerns and use proper test utility strategies instead of injecting test-specific logic directly into your production classes.

Why does testing mock behavior create unreliable Flutter test suites?

Testing mock behavior creates unreliable Flutter test suites because it verifies the mock's internal implementation rather than the actual system's output. Shifting to correct mock scope and complete test doubles ensures your tests validate real outcomes.

Can I apply TDD practices to existing Dart integration tests?

Yes, you can apply TDD practices to existing Dart integration tests by identifying anti-patterns like over-mocking, refactoring to use correct mock scope, and ensuring clean separation of concerns across unit, widget, and integration tests.

What is the correct mock scope to use when writing Dart unit tests?

The correct mock scope in Dart unit tests involves using complete, well-structured test doubles only for external dependencies, preventing over-mocking while maintaining a clean separation of concerns between your test logic and production code.