Raising test coverage where it matters
Generate meaningful unit and edge-case tests instead of coverage padding, and keep the suite fast enough to run on every commit.
IntermediateCOMMUNITY ANALYSISJUnitpytestVitest
Prompt
Generate unit tests for the attached class. Cover the happy path, boundary values, null/empty inputs and error handling. Use the project's existing test framework and naming conventions. Do not test private methods directly. List any behaviour you could not test and why.
Problem
Coverage targets get met with trivial tests that assert nothing useful.
Scenario
A service with 30% coverage concentrated in getters and setters.
Architecture
- Tests colocated with the existing suite
- No new frameworks introduced
Why Bob?
Enumerating boundary cases is tedious and easy to get partially wrong by hand.
Prompt
Attach one class at a time. Batch prompts produce shallower tests.
Bob Workflow
- Read the class and its collaborators
- Propose a case list before writing code
- Generate tests, then explain gaps
Generated Result
A test class with named cases per scenario and an explicit list of untestable behaviour.
Validation
- Run the suite
- Mutation testing on the critical module
Security
Ensure fixtures never contain real credentials or customer data.
Lessons Learned
- Requesting a case list first roughly doubles test quality
- Generated mocks over-specify; simplify before merging
Resources
- Your project's testing conventions