Agent skill
test-generation
Generate comprehensive test cases for code
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/test-generation-duhenri9-wm3-digital
SKILL.md
Test Generation
When to Use
Use this skill when writing tests or when asked to add test coverage.
Test Categories
1. Unit Tests
- Test individual functions/methods
- Mock dependencies
- Cover edge cases
2. Integration Tests
- Test component interactions
- Real dependencies when possible
- Database transactions
3. Edge Cases to Cover
- Empty inputs
- Null/undefined values
- Maximum/minimum values
- Invalid types
- Concurrent access
- Network failures
Test Structure (AAA Pattern)
// Arrange - Set up test data and conditions
// Act - Execute the code under test
// Assert - Verify the results
Naming Convention
[methodName]_[scenario]_[expectedResult]
Example: calculateTotal_emptyCart_returnsZero
Coverage Goals
- Statements: 80%+
- Branches: 75%+
- Functions: 90%+
- Lines: 80%+
Didn't find tool you were looking for?