Xunit Test Patterns

Apply Gerard Meszaros's "xUnit Test Patterns — Refactoring Test Code" (2007) — the canonical catalogue of test-automation patterns, the test-double taxonomy (Dummy, Stub, Spy, Mock, Fake), test smells, fixture strategies, and result-verification patterns. Use when writing or refactoring test code; diagnosing brittle, slow, erratic, or obscure tests; choosing and naming a test double; designing fixtures (fresh vs shared, Object Mother, Test Data Builder, setup styles); structuring the four-phase test; deciding where to draw the test boundary (subcutaneous / layer / round-trip); faking out-of-pr

5 stars 2 forksTesting & QA Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add vnovakovits/claude-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add vnovakovits/claude-skills --skill xunit-test-patterns
Manual install
git clone --depth 1 https://github.com/vnovakovits/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/plugins/engineering-practices/skills/xunit-test-patterns ~/.claude/skills/xunit-test-patterns

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# xUnit Test Patterns (Gerard Meszaros)

Apply this skill when the question is **"is this test code any good, and how do I make it better?"** — naming and choosing test doubles, shaping fixtures, killing duplication and flakiness, and deciding what boundary a test should exercise. Meszaros's book is the source of the vocabulary the whole industry now uses (he coined *Test Double*, *Mock Object* in its precise sense, *Fake Object*, *Object Mother*, *Mystery Guest*, *Assertion Roulette*). This skill is the catalogue; pair it with **test-driven-development** for the red/green/refactor workflow and **unit-testing-principles** for the four-pillars trade-off analysis.

## Core Philosophy

**Test code is production code.** It is read, changed, and relied upon for the life of the system. It deserves the same care — naming, structure, DRY-ness — and the same refactoring discipline.

**Tests must be cheap to maintain, or they get deleted or ignored.** The dominant long-term cost of a test suite is maintenance, not authoring. Every pattern in the book ultimately serves *maintainability* and *trust*.

**A test is a specification, not just a check.** Its first job is to communicate intent to the next reader. If a test passes but no one can tell what requirement it encodes, it has failed at its primary job.
Read the full skill on GitHub

Details

Skill name
xunit-test-patterns
Path
plugins/engineering-practices/skills/xunit-test-patterns/SKILL.md
License
MIT
Repo updated
16 November 2026

FAQ

What does the Xunit Test Patterns skill do?

Apply Gerard Meszaros's "xUnit Test Patterns — Refactoring Test Code" (2007) — the canonical catalogue of test-automation patterns, the test-double taxonomy (Dummy, Stub, Spy, Mock, Fake), test smells, fixture strategies, and result-verification patterns. Use when writing or refactoring test code; diagnosing brittle, slow, erratic, or obscure tests; choosing and naming a test double; designing fixtures (fresh vs shared, Object Mother, Test Data Builder, setup styles); structuring the four-phase test; deciding where to draw the test boundary (subcutaneous / layer / round-trip); faking out-of-pr

How do I install the Xunit Test Patterns skill?

Claude Code plugin: /plugin marketplace add vnovakovits/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Xunit Test Patterns popular?

It lives in vnovakovits/claude-skills, which has 5 GitHub stars and 2 forks.

Related skills

Accidental Cio

5

vnovakovits/claude-skills

Apply Scott Millett's "The Accidental CIO — A Lean and Agile Playbook for IT Leaders" (Wiley, 2024) when designing or reviewing how a technology organisation decides, funds, governs and delivers work. Covers the five components of an adaptive IT operating model (organised, work, govern, talent, lead) and its four themes (outcomes over output, intrinsic motivation, being not doing agile, manage flow not people); matching method and governance to context via Cynefin and Wardley evolution; governance as demand management + funding + measurement + decision rights, shifting from project funding to

Frontend & Design

Agent Retro

5

vnovakovits/claude-skills

Run a retrospective on a coding-agent session and improve the agent's environment, not the code. Combines Derby & Larsen's five-stage retrospective, Shigeo Shingo's poka-yoke (turn a mechanical mistake into a check that makes it impossible), and Matt Pocock's retro categories — navigation, automated checks, coding standards, steering files, tool economy, information access. Covers mining the session transcript for corrections, wrong turns and slow searches; deciding where each fix belongs (analyzer, hook, CI, reviewer standards, CLAUDE.md pointer, skill, doc or memory); the no-op test for stee

AI, LLMs & Agents

API Design

5

vnovakovits/claude-skills

Design APIs that are clear, evolvable, and idiomatic to their protocol — covering REST (Fielding, Richardson Maturity Model, Massé), GraphQL, gRPC/protobuf, versioning strategies, pagination, error responses (RFC 7807 Problem Details), idempotency, authentication, documentation (OpenAPI), and the pragmatic trade-offs between RESTful purity and developer ergonomics. Use when designing a new endpoint, choosing between REST/GraphQL/gRPC, defining versioning, structuring error responses, deciding pagination strategy, or evaluating an existing API's evolvability.

Software Development

Data Result Validation

5

eshmith7/claude-skills-library

An honest read on whether a change, test or campaign actually worked, covering effect size, sample adequacy and the traps. Use for A/B tests, before and after comparisons or pilots.

Testing & QA

Voice E2E Test

8

Freddy-CHEN-ux/00_claude_skills

Comprehensive E2E test of voice call pipeline - place call, verify auth flow, monitor transcripts/scores, verify report. Use when user says "test voice e2e", "run voice test", or "full voice test".

Testing & QA

Edu Assessment Analysis

5

eshmith7/claude-skills-library

Turn a question-wise mark sheet into item statistics, topic and cognitive-level gaps, groups by what students missed, and a triaged reteach plan. Use for test analysis.

Testing & QA

Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.