Unit Test Generation
Core Workflow
- Identify the unit under test, behavior changed, dependencies, inputs, outputs, and edge cases.
- Read existing tests and local test patterns before proposing new tests.
- Define test cases for normal behavior, boundaries, invalid inputs, errors, and regressions.
- Prefer deterministic tests with minimal mocking and clear assertions.
- Include fixture needs, setup/teardown, and test command.
- State what remains untested and whether integration or E2E coverage is needed.
Safety Rules
- Do not claim tests pass without command output.
- Do not add brittle tests that assert implementation details unless that is the contract.
- Do not use production data, real credentials, or live external services.
Deliverable Shape
For unit test work, provide:
- Unit and behavior under test
- Test case list
- Fixtures and mocks
- Edge and regression cases
- Test file or command
- Coverage gaps
- Validation notes
References
- Read
references/unit-test-generation-checklist.mdwhen planning or adding unit tests.