Demo data · All use cases on this site are sample content written for development. They do not come from real sources or users, and scores are not real data.
Add unit tests to an untested legacy module
Have the agent describe the module's current behavior first, then write tests from that description so bugs don't end up baked into assertions.
Prompt
Read the code in src/billing/ and do not write any tests yet. Step 1: list the inputs, outputs and edge cases of each exported function. Step 2: once I confirm the description is correct, write unit tests for each function covering the normal path and at least two edge cases. Use the project's existing test setup and do not add dependencies.
Steps
- 1Start with a small module that has few dependencies
- 2Review the agent's behavior description and correct any misunderstanding
- 3Generate and run the tests; for each failure, decide whether the test or the code is wrong
Source
Demo case written by the ClawShow team for development. No external source.