testing-anti-patterns

testing-anti-patterns is a skill for Claude Code from bobmatnyc/claude-mpm-skills. It costs 41 tokens per session (1,950 once invoked), scanned A, original, MIT.

A set of rules for writing reliable software tests, especially when using mocks. Mocks are stand-ins for real dependencies, such as a database or service.

In plain words
What is it for?
It helps review tests, decide when mocking is appropriate, and find incomplete or overly complicated test setups.
Why use it?
It prevents tests from passing merely because a fake object was configured to pass, and avoids adding code to production only to help tests.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit It helps review tests, decide when mocking is appropriate, and find incomplete or overly complicated test setups.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bobmatnyc/claude-mpm-skills/testing-anti-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bobmatnyc/claude-mpm-skills --skill testing-anti-patterns
Clone the repo
git clone --depth 1 https://github.com/bobmatnyc/claude-mpm-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing-anti-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/testing-anti-patterns/github.svg)](https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/testing-anti-patterns)
Your own site
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/testing-anti-patterns"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/testing-anti-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing-anti-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/testing-anti-patterns"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/testing-anti-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,950 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.01950
Opus 5.5 $0.00016 $0.00780
Sonnet 5.5 $0.00008 $0.00390
Haiku 4.5 $0.00004 $0.00195

Measured 2mo ago against content hash e30fb0928dff, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testing-anti-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

universal/testing/testing-anti-patterns/SKILL.md · 192 lines

How it starts

The opening of the file, as written. The whole thing — 192 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing Anti-Patterns

Overview

Tests must verify real behavior, not mock behavior. Mocks are a means to isolate, not the thing being tested.

Core principle: Test what the code does, not what the mocks do.

Following strict TDD prevents these anti-patterns. See the Test-Driven Development skill (available in the skill library) for the complete TDD workflow.

When to Use This Skill

Activate this skill when:

  • Writing or changing tests - Verify tests cover real behavior
  • Adding mocks - Ensure mocking is necessary and correct
  • Reviewing test failures - Check if mock behavior is the issue
  • Tempted to add test-only methods - STOP and reconsider
  • Tests feel overly complex - Sign of over-mocking

The Iron Laws

1. NEVER test mock behavior
2. NEVER add test-only methods to production classes
3. NEVER mock without understanding dependencies
4. NEVER create incomplete mocks
5. NEVER treat tests as afterthought

Core Anti-Pattern Categories

1. Testing Mock Behavior

Asserting on mock elements instead of real behavior. Fix: Test real component or don't mock it. → core-anti-patterns.md

2. Test-Only Methods in Production

Methods in production classes only used by tests. Fix: Move to test utilities. → core-anti-patterns.md

3. Mocking Without Understanding

Mocking without understanding dependencies/side effects. Fix: Understand first, mock minimally. → core-anti-patterns.md

4. Incomplete Mocks

Partial mocks missing fields downstream code needs. Fix: Mirror complete API structure. → completeness-anti-patterns.md

5. Tests as Afterthought

Implementation "complete" without tests. Fix: TDD - write test first. → completeness-anti-patterns.md

Read the full file on GitHub · 192 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 192 lines · 41 tokens per session scan A e30fb0928dff

Subscribe to this mod's changes

testing-anti-patterns is a skill published in the GitHub repository bobmatnyc/claude-mpm-skills (79 stars, last pushed 4mo ago), licensed MIT. It adds 41 tokens to every session and 1,950 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

testing-anti-patterns compared with skills from other repositories

testing-anti-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
testing-anti-patternsbobmatnyc/claude-mpm-skillsSkill794mo agoMITA41Claude Code
JavaScript Testing PatternsPramodDutta/qaskillsSkill25227d agoMITA36Claude Code, Codex
jest-expertpersonamanagmentlayer/pclSkill461mo agoApache-2.0A65Claude Code
Jest Mocking PatternsPramodDutta/qaskillsSkill25227d agoMITA44Claude Code, Codex
CI Test Sharding ParallelizationPramodDutta/qaskillsSkill25227d agoMITA34Claude Code, Codex
frontmcp-testingagentfront/frontmcpSkill154todayApache-2.0A175Claude Code
jestanivar/jest-skillSkill9yesterdayMITA179Claude Code, Codex