On the Evaluation of Large Language Models in Unit Test Evolution (Experience Paper)
Weichang Liu, Junwei Zhang, Yuqing Niu, Bo Zhou
Key points
From the paper's conclusion- We present the first comprehensive empirical study to evaluate LLMs for unit test evolution.
- We systematically assess nine open-source code LLMs (3B to 34B parameters) and three state-of-the-art commercial models across diverse prompt designs, ICL strategies, and representative test evolution frameworks.
- Our evaluation employs a suite of compilation, execution, and coverage-based metrics, and reveals that prompt design and ICL methods significantly impact LLM effectiveness.
Abstract
Large language models (LLMs) have recently shown promising potential in automating unit test evolution for evolving software systems. However, the effectiveness of LLMs in unit test evolution remains insufficiently understood, particularly with respect to prompt design choices, in-context learning (ICL) strategies, and different types of test evolution. In this paper, we present the first comprehensive empirical study to evaluate LLMs for unit test evolution. We systematically assess nine open-source code LLMs (3B to 34B parameters) and three state-of-the-art commercial models across diverse prompt designs, ICL strategies, and representative test evolution frameworks. To support robust and execution-based evaluation, we construct a new benchmark consisting of 530 real-world focal method–test co-evolution instances collected from seven actively maintained open-source projects. Our evaluation employs a suite of compilation, execution, and coverage-based metrics. Extensive experimental results reveal that prompt design and ICL methods significantly impact LLM effectiveness. Furthermore, the optimal configurations of these strategies vary substantially across different LLMs and evolution types. Based on our findings, we derive actionable insights to guide future research and practical adoption of LLM-based techniques for unit test evolution.
Read the paper
Discussion · 1
Science Skim's AI key points, plus readers' public thoughts
- We present the first comprehensive empirical study to evaluate LLMs for unit test evolution.
- We systematically assess nine open-source code LLMs (3B to 34B parameters) and three state-of-the-art commercial models across diverse prompt designs, ICL strategies, and representative test evolution frameworks.
- Our evaluation employs a suite of compilation, execution, and coverage-based metrics, and reveals that prompt design and ICL methods significantly impact LLM effectiveness.
Readers' thoughts
No reader thoughts yet.
Related papers
- Mutation-Guided Unit Test Generation With a Large Language ModelIEEE Transactions on Software Engineering · 2026
- An Empirical Study on the Code Refactoring Capability of Large Language ModelsACM Transactions on Software Engineering and Methodology · 2026
- Finding the Pivots to Repair Broken Source-Test Evolution Using LLMsarXiv · 2026
- Benchmarking LLMs for Unit Test Generation from Real-World FunctionsACM Transactions on Software Engineering and Methodology · 2026
- Do Coverage and Mutation Scores of LLM-Generated Test Suites Correlate with Their Effectiveness? (Replicability Study)Proceedings of the ACM on software engineering. · 2026
- Context Matters: Improving the Practical Reliability of LLM-Based Unit Test Generation (Experience Paper)Proceedings of the ACM on Software Engineering · 2026