Test layering, execution, and CI guidance across unit, integration, and e2e. Use when designing tests, writing test cases, or planning test strategy for a module.
81
Quality
72%
Does it follow best practices?
Impact
97%
1.64xAverage score across 3 eval scenarios
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./data/skills-md/0xbigboss/claude-code/testing-best-practices/SKILL.mdEngage when:
*.spec.md, SPEC.md, spec/*.md)/specout completesPurpose: verify individual functions and invariants in isolation.
Purpose: verify interactions between components and external services.
Purpose: verify real user workflows through the full stack.
if (process.env.TEST) branches, no test-specific exports, no test backdoors.sleep/waitForTimeout.expect, async assertions) over manual loops.Before generating test cases:
Keep outputs actionable and concise. Use markdown, not rigid JSON schemas.
Brief summary of what to test and at which layer:
## Test Strategy
- **Unit**: [functions/modules], data-driven + property-based for [invariants]
- **Integration**: [API contracts], auth scoping, error envelopes
- **E2E**: [workflows], happy-path flows against real servicesTabular case listing per function or flow:
## Test Matrix
### `functionName`
| ID | Category | Name | Input | Expected |
|----|----------|------|-------|----------|
| HP-01 | happy_path | basic uppercase | "hello" | "HELLO" |
| BV-01 | boundary | empty string | "" | "" |
| ERR-01 | error | null input | null | INVALID_ARGUMENT |
| EDGE-01 | edge | unicode combining | "cafe\u0301" | "CAFE\u0301" |Case ID scheme: {CATEGORY}-{NN} (HP, BV, ERR, EDGE). Append-only; never renumber.
Ordered steps to write and run the tests:
## Implementation Plan
1. Add factory for [fixture] using seeded data
2. Write parameterized unit tests for [function] (X cases)
3. Write integration test for [API endpoint] auth + error contract
4. Write e2e flow for [workflow] with preflight checks
5. Run suite: `[command]`5342bca
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.