| name | effective-testing-methods |
| description | Design, add, or amend tests for changed behavior with surface-appropriate coverage. Use when test design or test-file changes are part of the task; do not activate merely to run an existing test command, and use Playwright only when a browser-visible flow changed. |
Effective Testing Methods
Mission
Create the smallest reliable test set that proves changed behavior and meaningful failure paths.
Scope Boundary
This skill owns test selection and test implementation quality. It does not own overall change risk, command orchestration, or release decisions.
Use:
- Regression Prevention for implementation and change-safety evidence.
- Scripted Command Execution for repeatable test command workflows.
Running existing tests does not automatically activate this skill.
Test Impact Map
Before editing tests, identify:
- changed behavior or contract
- relevant existing tests
- important success, failure, and edge paths
- the cheapest layer that observes the behavior
- residual behavior that cannot be exercised locally
Surface-Driven Layer Selection
Select only applicable layers:
static: types, schemas, lint, or compile-time contracts
unit: deterministic logic and boundary cases
integration: database, service, file, process, or API boundaries
contract: request/response, event, serialization, and compatibility
browser: user-visible rendering and interaction in a web application
runtime_smoke: executable startup or critical operational path
Playwright is allowed only when a browser-visible flow changed or explicit browser verification was requested. Command-line, library, backend-only, documentation, and policy work must not acquire a browser requirement.
Test Construction Rules
- Test observable behavior rather than incidental implementation details.
- Prefer focused deterministic cases over broad brittle scenarios.
- Include negative and failure cases proportional to risk.
- Control time, randomness, network, and global state.
- Reuse existing fixtures and repository conventions.
- Ensure each test fails for the intended reason before trusting it.
Read test-patterns.md for unit, integration, contract, and browser patterns.
Execution Order
Run the cheapest relevant checks first:
- static or compile checks
- unit tests
- integration and contract tests
- targeted browser or runtime checks
- broader suites only when impact or release policy requires them
If a prerequisite is unavailable, record the exact blocker, run non-blocked relevant layers, and provide the precise rerun command. Never substitute an unrelated passing layer for a blocked critical layer.
Authority and Artifact Policy
- Activating this skill grants no authority to run, create, or modify tests.
- Respect explicit instructions not to run or modify tests.
- Test-authoring permission does not imply permission to install dependencies or mutate external state.
- Report executed, skipped, blocked, and newly authored coverage separately.
- Do not claim full coverage from test discovery or static inspection alone.
Output Contract
Provide:
- behavior-to-test map
- tests added or amended by applicable layer
- execution results
- blocked or residual coverage
Quality Gates
- Every test maps to changed or explicitly protected behavior.
- No irrelevant layer was required.
- Browser tests exist only for browser behavior.
- Failure paths and compatibility boundaries receive proportional coverage.
- Evidence distinguishes authored, executed, and blocked validation.
Related Skills