An LLM-based Readability Measurement for Unit Tests' Context-aware Inputs
Zhichao Zhou, Yutian Tang, Yun Lin, Jingzhu He

TL;DR
This paper introduces C3, a tool leveraging Large Language Models to measure and improve the readability of unit test inputs by considering the context provided by source code, enhancing automated test generation.
Contribution
The paper proposes C3, a novel context-aware readability measurement tool using LLMs, and integrates it into EvoSuite to generate more readable test inputs based on source code contexts.
Findings
C3 achieves high precision, recall, and F1-score in extracting readability contexts.
EvoSuiteC3 significantly outperforms traditional tools in generating readable string inputs.
Traditional tools like EvoSuite and Randoop produce only 8% readable string inputs.
Abstract
Automated test techniques usually generate unit tests with higher code coverage than manual tests. However, the readability of automated tests is crucial for code comprehension and maintenance. The readability of unit tests involves many aspects. In this paper, we focus on test inputs. The central limitation of existing studies on input readability is that they focus on test codes alone without taking the tested source codes into consideration, making them either ignore different source codes' different readability requirements or require manual efforts to write readable inputs. However, we observe that the source codes specify the contexts that test inputs must satisfy. Based on such observation, we introduce the \underline{C}ontext \underline{C}onsistency \underline{C}riterion (a.k.a, C3), which is a readability measurement tool that leverages Large Language Models to extract…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsOnline Learning and Analytics · Software Reliability and Analysis Research · Software System Performance and Reliability
