testing-anti-patterns

Solid

Reviews test code to identify and fix common testing anti-patterns including flaky tests, over-mocking, brittle assertions, test interdependency, and hidden test logic. Flags bad patterns, explains the specific defect, and provides corrected implementations. Use when reviewing test code, debugging intermittent or unreliable test failures, or when the user mentions flaky tests, test smells, brittle tests, test isolation issues, mock overuse, slow tests, or test maintenance problems.

Testing & QA 1,177 stars 108 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Testing Anti-Patterns You are identifying and avoiding common testing anti-patterns. ## Review Workflow Follow these steps when reviewing test code: 1. **Run tests in isolation** — Verify each test passes independently (no shared state, no ordering dependency). 2. **Check for patterns below** — Scan for each anti-pattern in the checklist; flag every match with the specific defect. 3. **Apply refactoring strategy** — Use the refactoring strategies section to select and apply the appropriate fix. 4. **Verify the test still fails when code breaks** — After fixing, confirm the corrected test catches real regressions (remove or stub the implementation to confirm a failure occurs). ## Critical Anti-Patterns ### 1. The Liar - Tests That Always Pass **Problem:** Test passes even when the code is broken. ```typescript // BAD - Always passes because it tests nothing meaningful it('should process data', () => { const result = processData(input); expect(result).toBeDefined(); // Too weak }); // GOOD - Actually verifies behavior it('should transform input to uppercase', () => { const result = processData({ text: 'hello' }); expect(result.text).toBe('HELLO'); }); ``` **Detection:** Remove or break the implementation - test should fail. ### 2. The Giant - Tests Too Large **Problem:** Single test covers too many behaviors. ```typescript // BAD - Tests multiple things it('should handle user registration', async () => { const user = await register(userData); expect(u...

Details

Author
rohitg00
Repository
rohitg00/skillkit
Created
4 months ago
Last Updated
today
Language
TypeScript
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Listed

testing-anti-patterns

Use when reviewing tests for fragility, over-mocking, false positives, missing production wiring, or assertions that do not prove the requirement.

2 Updated today
DYAI2025
Testing & QA Solid

test-anti-patterns

Quick pragmatic review of .NET test code for anti-patterns that undermine reliability and diagnostic value. Use when asked to review tests, find test problems, check test quality, or audit tests for common mistakes. Catches assertion gaps, flakiness indicators, over-mocking, naming issues, and structural problems with actionable fixes. Use for periodic test code reviews and PR feedback. For a deep formal audit based on academic test smell taxonomy, use exp-test-smell-detection instead. Works with MSTest, xUnit, NUnit, and TUnit.

3,219 Updated today
dotnet
Testing & QA Listed

testing-anti-patterns

Use when writing or changing tests, adding mocks, or tempted to add test-only methods to production code - prevents testing mock behavior, production pollution with test-only methods, and mocking without understanding dependencies

335 Updated today
aiskillstore
Testing & QA Listed

testing-anti-patterns

Use when writing or changing tests, adding mocks, or tempted to add test-only methods to production code - prevents testing mock behavior, production pollution with test-only methods, and mocking without understanding dependencies

2 Updated today
zartin790
Testing & QA Listed

testing

Comprehensive testing patterns and anti-patterns for writing and reviewing tests

1,116 Updated today
vm0-ai