Loading...
Loading...
Use when choosing a testing strategy, right-sizing test coverage, or understanding test categories. Covers the Test Trophy model, test type tradeoffs, and guidance on balancing static analysis, unit, integration, and end-to-end tests. USE FOR: testing strategy, Test Trophy, test type selection, right-sizing test coverage, balancing test categories, choosing testing tools, test automation architecture DO NOT USE FOR: specific test category implementation (use static-analysis, unit-testing, integration-testing, e2e-testing, etc.), BDD specification authoring (use specs/documentation/gherkin)
npx skill4agent add tyler-r-kendrick/agent-skills testing"Write tests. Not too many. Mostly integration." — Kent C. Dodds
┌───────┐
│ E2E │ Few, high-confidence, slow, expensive
─┴───────┴─
┌─────────────┐
│ Integration │ Most tests here — best ROI
─┴─────────────┴─
┌───────────────────┐
│ Unit │ Isolated logic, fast, cheap
─┴───────────────────┴─
┌───────────────────────────┐
│ Static Analysis │ Free — catches bugs at write time
└───────────────────────────┘| Category | What It Tests | Speed | Confidence | Cost |
|---|---|---|---|---|
| Static Analysis | Types, syntax, lint rules, security patterns | Instant | Low-Medium | Free |
| Unit | Individual functions/classes in isolation | Fast | Medium | Low |
| Integration | Multiple units working together | Medium | High | Medium |
| E2E | Full user flows through the real system | Slow | Very High | High |
| Category | What It Tests | When to Use |
|---|---|---|
| Contract | API compatibility between services | Microservices / distributed systems |
| API | HTTP endpoints directly | REST/GraphQL APIs |
| Performance | Load, stress, scalability | Before launch, capacity planning |
| Visual | UI appearance / regression | Design systems, component libraries |
| Accessibility | WCAG compliance, screen readers | All user-facing apps |
| Acceptance | Business requirements (BDD) | Stakeholder-facing features |
| Chaos | System resilience under failure | Distributed systems, microservices |
| Category | % of Tests | Rationale |
|---|---|---|
| Static Analysis | Always on | Zero-cost, catches trivial bugs |
| Unit | ~20% | Pure logic, algorithms, edge cases |
| Integration | ~50% | Best confidence-per-dollar |
| E2E | ~20% | Critical user journeys only |
| Other (contract, perf, a11y, visual) | ~10% | As needed per project type |
| Project Type | Emphasize | Reduce |
|---|---|---|
| Library / SDK | Unit tests (public API surface) | E2E (no UI) |
| Microservices | Contract + integration | E2E (too many services) |
| Monolithic web app | Integration + E2E | Contract (single deploy) |
| Design system | Visual + accessibility | Performance |
| Real-time / trading | Performance + unit | Visual |
| Regulated / healthcare | Acceptance (BDD) + integration | — |
| Tool | Languages |
|---|---|
| TypeScript | JS/TS (type checking) |
| ESLint / Biome | JS/TS (linting) |
| Roslyn Analyzers | C# |
| Pylint / Ruff / mypy | Python |
| Semgrep | Multi-language SAST |
| Tool | Languages |
|---|---|
| Vitest / Jest | JS/TS |
| xUnit / NUnit / MSTest | C# |
| pytest | Python |
| JUnit / TestNG | Java |
| Go test | Go |
| Tool | Languages |
|---|---|
| Testcontainers | Java, .NET, Node, Python, Go |
| Vitest / Jest | JS/TS |
| xUnit + WebApplicationFactory | C# / ASP.NET |
| pytest | Python |
| Tool | Platforms |
|---|---|
| Playwright | Web (Chromium, Firefox, WebKit) |
| Cypress | Web (Chromium-based) |
| Selenium | Web (all browsers) |
| Appium | Mobile (iOS, Android) |
| Maestro | Mobile (iOS, Android) |
| Tool | Type |
|---|---|
| Pact | Consumer-driven contracts |
| PactFlow | Bi-directional contract testing |
| Spring Cloud Contract | JVM contract testing |
| Tool | Format |
|---|---|
| .http files | VS Code / JetBrains REST Client |
| Bruno | Git-friendly API collections |
| Postman / Newman | Collections + CLI runner |
| REST Client (VS Code) | Inline .http files |
| k6 | Scripted API + load testing |
| Tool | Type |
|---|---|
| k6 (Grafana) | Load / stress (JS scripts) |
| JMeter | Load / stress (GUI + CLI) |
| Gatling | Load / stress (Scala/Java) |
| Artillery | Load / stress (YAML config) |
| Lighthouse | Web performance audit |
| Tool | Integration |
|---|---|
| Chromatic | Storybook visual regression |
| Percy (BrowserStack) | Cross-browser visual diffs |
| BackstopJS | CSS regression (headless) |
| Playwright screenshots | Custom visual assertions |
| Tool | Type |
|---|---|
| axe-core / @axe-core/playwright | Automated WCAG checks |
| Pa11y | CLI accessibility audits |
| Lighthouse | Accessibility scoring |
| Storybook addon-a11y | Component-level checks |
| Tool | Languages |
|---|---|
| Cucumber | Java, JS, Ruby |
| SpecFlow / Reqnroll | C# |
| Behave | Python |
| Gauge | Multi-language (Markdown specs) |
| Godog | Go |
| Tool | Type |
|---|---|
| Chaos Monkey | Random VM termination (Netflix) |
| Gremlin | SaaS fault injection platform |
| Litmus | Kubernetes chaos engineering (CNCF) |
| Chaos Mesh | Kubernetes fault injection |
| Toxiproxy | TCP proxy for network faults |
| AWS Fault Injection Service | AWS-native chaos |
| Azure Chaos Studio | Azure-native chaos |
CI Pipeline
│
├── Static Analysis ──► ESLint + TypeScript + Semgrep (on every commit)
│
├── Unit Tests ────────► Vitest / xUnit / pytest (on every commit)
│
├── Integration Tests ─► Testcontainers + API tests (on every PR)
│
├── Contract Tests ────► Pact verify (on every PR)
│
├── E2E Tests ─────────► Playwright critical paths (on merge to main)
│
├── Visual Tests ──────► Chromatic snapshot comparison (on every PR)
│
├── A11y Tests ────────► axe-core in Playwright (on every PR)
│
├── Performance Tests ─► k6 load tests (nightly / pre-release)
│
└── Chaos Tests ────────► Litmus / Gremlin experiments (pre-release / game days)