Comment on AI Coding Is Massively Overhyped, Report Finds
Nalivai@lemmy.world 3 days agoDevs are more invested in code they wrote themselves. When I’m writing tests for something I didn’t write, I’m less personally invested in it.
This, I think, is a very bad part of the problem and shouldn’t be happening regardless
sugar_in_your_tea@sh.itjust.works 3 days ago
It shouldn’t, but it does. The person who writes the code cares more about its correctness, so I trust them to write better tests.
Nalivai@lemmy.world 3 days ago
I absolutely don’t. Since we’re talking about bad cases anyway, I don’t trust a developer to be diligent in finding bugs in their code more than I believe they will try to make all the tests pass. And it’s easier and better for the ego to achieve that if you write shit tests that only cover cases that you know will work.
sugar_in_your_tea@sh.itjust.works 3 days ago
Unit tests aren’t intended to find bugs, they’re intended to prove correctness. There should be a separate QA process for finding bugs, which involves integration testing. When QA inevitably finds a bug, the unit tests get updated with that case (and any similar cases).
And that’s what code reviews are for. If your tests don’t sufficiently cover the logic, the change should be rejected until they do.