3 ms·
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. So
by mlmonkey 8mo ago
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.
- elevation 8mo agoWhen 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.
- deleted 8mo ago[deleted]
- krater23 8mo agoi 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.
- Cthulhu_ 8mo agoSame, 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".
- tasuki 8mo agoI 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!