Evaluating and Mitigating the Misguidance Effect of Buggy Code in LLM-Generated Unit Tests
A specification-based unit test generation paradigm that replaces the code under test in the prompt with an LLM-generated specification docstring is introduced, showing that this paradigm effectively reduces misguided tests while substantially increasing effective tests, improves multi-round, feedback-driven test generation pipelines, and remains applicable to both buggy and bug-free code.