Skill Wiki v0.1.0
principle @community/principle-test-pyramid

Test Pyramid

Structure tests as a pyramid: 70% unit tests (pure functions, single class/component, no I/O — milliseconds each), 20% integration tests (multi-component or single-service against real DB/queue with test fixtures — secon…

Skill
@community
Domain
testing
Version
1.0.0
Quality
4.0
Edges
6 out · 9 in
Tokens
284/566/864
$ prime install @community/principle-test-pyramid

Projection

Always in _index.xml · the agent never has to ask for this.

TestPyramid [principle] v1.0.0

A healthy test suite has many fast unit tests, fewer integration tests, and few slow end-to-end tests. The pyramid shape (wide base of unit tests, narrow tip of E2E) inverts the common dysfunction (the 'ice cream cone' or 'cupcake') and produces a suite that is fast, deterministic, and trustworthy.

Structure tests as a pyramid: 70% unit tests (pure functions, single class/component, no I/O — milliseconds each), 20% integration tests (multi-component or single-service against real DB/queue with test fixtures — seconds each), 10% end-to-end tests (full system, browser-driven UI flows — tens of seconds each). Run unit tests on every save (< 5s); integration tests on every PR (< 5min); E2E tests on every merge to main + nightly (< 30min). E2E tests focus on critical user flows (signup, checkout, login) — NOT exhaustive coverage. Add E2E only when the integration layer cannot exercise the surface (real browser-only behaviors: focus management, keyboard, layout, network). Never substitute E2E for missing unit tests — the cost differential is 100–10,000x in execution time.

Source

prime-system/examples/frontend-design/primes/compiled/@community/principle-test-pyramid/atom.yaml

Compiled at 2026-05-07