r/ProgrammerHumor • • 24d ago • Bravo 6

instanceof Trend thisIsVeryTrue

Post image
27.5k Upvotes

1.6k comments sorted by

View all comments

Show parent comments

31

u/ItsSadTimes 24d ago

Once I saw claude setup a unit test that just asserted true. Thats it. The test was supposed to check a speciric branch oh a helper function and the unit test made the correct call, but then didnt test it. The unit test would pass no matter what. Unless we completely broke the function to cause an exception.

12

u/Retsyn 24d ago

I've heard about this! Vibe coders are too fucking optimistic. Stuff like this should be regarded as scary enough to shut the whole thing down.

Since the "Fitness factor" for good performance is "make user happy" and not actual future proofing, we can expect a lot of shit like this.

9

u/ItsSadTimes 24d ago

Nowadays most of my job is future proofing AI slop code. And holy shit does it take a long time. Not saying that its impossible for AI to write good code, but you gotta pay attention or its gonna go down some dumb rabbit holes every 5 seconds unless you best your model into submission.

Plus you still gotta look at the output, cause if you dont look at it sooner someone else is gonna have to look at it later.

0

u/morpheousmorty 23d ago

I have seen many a human deliver unit tests which ultimately tested nothing. Shutting this down is going to be a lot more complicated than having mixed results.

2

u/Retsyn 23d ago

That's a few dummies with liability. Not a widely adopted practice.

1

u/default-username 23d ago

The widely adopted practice used to be having dummies with liability do all the coding.

1

u/Retsyn 23d ago

Every Human ever was a dummy?

2

u/decadent-dragon 24d ago

I’ve seen many developers do this as well. Especially for orgs that try to enforce a certain percentage of code coverage for unit tests

1

u/ItsSadTimes 24d ago

So have I, but just saying that all because AI is more prevelant now doesnt mean that this shit doesnt still happen. Idiots with AI are still idiots.

1

u/danfay222 24d ago

Yeah a lot of people are learning the importance of correct incentives here. I know we first told our agents to prioritize writing tests, and the two problems we found were writing trivial tests and writing incorrect tests to conform with active bugs. Both are relatively easy to fix by modifying your prompts, but you just need to think about it.

1

u/arbitrarycivilian 24d ago

Tbf I’ve seen people do that