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.
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
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.
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.