Initial commit
This commit is contained in:
25
skills/test-generation/SKILL.md
Normal file
25
skills/test-generation/SKILL.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Test Generation Skill
|
||||
|
||||
Comprehensive test suite generation with unit tests, integration tests, edge cases, and error handling.
|
||||
|
||||
## Description
|
||||
|
||||
Automated test generation analyzing code structure and generating thorough test coverage for existing implementations.
|
||||
|
||||
## What's Included
|
||||
|
||||
- **Examples**: Unit test generation, integration tests, edge cases
|
||||
- **Reference**: Test patterns, coverage strategies
|
||||
- **Templates**: Test suite templates for different frameworks
|
||||
|
||||
## Use When
|
||||
|
||||
- Need test coverage for existing code
|
||||
- Improving low coverage areas
|
||||
- Systematic test creation
|
||||
|
||||
## Related Agents
|
||||
|
||||
- `test-generator`
|
||||
|
||||
**Skill Version**: 1.0
|
||||
36
skills/test-generation/examples/INDEX.md
Normal file
36
skills/test-generation/examples/INDEX.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Test Generator Examples
|
||||
|
||||
Real-world examples of comprehensive test suite generation for frontend components, backend APIs, and test coverage improvement.
|
||||
|
||||
## Files in This Directory
|
||||
|
||||
### [react-component-testing.md](react-component-testing.md)
|
||||
Complete example of generating test suite for React component with TanStack Query - from no tests to 100% coverage. Shows unit tests, integration tests, user interaction tests, and accessibility tests.
|
||||
|
||||
**Scenario**: Payment form component with validation, API calls, and error handling - initially untested
|
||||
**Result**: 42 tests generated, 100% coverage, caught 3 bugs during testing
|
||||
**Technologies**: React 19, Vitest, Testing Library, TanStack Query
|
||||
|
||||
### [api-endpoint-testing.md](api-endpoint-testing.md)
|
||||
Backend API testing example showing test generation for FastAPI endpoints - authentication, validation, database operations, and error handling.
|
||||
|
||||
**Scenario**: User management API endpoints with CRUD operations - 35% test coverage
|
||||
**Result**: Coverage improved from 35% → 94%, 67 tests generated, found 5 edge case bugs
|
||||
**Technologies**: FastAPI, pytest, SQLModel, PostgreSQL
|
||||
|
||||
### [test-coverage-workflow.md](test-coverage-workflow.md)
|
||||
Step-by-step workflow for analyzing low-coverage codebase and systematically generating tests to reach 80%+ coverage.
|
||||
|
||||
**Scenario**: Legacy codebase with 42% coverage needs improvement for production deployment
|
||||
**Result**: Coverage 42% → 87% over 3 days, 156 tests generated, zero production bugs first month
|
||||
**Technologies**: Multi-language (TypeScript + Python), Vitest + pytest
|
||||
|
||||
## Navigation
|
||||
|
||||
**Parent**: [Test Generator Agent](../test-generator.md)
|
||||
**Reference**: [Reference Index](../reference/INDEX.md)
|
||||
**Templates**: [Templates Index](../templates/INDEX.md)
|
||||
|
||||
---
|
||||
|
||||
Return to [agent documentation](../test-generator.md)
|
||||
39
skills/test-generation/reference/INDEX.md
Normal file
39
skills/test-generation/reference/INDEX.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# Test Generator Reference Guide
|
||||
|
||||
Quick-lookup patterns and best practices for test generation across technologies.
|
||||
|
||||
## Files in This Directory
|
||||
|
||||
### [testing-patterns.md](testing-patterns.md)
|
||||
Comprehensive patterns for Vitest (TypeScript) and pytest (Python) - from basic unit tests to advanced mocking strategies.
|
||||
|
||||
**When to use**: Writing tests, reviewing test code, establishing patterns
|
||||
**Key topics**: AAA pattern, fixtures, mocking, async testing, TanStack Query patterns
|
||||
|
||||
### [test-structure-guide.md](test-structure-guide.md)
|
||||
How to organize test files, naming conventions, test suite structure, and file organization for maximum maintainability.
|
||||
|
||||
**When to use**: Organizing test suites, structuring new projects
|
||||
**Key topics**: File naming, directory structure, test grouping with describe blocks
|
||||
|
||||
### [mocking-strategies.md](mocking-strategies.md)
|
||||
Complete guide to mocking - when to mock, how to mock, mock verification, and avoiding over-mocking.
|
||||
|
||||
**When to use**: Testing code with external dependencies
|
||||
**Key topics**: API mocking, database mocking, module mocking, spy vs stub vs mock
|
||||
|
||||
### [coverage-standards.md](coverage-standards.md)
|
||||
What different coverage percentages mean, when to aim for different levels, and how to interpret coverage reports.
|
||||
|
||||
**When to use**: Setting coverage goals, interpreting coverage gaps
|
||||
**Key topics**: 80% rule, critical path coverage, diminishing returns
|
||||
|
||||
## Navigation
|
||||
|
||||
**Parent**: [Test Generator Agent](../test-generator.md)
|
||||
**Examples**: [Examples Index](../examples/INDEX.md)
|
||||
**Templates**: [Templates Index](../templates/INDEX.md)
|
||||
|
||||
---
|
||||
|
||||
Return to [agent documentation](../test-generator.md)
|
||||
52
skills/test-generation/templates/INDEX.md
Normal file
52
skills/test-generation/templates/INDEX.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# Test Generator Templates
|
||||
|
||||
Copy-paste templates for common testing scenarios - customize for your needs.
|
||||
|
||||
## Files in This Directory
|
||||
|
||||
### [unit-test-template.md](unit-test-template.md)
|
||||
Ready-to-use unit test templates for TypeScript (Vitest) and Python (pytest) with AAA pattern, fixtures, and common test cases.
|
||||
|
||||
**When to use**: Creating new unit test files
|
||||
**Languages**: TypeScript, Python
|
||||
|
||||
### [integration-test-template.md](integration-test-template.md)
|
||||
Templates for integration tests covering API endpoints, database interactions, and multi-component workflows.
|
||||
|
||||
**When to use**: Testing interactions between components or services
|
||||
**Languages**: TypeScript, Python
|
||||
|
||||
### [test-fixtures-template.md](test-fixtures-template.md)
|
||||
Templates for test fixtures, factories, and test data builders with realistic examples.
|
||||
|
||||
**When to use**: Setting up test data and shared fixtures
|
||||
**Languages**: TypeScript, Python
|
||||
|
||||
### [test-plan-template.md](test-plan-template.md)
|
||||
Comprehensive test plan template for feature development with coverage goals, risk assessment, and test strategy.
|
||||
|
||||
**When to use**: Planning test coverage for new features or improvements
|
||||
**Format**: Markdown checklist
|
||||
|
||||
## Usage
|
||||
|
||||
1. **Copy template** to your test directory
|
||||
2. **Replace placeholders** (e.g., `ComponentName`, `YourService`)
|
||||
3. **Customize** test cases for your specific needs
|
||||
4. **Add tests** as you discover edge cases
|
||||
|
||||
## Template Conventions
|
||||
|
||||
**Placeholders**:
|
||||
- `ComponentName` - Replace with your component name
|
||||
- `functionName` - Replace with your function name
|
||||
- `YourService` - Replace with your service class name
|
||||
- `...` - Add more test cases
|
||||
|
||||
**Comments**:
|
||||
- `// TODO:` - Action items to complete
|
||||
- `// CUSTOMIZE:` - Areas to customize for your use case
|
||||
|
||||
---
|
||||
|
||||
Return to [agent documentation](../test-generator.md)
|
||||
Reference in New Issue
Block a user