Clarifying Semantics of In-Context Examples for Unit Test Generation
This program is tentative and subject to change.
Recent advances in large language models (LLMs) have enabled promising performance in unit test generation through in-context learning (ICL). However, the quality of in-context examples significantly influences the effectiveness of generated tests—poorly structured or semantically unclear test examples often lead to suboptimal outputs. In this paper, we propose CLAST, a novel technique that systematically refines unit tests to improve their semantic clarity, thereby enhancing their utility as in-context examples. The approach decomposes complex tests into logically clearer ones and improves semantic clarity through a combination of program analysis and LLM-based rewriting. We evaluated CLAST on four open-source and three industrial projects. The results demonstrate that CLAST largely outperforms UTgen, the state-of-the-art refinement technique, in both preserving test effectiveness and enhancing semantic clarity. Specifically, CLAST fully retains the original effectiveness of unit tests, while UTgen reduces compilation success rate (CSR), pass rate (PR), and test coverage (Cov) by an average of 12.90%, 35.82%, an 4.65%, respectively. Over 85.33% of participants in our user study preferred the semantic clarity of CLAST-refined tests. Notably, incorporating \tech-refined tests as examples effectively improves ICL-based unit test generation approaches such as RAGGen and TELPA, resulting in an average increase of 25.97% in CSR, 28.22% in PR, and 45.99% in Cov for generated tests, compared to incorporating UTgen-refined tests. The insights from the follow-up user study not only reinforce CLAST’s potential impact in software testing practice but also illuminate avenues for future research.
This program is tentative and subject to change.
Wed 19 NovDisplayed time zone: Seoul change
14:00 - 15:30 | |||
14:00 10mTalk | LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Framework Research Papers Andrea Lops Polytechnic University of Bari, Italy, Fedelucio Narducci Polytechnic University of Bari, Azzurra Ragone University of Bari, Michelantonio Trizio Wideverse, Claudio Bartolini Wideverse s.r.l. | ||
14:10 10mTalk | µOpTime: Statically Reducing the Execution Time of Microbenchmark Suites Using Stability Metrics Journal-First Track Nils Japke TU Berlin & ECDF, Martin Grambow TU Berlin & ECDF, Christoph Laaber Simula Research Laboratory, David Bermbach TU Berlin | ||
14:20 10mTalk | Reference-Based Retrieval-Augmented Unit Test Generation Journal-First Track Zhe Zhang Beihang University, Liu Xingyu Beihang University, Yuanzhang Lin Beihang University, Xiang Gao Beihang University, Hailong Sun Beihang University, Yuan Yuan Beihang University | ||
14:30 10mTalk | Using Active Learning to Train Predictive Mutation Testing with Minimal Data Research Papers Miklos Borsi Karlsruhe Institute of Technology | ||
14:40 10mTalk | Clarifying Semantics of In-Context Examples for Unit Test Generation Research Papers Chen Yang Tianjin University, Lin Yang Tianjin University, Ziqi Wang Tianjin University, Dong Wang Tianjin University, Jianyi Zhou Huawei Cloud Computing Technologies Co., Ltd., Junjie Chen Tianjin University | ||
14:50 10mTalk | An empirical study of test case prioritization on the Linux Kernel Journal-First Track Haichi Wang College of Intelligence and Computing, Tianjin University, Ruiguo Yu College of Intelligence and Computing, Tianjin University, Dong Wang Tianjin University, Yiheng Du College of Intelligence and Computing, Tianjin University, Yingquan Zhao Tianjin University, Junjie Chen Tianjin University, Zan Wang Tianjin University | ||
15:00 10mTalk | Automated Generation of Issue-Reproducing Tests by Combining LLMs and Search-Based Testing Research Papers Konstantinos Kitsios University of Zurich, Marco Castelluccio Mozilla, Alberto Bacchelli University of Zurich Pre-print | ||
15:10 10mTalk | Using Fourier Analysis and Mutant Clustering to Accelerate DNN Mutation Testing Research Papers | ||
15:20 10mTalk | WEST: Specification-Based Test Generation for WebAssembly Research Papers | ||