Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Recently, I have given up on writing unit tests, instead prompting an LLM to write them for me. I just sit back and keep prompting it until it gets it right. Sometimes it goes a little haywire in our Monorepo, but I don't have to accept its changes.

It feels ... strangely empowering.



When I build unit tests around the right routines, I feel like all is right with the world. But some employers consider this gilding the lily.

But with LLMs in hand, I can generate entire suites of tests where they're most useful before management has the time to complain. All the little nice-to-have-but-hard-to-google environment tweaks are seconds away for the asking. It's finally cost effective to do things right.


I do it the other way around: I write the specs and unleash an agent to turn my test suite from red to green.

Each of us does half the work, the other half being done by a LLM. The difference is that I specify the desired behavior, while you leave the specification up to the LLM. A little strange if you ask me!


Same, and to avoid it going haywire I wrote an agents.md file with some prompts, like how to run a test for a single file and what to do before saying "I am done".


i think thats the best use you can get from LLM's in programming. Doing the boring simple test code that doesn't have to meet any quality requirements. Normally on a code review I ignore unit tests, written from humans oder LLM's out of this reason.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: