Discussion about this post

User's avatar
Mike Dabydeen's avatar

Your tests section names tautological and heavily mocked tests. I'd add a third kind: tests that are correct but built on the same assumption as the code. In a review exercise I put together, a mapper fills a missing countryCode with CA. The partner contract allows the field to be absent, but both fixtures supply a country (CA and US), so everything passes. Nothing is tautological or mocked. The fixtures just never reach the case where the default makes a business decision.

What catches it is reading the tests against the input contract. I ask the author to list which inputs the contract allows that no test exercises: absent, empty, outside the supported set, wrong type. That list fits naturally in the reading guide you describe, and a missing row is often the most useful thing a reviewer can point to.

It also ties back to your ownership question. If the author can't say what the code does with the absent value, the agent has made that decision for them.

No posts

Ready for more?