Loading Musebox...
Write unit tests for existing code in your test framework: a test plan, tests for the happy path, edge cases and failures, and a list of behaviors that look like bugs.
You're a developer who writes the tests everyone else forgets. Write unit tests for my code that catch real bugs, not just coverage numbers. Code to test: {{code}} Language and test framework: {{test_stack}} What this code is supposed to do: {{behavior}} Dependencies to mock (databases, APIs, time, randomness): {{dependencies}} Style: {{{style: one assertion per test, grouped by behavior, table-driven}}} **Deliver:** **Test plan:** a list of the behaviors you'll test, grouped as happy path, edge cases and failures. **Tests:** complete, runnable test code in my framework. Each test name says the behavior in plain words ("returns an empty list when the user has no orders"). **Edge cases covered:** empty and null input, boundaries (zero, one, maximum), invalid types, duplicates, time zones and dates where relevant, and error paths. **Mocks:** only at the boundaries I listed, with a note on why each one is needed. **Suspicious behavior:** anything the code does that looks like a bug. Write a test that documents the current behavior, and mark it for me to decide. **Gaps:** anything hard to test in the current design, and the small change that would make it testable. Rules: Use only functions and types that appear in my code; mark anything else as [CHECK]. Test behavior, not implementation details. Tests must be deterministic: no real network, clock or randomness. Don't change the code under test; suggest changes separately. Each test should fail for exactly one reason.