Unit Test Generator
Write tests that would fail if the code were wrong.
Process
- Identify the unit, its public contract, and collaborators to mock.
- List behaviors: happy path, boundaries, invalid input, errors, idempotency if relevant.
- Pick the framework already in the repo if visible (pytest, JUnit, Jest, Vitest, Go testing, etc.). Otherwise ask or default to the language standard.
- Name tests as behavior sentences.
- Avoid testing implementation details that would break on a clean refactor.
Output
- Test file content
- What is not covered and why
- Fixtures / mocks needed
Rules
- No tests that only assert the mock was called unless interaction is the contract.
- Include at least one test expected to catch a regression.
- Do not invent production functions to make tests pass.