News for hackers. Stuff that matters.
Re:I Automated My Job Application Process by fijiaarone on Saturday December 28, 2024 @07:37PM (#42536274)
LLMs can’t write unit tests. They can’t even tell what you intend. If your code is already correct, you don’t need the unit test, if it’s not, the LLM can’t write the unit test. If you thing an LLM can write tests for you, you can be replaced by an LLM.
Re:I Automated My Job Application Process by lukan on Saturday December 28, 2024 @08:18PM (#42536507)
I don't think the concept here is blindly taking the output of the LLM and calling it a day. One can test, the test.
Re:I Automated My Job Application Process by bb88 on Sunday December 29, 2024 @03:04AM (#42538437)
I've had about 33% luck with unit tests coming out perfect. Usually the issues are small problems that are easily fixed though.
Re:I Automated My Job Application Process by margalabargala on Saturday December 28, 2024 @09:03PM (#42536771)
> If your code is already correct, you don’t need the unit test.

I don't know where you work where code is written once and is never changed again, but enjoy it while it lasts...

Re:I Automated My Job Application Process by bb88 on Sunday December 29, 2024 @04:18AM (#42538766)
Worse is when a protocol or shared state condition is modified.

E.g. suddenly some fresh out of college know-it-all sent crap into your function that you weren't expecting. Then he went to management to blame you for writing such shitty code.

Thing is you wrote unit tests around that code and the shitty know-it-all deleted them rather than changing them when he modified the code

This is why management needs to understand code.

Re:I Automated My Job Application Process by josephg on Sunday December 29, 2024 @07:40AM (#42539558)
What? Is that a real example? Are you seriously working with people who delete your tests, misuse your code then complain about you to management?

Is your workplace filled with high school students? I’ve never seen anything so petty and immature in my professional career. I hope management told them to grow up.

Re:I Automated My Job Application Process by bb88 on Sunday December 29, 2024 @06:15PM (#42544441)
> Is your workplace filled with high school students? I’ve never seen anything so petty and immature in my professional career.

I think the description I remember on glass door was that it was "high school all over again".

Re:I Automated My Job Application Process by margalabargala on Sunday December 29, 2024 @01:32PM (#42541826)
Recently on HN there was a thread debating the utility of having required code reviews for PRs.

I'm firmly on team "require a coworker to say okay before merging", and this is exactly why.

Re:I Automated My Job Application Process by WD-42 on Saturday December 28, 2024 @09:39PM (#42536955)
> if your code is already correct, you don’t need the unit test

This is a hot take. I'm 100% not onboard with.

Re:I Automated My Job Application Process by warkdarrior on Sunday December 29, 2024 @02:16AM (#42538288)
Correct. Unit tests are not only for the current version of the code, but also to prevent regressions in future versions of the same code.
Re:I Automated My Job Application Process by supriyo-biswas on Sunday December 29, 2024 @12:27AM (#42537777)
IMO, the main use case for LLMs in unit tests is through a code completion model like Copilot where you use it to save on some typing.

Of course, there are overzealous managers and their brown-nosing underlings who will say that the LLM can do everything from writing the code itself and the unit tests, end-to-end, but that is usually because they see more value in toeing the line and follow the narratives being pushed from the C-level.