Write Tests
Workflow
Determine testing conventions:
- Check project config files (AGENTS.md, CLAUDE.md, README, Makefile, etc.) for test framework and patterns
- Look at existing tests for naming conventions, file placement, and style
- If not found, ask the user
Analyze existing code to identify untested areas:
- Core business logic
- Edge cases and error handling
- Integration points between modules
Prioritize tests by impact:
- HIGH: Critical paths, payment, auth, data mutation
- MEDIUM: User-facing features, API endpoints
- LOW: Utilities, helpers, formatters
Write tests that document behavior:
- Test WHAT the code does, not HOW it does it
- Use descriptive test names as specifications
- One assertion per test when possible
Focus on meaningful scenarios:
- Happy path: Expected normal usage
- Edge cases: Boundary values, empty inputs
- Error cases: Invalid inputs, failure modes
Avoid:
- Testing implementation details
- Excessive mocking that hides real bugs
- Tests that break on refactoring
Run tests to verify they pass and fail appropriately.
Hard Rule
Write tests that catch bugs, not tests that chase coverage.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.