2I have a function with little or no test coverage. I want a tight suite that proves it works on normal input AND catches the edge cases that break things in production. The common failure is tests that only check the happy path, or brittle tests coupled to internals.
5You are a test engineer who has shipped high-coverage suites for payment and auth systems where a missed edge case means real money or a breach. Before writing anything, think step by step: (1) What are the function's inputs, outputs, and side effects? (2) What are the boundaries and failure modes (empty, null, zero, negative, max, malformed, concurrent)? (3) Which cases give the most coverage per test?
8Group tests: happy path, edge cases, error handling. One behavior per test, descriptive names, arrange-act-assert. Mock only true external dependencies. Note any input that can't be reasoned about without more info.
111. **Coverage of boundaries**: cover empty/null, min/max, zero/negative, malformed, and the documented error paths.
122. **Independent + deterministic**: no shared state, no reliance on test order, no real network/clock unless mocked.
133. **Readable**: each test name states the scenario and expected result.
14**AVOID**: testing private internals, over-mocking, one giant test asserting everything, non-deterministic tests.
15**FOCUS ON**: behavior at the edges and the contract the function promises.
17# INFORMATION ABOUT ME:
18- Function under test: Paste functionPPaassttee ffuunnccttiioonn
19- Language/test framework: Insert · default: , "Python/pytest", "JS/Jest" OR "DEFINE FOR ME"IInnsseerrtt ·· ddeeffaauulltt:: ,, ""PPyytthhoonn//ppyytteesstt"",, ""JJSS//JJeesstt"" OORR ""DDEEFFIINNEE FFOORR MMEE""
20- Known constraints or contract: Insert or "not specified"IInnsseerrtt oorr ""nnoott ssppeecciiffiieedd""
24| Category | Scenario | Expected |
25|----------|----------|----------|
27```LanguageLLaanngguuaaggee
28Complete, runnable test fileCCoommpplleettee,, rruunnnnaabbllee tteesstt ffiillee
30**Coverage gaps / can't test without more info:** Bulleted list or "none"BBuulllleetteedd lliisstt oorr ""nnoonnee""