Skip to content
Development
Agent

test-types-and-pyramid

Not all tests are equal. Choosing the right *level* for a given behavior is the difference between a suite that gives fast, reliable signal and one that is slow, flaky, and ignored.

From plugin
skills
954 skills54 agents

Claude Code

$ npx -y skills add vanara-agents/skills --agent claude-code

Agent definition

test-types-and-pyramid.md

Test Types and the Test Pyramid

Not all tests are equal. Choosing the right *level* for a given behavior is the difference between a suite that gives fast, reliable signal and one that is slow, flaky, and ignored.

The pyramid

        /\        E2E / UI        few, slow, high-confidence, brittle
       /  \
      /----\      Integration     some, medium speed, real collaborators
     /      \
    /--------\    Unit             many, fast, isolated, cheap

Push the bulk of your assertions **down** to the unit level where they are fast and stable. Use the higher levels sparingly to prove the pieces wire together, not to re-test logic that unit tests already cover. An inverted pyramid (mostly E2E) is slow and flaky.

Unit tests

  • **Scope:** one function, method, or class in isolation. Collaborators that cross a process

or I/O boundary are replaced with doubles.

  • **Cost:** milliseconds. Run thousands on every save.
  • **Owns:** business logic, pure functions, edge cases, error branches, algorithms.
  • **Rule of thumb:** if a behavior can be tested at the unit level, test it there.

Integration tests

  • **Scope:** several real units working together, or one unit against a real adjacent

dependency (a database, an in-memory queue, a local HTTP server).

  • **Cost:** tens to hundreds of milliseconds. Often need setup/teardown.
  • **Owns:** the seams โ€” ORM queries against a real schema, repository wiring, serialization,

framework request/response handling, transaction behavior.

  • **Avoid:** re-testing branch logic here that a unit test already covers; keep these about

the *wiring*, not the *rules*.

End-to-end (E2E) tests

  • **Scope:** the whole system through its real entry point โ€” a browser, a CLI, a public API.
  • **Cost:** seconds. Slow, infrastructure-heavy, the most prone to flakiness.
  • **Owns:** a handful of critical user journeys (sign up, checkout, the money path).
  • **Hand off:** browser-driven E2E belongs to the **e2e-playwright** skill, not this agent.

What goes where โ€” a decision guide

| Question | Level | |---|---| | Does `applyDiscount(49.99, 10)` round correctly? | Unit | | Does an invalid percentage throw `RangeError`? | Unit | | Does the repository persist and re-read an order from Postgres? | Integration | | Does `POST /orders` return `201` with a `Location` header? | Integration | | Can a user add to cart and complete checkout in the browser? | E2E |

Coverage as a signal, not a goal

The 80% target is a floor that flags untested regions, not a trophy. 100% line coverage with assertion-free tests proves nothing. Chase **branch and behavior** coverage โ€” every error path and boundary โ€” over raw line percentage. Use `scripts/check-coverage.mjs` to gate the floor in CI, and read the uncovered lines to find the cases you forgot.

Read more
@vanara-agents
Ships withskills

๐Ÿ’ Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code โ€” free, Apache-2.0, install with one command.

917 skills54 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
9
Star history of vanara-agents/skills on GitHub, a chart by star-history.com

Other agents on skills.

AGENT

AGENT

Agent

Use when designing a new HTTP/GraphQL API or changing an existing one โ€” modeling resources, defining endpoint contracts, choosingโ€ฆ

review-notes

review-notes

Agent

This shows how the api-designer agent reviews a flawed draft. Findings are severity-ranked so the implementer fixes theโ€ฆ

contract-and-openapi

contract-and-openapi

Agent

The contract is the deliverable. Express it as an **OpenAPI 3.1** document so it is human-readable *and* machine-checkable. Thisโ€ฆ

design-checklist

design-checklist

Agent

Run through this before declaring an API contract done. It is ordered the way you should *design*: resources first, cross-cuttingโ€ฆ

versioning-and-evolution

versioning-and-evolutiโ€ฆ

Agent

APIs are forever once published: a consumer you've never met may depend on any field you expose. Design so you can **add withoutโ€ฆ

pr-comment-template

pr-comment-template

Agent

Copy-paste templates for leaving review comments. Keep each comment to one finding: an anchor, the problem, and the fix.

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UIโ€ฆ

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research acrossโ€ฆ

react5d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such asโ€ฆ

codex5d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hardโ€ฆ

caveman6d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about test-types-and-pyramid.

Which coding agents can use test-types-and-pyramid?
test-types-and-pyramid installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.