Large Language Models (LLMs) have recently shown strong potential for automated unit test generation. This has motivated us to investigate whether developer-defined test doubles (commonly referred to as mocks) available in existing test suites can be leveraged to improve LLM-driven test generation. To this end, we propose MOCKMILL, an LLM-based technique and tool that generates test cases by exploiting mocking information automatically extracted from developer-written tests. MOCKMILL targets components that are replaced by test doubles in existing tests and uses the encoded stubbings and interaction expectations to guide test generation, combined with an iterative generation-and-repair process to ensure executable tests. We evaluated MOCKMILL on 10 open-source classes from six Java projects using four LLMs, and compared the generated tests with existing project tests and tests produced by baseline approaches. The results show that MOCKMILL's tests cover lines of code and kill mutants that existing tests and baseline-generated tests miss. Overall, our findings provide preliminary evidence that leveraging mocking information is a complementary and effective way to enhance LLM-based test generation.
ZeroFalse: Improving Precision in Static Analysis with LLMs
Simon Fraser University(西蒙菲莎大学);Amirkabir University of Technology(阿米尔卡比尔理工大学);K. N. Toosi University of Technology(凯恩·纳赛尔·托西理工大学);Ferdowsi University of Mashhad(马什哈德费尔多西大学)
PACE: Improving Prompt with Actor-Critic Editing for Large Language Model
Key Laboratory of High Confidence Software Technologies (Peking University)(高可信软件技术重点实验室(北京大学));School of Computer Science, Peking University(北京大学计算机学院)
ProOPF: Benchmarking and Improving LLMs for Professional-Grade Power Systems Optimization Modeling
College of Control Science and Engineering, Zhejiang University(浙江大学控制科学与工程学院);School of Advanced Manufacturing and Robotics, Peking University(北京大学先进制造与机器人学院);School of Electrical Engineering, Xi’an Jiaotong University(西安交通大学电气工程学院);China Southern Power Grid Novel Electric Power System (BEIJING) Research Institute Co., Ltd.(中国南方电网新型电力系统(北京)研究院有限公司)