# Document Test Strategy Prompt (v1)
## π― Goal
Create comprehensive documentation of testing approach, standards, and maintenance practices for the team.
## π₯ Context (ask if missing)
1. **Completed Coverage Improvement** β implemented tests, achieved coverage
2. **Test Implementation** β patterns used, tools configured, utilities created
3. **Coverage Metrics** β final coverage percentages, quality measures
4. **Testing Patterns Used** β conventions, approaches, best practices applied
## π¦ Skip if
- Comprehensive test documentation already exists or minimal testing implementation completed
## π Checklist
- **Strategy Documentation**
- [ ] Document overall testing philosophy and approach
- [ ] Define testing standards and conventions
- [ ] Explain coverage goals and rationale
- [ ] Document test categorization and priorities
- **Implementation Guide**
- [ ] Create developer guide for writing tests
- [ ] Document testing patterns and examples
- [ ] Explain mocking strategies and utilities
- [ ] Provide troubleshooting and debugging guide
- **Maintenance Procedures**
- [ ] Define test maintenance responsibilities
- [ ] Create procedures for test updates
- [ ] Document coverage monitoring process
- [ ] Establish test quality review process
- **Team Resources**
- [ ] Create quick reference guides
- [ ] Document tool configurations
- [ ] Provide examples and templates
- [ ] Set up knowledge sharing practices
## π€ Output
**File:** `docs/testing/test-strategy.md`
Sections:
1. **Testing Philosophy** β approach, principles, goals
2. **Standards & Conventions** β naming, structure, patterns
3. **Implementation Guide** β how to write tests, examples
4. **Tools & Configuration** β framework setup, utilities
5. **Coverage & Quality** β goals, monitoring, reporting
6. **Maintenance** β responsibilities, procedures, updates
7. **Resources** β references, examples, troubleshooting
## π Documentation Components
### Developer Quick Start
```markdown
## Writing Your First Test
1. Create test file: `src/utils/__tests__/helper.test.js`
2. Import function: `import { helper } from '../helper';`
3. Write test: `describe('helper', () => { ... })`
```
### Testing Patterns
```markdown
## Common Patterns
- **Pure Functions**: Input β Function β Output
- **Async Operations**: Use await/async patterns
- **Error Handling**: Test error scenarios
- **Mocking**: Mock external dependencies
```
### Quality Standards
```markdown
## Test Quality Checklist
- [ ] Test names are descriptive
- [ ] Tests are isolated and independent
- [ ] Edge cases are covered
- [ ] Mocks are appropriate
```
## π― Key Documentation Areas
- **Testing Philosophy**: Why we test, what we test
- **Implementation Standards**: How to write good tests
- **Maintenance Process**: Keeping tests healthy
- **Tool Usage**: Effective use of testing tools
- **Quality Assurance**: Ensuring test reliability
## β‘οΈ Response Flow
Analyze implementation β Define standards β Create guides β Document procedures β Establish maintenance