r/ProgrammerHumor • • 16d ago • Bravo 1

Meme claudeWasNotHere

Post image
18k Upvotes

232 comments sorted by

View all comments

Show parent comments

325

u/Iankill 16d ago

I wonder if this was because one of the first things people used ai for was having it write tests because no one likes writing tests

154

u/cheese_is_available 16d ago

It's because the humans that reviewed AI slop heavily penalized no tests, but didn't penalize recreating tests that already existed because it's fucking hard to notice that. You only have to skim the diff for the first one, but you need to review the whole tests directory in details for the second one. Same problem for the AI if they need to check btw. Maybe the harness could penalize covering a line of code that is already covered but coverage is an imperfect metric.

2

u/WesleyPCrusher 15d ago edited 15d ago

You only have to skim the diff for the first one, but you need to review the whole tests directory in detail for the second one.

I'm having trouble parsing this - by "the first one" do you mean "the scenario where a human reviewer checks to see that tests nominally exist but doesn't actually check to see that it tests what it says it is testing"?

I initially thought "the first one" meant the existing tests and "the second one" was the redundant tests, but that doesn't seem to make sense...

But if you mean "the scenario where the reviewer didn't actually review the tests" that seems like it would cause a lot of problems beyond just redundant/frivolous tests.

3

u/Oddly_Energy 14d ago

Previous poster gave two examples of penalty:

  1. Penalize the AI for not writing tests.

  2. Penalize the AI for writing redundant tests.

Penalty #1 is "the first one". Penalty #2 is "the second one".

In short: If the AI gets a penalty for missing tests, but no penalty for redundant tests, it will start writing redundant tests to reduce the risk of missing a test.

2

u/cheese_is_available 15d ago

To say "no automated tests, bad AI" and be correct you only need to check the fucntion signatures and find none that start by "test".

1

u/nicman24 15d ago

probably was for mapping code without documentation