testing-best-practices

testing-best-practices is a skill for Claude Code, Codex from alleneubank/claude-code. It costs 34 tokens per session (1,065 once invoked), scanned A, original, Apache-2.0.

A testing guide covering unit tests, integration and contract tests, and end-to-end tests. End-to-end tests check complete user workflows through the real application and services.

In plain words
What is it for?
Use it when designing tests, writing test cases, or planning a test strategy for a module.
Why use it?
It helps decide which tests belong at each level and which inputs, errors, service interactions, and workflows need coverage.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/alleneubank/claude-code/testing-best-practices
Any agent
npx skills add alleneubank/claude-code --skill testing-best-practices
Clone the repo
git clone --depth 1 https://github.com/alleneubank/claude-code

Made for: Claude Code, Codex.

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-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/alleneubank/claude-code/testing-best-practices.svg)](https://agentmods.dev/skills/alleneubank/claude-code/testing-best-practices)
Your own site
<a href="https://agentmods.dev/skills/alleneubank/claude-code/testing-best-practices"><img src="https://agentmods.dev/badge/skills/alleneubank/claude-code/testing-best-practices.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,065 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00034 $0.01065
Opus 5 $0.00017 $0.00532
Sonnet 5 $0.00007 $0.00213
Haiku 4.5 $0.00003 $0.00106

Measured 4d ago against content hash ad157a0d358c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing-best-practices 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 4d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/skills/testing-best-practices/SKILL.md · 109 lines

How it starts

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

Test layering policy

Unit tests

Purpose: verify individual functions and invariants in isolation.

  • Data-driven: parameterized tables covering happy path, boundary, error, and edge cases.
  • Property-based: fuzz invariants that must hold across all inputs (e.g., idempotency, sort stability, roundtrip serialization).
  • Derive cases from the module's public API surface: input types/constraints, output shape, error modes, invariants.

Integration / contract tests

Purpose: verify interactions between components and external services.

  • API envelope: request/response shape, status codes, content types, pagination.
  • Error contract: error codes, error shapes, rate limiting, retries.
  • Auth and scoping: token validation, role-based access, tenant isolation.
  • Eventual consistency: verify convergence within bounded time; poll rather than sleep.
  • Reuse auth state across tests where possible; avoid redundant login flows.

E2E tests

Purpose: verify real user workflows through the full stack.

  • No mocks; exercise real services, databases, and APIs.
  • Happy-path workflows only; save edge cases for lower layers.
  • State-tolerant: never assume a clean slate; tolerate and work with prior state.
  • Idempotent: safe to run repeatedly without cleanup between runs.
  • Flow-oriented: validate real data paths end-to-end rather than isolated assertions.

Hard rules

  • Never invent signatures, source locations, or line numbers. Only reference what you have read from the codebase.
  • No fabricated fixtures. Derive test data from actual schemas, types, or seed data in the repo.
  • No test-only hacks in product code. No if (process.env.TEST) branches, no test-specific exports, no test backdoors.
  • E2E must not rely on clean slate. Tests must tolerate pre-existing data, prior test runs, and shared environments.

Execution guidance

Preflight checks (before e2e)

  1. Verify the target environment is reachable (health endpoint, ping).
  2. Confirm required services are running (database, API, auth provider).
  3. Validate test user / credentials exist and are functional.
  4. Check for leftover state that could cause false failures; log it, do not fail on it.

Read the full file on GitHub · 109 lines

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. 4d ago First seen · 109 lines · 34 tokens per session scan A ad157a0d358c

Subscribe to this mod's changes

testing-best-practices is a skill published in the GitHub repository alleneubank/claude-code (52 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 34 tokens to every session and 1,065 once invoked, about $0.0002 per session on Opus 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-08-30.

Related

Other skills, from other repositories