Test Strategy
Design test strategies, write tests, and review test quality.
Analysis Process
- Read existing tests -- understand the project's test conventions (describe/it structure, naming, helpers)
- Identify test types needed -- unit, integration, E2E based on the scope of changes
- Map edge cases -- boundary values, empty inputs, error states, concurrency scenarios
- For frontend scope, start from the behavior contract -- read the project's Gherkin scenarios and coverage map, identify which scenario IDs this work adds or changes, and treat each required scenario-platform obligation as a strategy line item per the
bdd-e2e-coverage rule
- Check coverage gaps -- run existing tests to understand current coverage of affected files
- Design verification commands -- proof commands that empirically demonstrate the code works
Test Writing Process
- Analyze the source file to understand its functionality
- Identify untested code paths, edge cases, and error conditions
- Write comprehensive, meaningful tests (not just coverage padding)
- Follow the project's existing test patterns and conventions
- Ensure tests are readable and maintainable
Output Format
Structure findings as:
## Test Analysis
### Test Matrix
| Component | Test Type | What to Test | Priority |
|-----------|-----------|-------------|----------|
### Edge Cases
- [edge case] -- why it matters
### Coverage Targets
- `path/to/file.ts` -- current: X%, target: Y%
### Test Patterns (from codebase)
- Pattern: [description] -- found in `path/to/test.spec.ts`
### Verification Commands
| Task | Proof Command | Expected Output |
|------|--------------|-----------------|
### TDD Sequence
1. [first test to write] -- covers [behavior]
2. [second test] -- covers [behavior]
Rules
- Always run
bun run test to understand current test state before recommending or writing new tests
- Match existing test conventions -- do not introduce new test patterns
- For frontend work, the strategy is not complete until every required scenario-platform obligation has aligned e2e automation in the project's configured runner for that platform, or a dated waiver naming the runner limitation (
bdd-e2e-coverage). A unit test, a route boot, or a passing test on a different platform never seals an obligation
- For work that adds or changes persistent state, the strategy is not complete until each new entity is classified in the project's state contract and anything
fixture-owned has a sweep, per the reset-seed-coverage rule. Per-flow self-cleanup is not a strategy: a flow that deletes what it created only on its happy path leaks on every failure in between, which is how state pollution becomes an unreproducible flake months later
- Every test must have a clear "why" -- no tests for testing's sake
- Focus on testing behavior, not implementation details
- Verification commands must be runnable locally (no CI/CD dependencies)
- Prioritize tests that catch regressions over tests that verify happy paths
- Write comprehensive tests, not just coverage padding
1---2name: lisa-test-strategy3description: Test strategy design. Coverage matrix, edge cases, TDD sequence planning, test quality review. Behavior-focused testing over implementation details.4---56# Test Strategy78Design test strategies, write tests, and review test quality.910## Analysis Process11121. **Read existing tests** -- understand the project's test conventions (describe/it structure, naming, helpers)132. **Identify test types needed** -- unit, integration, E2E based on the scope of changes143. **Map edge cases** -- boundary values, empty inputs, error states, concurrency scenarios154. **For frontend scope, start from the behavior contract** -- read the project's Gherkin scenarios and coverage map, identify which scenario IDs this work adds or changes, and treat each required scenario-platform obligation as a strategy line item per the `bdd-e2e-coverage` rule165. **Check coverage gaps** -- run existing tests to understand current coverage of affected files176. **Design verification commands** -- proof commands that empirically demonstrate the code works1819## Test Writing Process20211. **Analyze the source file** to understand its functionality222. **Identify untested code paths**, edge cases, and error conditions233. **Write comprehensive, meaningful tests** (not just coverage padding)244. **Follow the project's existing test patterns** and conventions255. **Ensure tests are readable and maintainable**2627## Output Format2829Structure findings as:3031```text32## Test Analysis3334### Test Matrix35| Component | Test Type | What to Test | Priority |36|-----------|-----------|-------------|----------|3738### Edge Cases39- [edge case] -- why it matters4041### Coverage Targets42- `path/to/file.ts` -- current: X%, target: Y%4344### Test Patterns (from codebase)45- Pattern: [description] -- found in `path/to/test.spec.ts`4647### Verification Commands48| Task | Proof Command | Expected Output |49|------|--------------|-----------------|5051### TDD Sequence521. [first test to write] -- covers [behavior]532. [second test] -- covers [behavior]54```5556## Rules5758- Always run `bun run test` to understand current test state before recommending or writing new tests59- Match existing test conventions -- do not introduce new test patterns60- For frontend work, the strategy is not complete until every required scenario-platform obligation has aligned e2e automation in the project's configured runner for that platform, or a dated waiver naming the runner limitation (`bdd-e2e-coverage`). A unit test, a route boot, or a passing test on a different platform never seals an obligation61- For work that adds or changes persistent state, the strategy is not complete until each new entity is classified in the project's state contract and anything `fixture-owned` has a sweep, per the `reset-seed-coverage` rule. Per-flow self-cleanup is not a strategy: a flow that deletes what it created only on its happy path leaks on every failure in between, which is how state pollution becomes an unreproducible flake months later62- Every test must have a clear "why" -- no tests for testing's sake63- Focus on testing behavior, not implementation details64- Verification commands must be runnable locally (no CI/CD dependencies)65- Prioritize tests that catch regressions over tests that verify happy paths66- Write comprehensive tests, not just coverage padding