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
1---2name: effective-testing-methods3description: 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.4---56# Effective Testing Methods78## Mission910Create the smallest reliable test set that proves changed behavior and meaningful failure paths.1112## Scope Boundary1314This skill owns test selection and test implementation quality. It does not own overall change risk, command orchestration, or release decisions.1516Use:17181. [Regression Prevention](../regression-prevention/SKILL.md) for implementation and change-safety evidence.192. [Scripted Command Execution](../scripted-command-execution/SKILL.md) for repeatable test command workflows.2021Running existing tests does not automatically activate this skill.2223## Test Impact Map2425Before editing tests, identify:26271. changed behavior or contract282. relevant existing tests293. important success, failure, and edge paths304. the cheapest layer that observes the behavior315. residual behavior that cannot be exercised locally3233## Surface-Driven Layer Selection3435Select only applicable layers:36371. `static`: types, schemas, lint, or compile-time contracts382. `unit`: deterministic logic and boundary cases393. `integration`: database, service, file, process, or API boundaries404. `contract`: request/response, event, serialization, and compatibility415. `browser`: user-visible rendering and interaction in a web application426. `runtime_smoke`: executable startup or critical operational path4344Playwright 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.4546## Test Construction Rules47481. Test observable behavior rather than incidental implementation details.492. Prefer focused deterministic cases over broad brittle scenarios.503. Include negative and failure cases proportional to risk.514. Control time, randomness, network, and global state.525. Reuse existing fixtures and repository conventions.536. Ensure each test fails for the intended reason before trusting it.5455Read [test-patterns.md](references/test-patterns.md) for unit, integration, contract, and browser patterns.5657## Execution Order5859Run the cheapest relevant checks first:60611. static or compile checks622. unit tests633. integration and contract tests644. targeted browser or runtime checks655. broader suites only when impact or release policy requires them6667If 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.6869## Authority and Artifact Policy70711. Activating this skill grants no authority to run, create, or modify tests.722. Respect explicit instructions not to run or modify tests.733. Test-authoring permission does not imply permission to install dependencies or mutate external state.744. Report executed, skipped, blocked, and newly authored coverage separately.755. Do not claim full coverage from test discovery or static inspection alone.7677## Output Contract7879Provide:80811. behavior-to-test map822. tests added or amended by applicable layer833. execution results844. blocked or residual coverage8586## Quality Gates87881. Every test maps to changed or explicitly protected behavior.892. No irrelevant layer was required.903. Browser tests exist only for browser behavior.914. Failure paths and compatibility boundaries receive proportional coverage.925. Evidence distinguishes authored, executed, and blocked validation.9394## Related Skills9596- [Regression Prevention](../regression-prevention/SKILL.md): implementation and final-diff safety.97- [Scripted Command Execution](../scripted-command-execution/SKILL.md): deterministic test execution.98- [Pseudo-Agentic Automation](../pseudo-agentic-automation/SKILL.md): adaptive browser or graphical runtime work.