← ClaudeAtlas

testdoc-writelisted

A disciplined procedure for writing characterization and regression tests for one function, class or bug: read the code, list its behaviours and edge cases, write tests that are named after the behaviour, prove each test can fail by breaking the code on purpose, and keep the tests independent of order and of the clock. Use when the user says "write tests for this function", "add a regression test for this bug", "characterize this legacy code", "cover this module", "pin down the current behavior", or "make sure this never breaks again".
vivekbhange-hub/test-doctor-skill · ★ 0 · Testing & QA · score 75
Install: claude install-skill vivekbhange-hub/test-doctor-skill
# testdoc-write: tests that can actually fail Most weak tests were written fast and never seen red. This procedure has one non-negotiable step: every test is shown to fail when the code is wrong, then the code is put back. ## Inputs - The target: a function, class, module, or a bug report with steps to reproduce. - The project's test framework and where its tests live. Look at 2 existing tests and copy their style, fixtures and naming. - Commands below say `python3`; on Windows use `python` (or `py -3`). Use the project's own runner (`python3 -m pytest`, `npx jest`, `go test`, `mvn test`). ## Outputs - New tests next to the existing ones, one behaviour per test, named after the behaviour. - A short table in your reply: test name, behaviour, how you proved it can fail. - Any bug found in the code, reported rather than silently pinned. ## Steps 1. **Confirm permission.** Write tests and run the code only in a repository the user owns or is authorized to change. Do not run code that touches production systems or real credentials. 2. **Read before writing.** Read the target and everything it calls that affects the result. Note inputs, outputs, side effects (files, network, database, clock, randomness) and the errors it raises. Read the docstring and callers for the intended behaviour. 3. **Enumerate behaviours.** Write the list first, in plain sentences, before any test code: - the main path with typical input; - each branch (every `if`, `else`, early