wow, claude is fucking terrible at unit tests. i guess i need to come up with a good prompt.
Login to reply
Replies (2)
I think I agree. I spent about two hours once, fighting with it to make one good unit test
But after that, when I asked it to make many similar unit tests, it was very good at following the pattern that I had set
I haven't used any other AI for coding though, so I can't compare Claude to others
the llm superpower seems to be adapting existing code to a new use case. getting it to write something new and follow best practices is not great out of the box. you need to REALLY focus on the guardrails to get it to perform reasonably well.
i think a detailed prompt explaining good testing strategy and referencing a codebase test architecture guide might produce good results. i suspect my current session is totally ignoring the testing guide i had it write right before this.
but i'm hesitant to throw away the current session output because i'm THIS CLOSE 🤏 to completing my current task. 🤦♂️