Write [FRAMEWORK] tests for the code below. Weight the suite toward what breaks in production: - Boundaries: empty, single element, maximum, off-by-one - Nulls and missing keys at every level the code touches - Wrong types where the language allows them through - Concurrent or repeated calls, if state is involved - The error paths — assert the message, not just that it threw One happy-path test is enough. For each test: a name that states the expectation, arrange/act/assert clearly separated, and no shared mutable state between tests. After the suite, list what you could NOT test without changing the code, and what the smallest change would be. CODE: [CODE]
A refactor that respects your language version and does not silently change behaviour.
A review that separates real bugs from taste, so you know what must be fixed.
Works backwards from the error to the cause and proposes the smallest fix.