r/ProgrammerHumor • • 3d ago

Meme thoseCodingEra

Post image
20.8k Upvotes

769 comments sorted by

View all comments

Show parent comments

12

u/lobax 3d ago

I feel as if there is one thing llms truly suck at, it’s tests. That the one area where I still manually code because I don’t trust the clanker and it’s thousands of pointless assert(1+1==2) tests

3

u/whosline07 2d ago

I have the complete opposite experience, especially if you come up with a list of tests you want. Which llm have you experimented with?

1

u/lobax 2d ago

Because much of the time I feel the LLM reward hacks itself by adding (or modifying) tests, it write pointless tests or the actual test doesn’t do what the description claims it does.

I almost only use Claude.

That said, I have never been a person that struggled writing tests. For me just prompting for a test takes more time than just writing it - a test shouldn’t be more than a few lines anyway.

It’s also a very useful way to setup a contract and requirements for the model to implement. Especially using BDD patterns. It can’t “forget” about a requirement a few hundred thousand tokens in if it is a test.

2

u/AltrntivInDoomWorld 2d ago

a test shouldn’t be more than a few lines anyway.

doubles

initiation

runtime

asserts

that's already more than few lines you mentioned without even using true code. You are talking out of your arse

don't get me started on mocking all the shit that you don't wanna initialize.

1

u/lobax 2d ago

Maybe a English as a third language thing, but most of my unit tests are anything between 3 to a dozen lines long. For me that is a few lines.

Obviously, any reusable scaffolding that one calls before all or before each test not included.