Comment on AI Coding Is Massively Overhyped, Report Finds

<- View Parent
sugar_in_your_tea@sh.itjust.works ⁨1⁩ ⁨day⁩ ago

testing branches usually entail just copying the exact same test but changing one field to be an invalid value, or a dependency to throw

That’s what parameterization is for. In unit tests, most dependencies should be mocked, so expecting a dependency to throw shouldn’t really be a thing much of the time.

I’d want something to prompt me saying this branch is not covered, and then tell me how it will try to cover it

You can get the first half with coverage tools. The second half should be fairly straightforward, assuming you wrote the code. If a branch is hard to hit (i.e. it happens if an OS or library function fails), either mock that part or don’t bother with the test. I ask my team to hit 70-80% code coverage because that last 20-30% tends to be extreme corner cases that are hard to hit.

My coworkers that do use it don’t really proofread, so it ends up having some bad practices and code smells.

And this is the problem. Reviewers only know so much about the overall context and often do a surface level review unless you’re touching something super important.

We can make conventions all we want, but people will be lazy and submit crap, especially when deadlines are close. >

source
Sort:hotnewtop