// Generate intelligent, non-redundant test plans based on implementation changes. This skill should be used after implementing features to create comprehensive yet efficient test plans with proper coverage across unit, integration, API, and E2E tests without duplication.
| name | test-plan-generator |
| description | Generate intelligent, non-redundant test plans based on implementation changes. This skill should be used after implementing features to create comprehensive yet efficient test plans with proper coverage across unit, integration, API, and E2E tests without duplication. |
Analyze implementation changes and generate comprehensive, non-redundant test plans that provide appropriate coverage without over-testing. Works with any language, framework, or architecture by analyzing change patterns rather than specific technologies.
Use this skill when:
test-executor to runIdentify Changed Files
git diff main...HEAD --name-only
# or
git diff <base-branch>...HEAD --name-only
Analyze Change Types
Read Implementation
Based on changes, identify which test types are appropriate:
When:
Tests:
Skip E2E if: API is internal only (not user-facing)
When:
Tests:
Skip API tests if: E2E tests already cover backend through UI
When:
Tests:
When:
Tests:
Consider skipping if: Logic is tested adequately by integration/E2E tests
When:
Tests:
Key Principle: Don't test the same thing twice at different levels.
Backend API:
POST /api/formsFrontend:
Test Strategy:
โ Good (Non-Redundant):
## E2E Tests
- [ ] User can create form, fill details, and submit successfully
- [ ] User sees error message for invalid email
- [ ] User sees success confirmation after submission
## API Tests (only edge cases not covered by E2E)
- [ ] API returns 400 for malformed JSON
- [ ] API handles concurrent submissions correctly
## Unit Tests (complex logic not easily tested via E2E)
- [ ] SIRET validation algorithm works correctly
โ Bad (Redundant):
## E2E Tests
- [ ] User can submit form
## API Tests (redundant with E2E)
- [ ] POST /api/forms creates form in database
- [ ] POST /api/forms returns 200 on success
- [ ] POST /api/forms validates email format
## Unit Tests (redundant with E2E and API)
- [ ] FormController.Create method works
- [ ] Email validation works
Redundancy: E2E test already covers API behavior and validation through UI. No need for separate API tests unless testing edge cases not accessible via UI.
Create test-plan.md with structure:
# Test Plan: [Feature Name]
**Date:** [Date]
**Implementation:** [Branch/PR]
## Overview
[Brief description of what was implemented]
## Changed Files
- `path/to/file1.ts`
- `path/to/file2.cs`
## Test Strategy
[Explanation of test approach and coverage]
---
## E2E Tests (Priority: High)
- [ ] Test 1: [Description]
- [ ] Test 2: [Description]
---
## API Tests (Priority: Medium)
- [ ] Test 1: [Description]
- [ ] Test 2: [Description]
---
## Unit Tests (Priority: Low)
- [ ] Test 1: [Description]
- [ ] Test 2: [Description]
---
## Performance Tests (Optional)
- [ ] Test 1: [Description]
---
## Notes
[Any important testing considerations]
Purpose: Test complete user flows from UI to backend
When to Include:
Example Tests:
- [ ] User can register, login, and access dashboard
- [ ] User can create form with all field types
- [ ] User can submit form and see confirmation
- [ ] Admin can view all submissions for a form
How to Execute: Browser automation (Playwright, Cypress, etc.)
Purpose: Test backend endpoints directly
When to Include:
Example Tests:
- [ ] POST /api/forms returns 400 for invalid JSON
- [ ] GET /api/forms?page=999 handles non-existent page
- [ ] PUT /api/forms/{id} returns 404 for non-existent form
- [ ] API rate limiting works (429 after 100 requests/min)
How to Execute: curl, httpie, or API test framework
Purpose: Test individual functions/methods in isolation
When to Include:
Example Tests:
- [ ] ValidateSIRET returns true for valid SIRET
- [ ] ValidateSIRET returns false for invalid checksum
- [ ] CalculatePrice handles discount correctly
- [ ] ParseDate handles multiple date formats
How to Execute: Test framework (Jest, xUnit, pytest, etc.)
Skip if: Logic is adequately covered by integration or E2E tests
Purpose: Test interactions between components
When to Include:
Example Tests:
- [ ] User creation persists to database correctly
- [ ] Email service integrates with Microsoft Graph API
- [ ] File upload saves file and creates database record
- [ ] Redis caching works with API queries
How to Execute: Test framework with real dependencies (or test doubles)
Purpose: Test speed, scalability, resource usage
When to Include:
Example Tests:
- [ ] GET /api/submissions returns in <200ms with 10,000 records
- [ ] File upload handles 100MB files without timeout
- [ ] Dashboard loads in <1s with 50 forms
- [ ] API handles 100 concurrent requests without errors
How to Execute: Load testing tools (ab, wrk, k6, JMeter)
Mark priorities in test plan:
## E2E Tests (Priority: High)
- [ ] ๐ด User authentication flow
- [ ] ๐ด Form submission and data persistence
## API Tests (Priority: Medium)
- [ ] ๐ก Error handling for malformed requests
- [ ] ๐ก Pagination edge cases
## Unit Tests (Priority: Low)
- [ ] ๐ข Date formatting utility
- [ ] ๐ข String truncation helper
Changes:
Tests Needed:
## E2E Tests
- [ ] Create resource via UI
- [ ] View resource in list
- [ ] Edit resource
- [ ] Delete resource
## API Tests (edge cases)
- [ ] POST validates required fields
- [ ] PUT returns 404 for non-existent resource
- [ ] DELETE is idempotent
Changes:
Tests Needed:
## Unit Tests (thorough)
- [ ] Valid inputs pass validation
- [ ] Invalid inputs fail with correct errors
- [ ] Edge cases (boundary values, null, empty)
## Integration Tests
- [ ] Validation integrated into API correctly
Skip E2E if validation errors are covered by unit + integration tests.
Changes:
Tests Needed:
## E2E Tests (light)
- [ ] Component renders correctly
- [ ] User interactions work
- [ ] Responsive behavior
## Visual Regression (optional)
- [ ] Screenshot comparison tests
Skip API and unit tests (no backend changes).
Changes:
Tests Needed:
## Migration Tests
- [ ] Migration applies successfully
- [ ] Migration rollback works
- [ ] Existing data remains intact
- [ ] New constraints are enforced
## Integration Tests
- [ ] API works with new schema
Changes:
Tests Needed:
## Performance Tests
- [ ] Response time improved (before/after benchmark)
- [ ] Resource usage decreased
- [ ] Scalability improved
## Regression Tests
- [ ] Functionality unchanged (no bugs introduced)
def generate_test_plan(changes):
tests = []
# Analyze changes
backend_changes = filter(is_backend, changes)
frontend_changes = filter(is_frontend, changes)
db_changes = filter(is_database, changes)
# Determine E2E needs
if frontend_changes or user_facing(backend_changes):
tests.extend(generate_e2e_tests(changes))
# Determine API needs
if backend_changes and not fully_covered_by_e2e(backend_changes):
tests.extend(generate_api_tests(backend_changes))
# Determine unit test needs
complex_logic = find_complex_logic(changes)
if complex_logic:
tests.extend(generate_unit_tests(complex_logic))
# Determine integration test needs
if db_changes or external_integrations(changes):
tests.extend(generate_integration_tests(changes))
# Determine performance test needs
if is_performance_critical(changes):
tests.extend(generate_performance_tests(changes))
# Remove redundant tests
tests = deduplicate(tests)
return tests
scripts/analyze_changes.py - Analyze git diff to determine test needsreferences/test-strategies.md - Test strategies by change type