paperbot · PL 论文追踪

全部论文 待读 收藏

P1 PALM: Synergizing Program Analysis and LLMs to Enhance Rust Unit Test Coverage

PALM:协同程序分析与LLM提升Rust单元测试覆盖率
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 5/10 · 论文结合程序分析与LLM生成Rust单元测试,属于PL+AI交叉,且包含开源crate落地与补丁提交,有一定工程价值;但其应用目标是单元测试覆盖率,而非画像核心关注的ML/Agentic程序静态分析、LLM改进静态分析/形式化验证、浮点程序分析或贝叶斯程序分析,因此仅为相邻方向。引用 1 inbox
Bei Chu, Yang Feng, Kui Liu, Hange Shi, Zifan Nan, Zhaoqiang Guo, Baowen Xu
crossref: 2026-09-12

AI 速览

一句话:结合程序分析提取路径约束与LLM生成Rust高覆盖率单元测试,并在开源crate上验证及提交补丁。

单元测试对软件可靠性至关重要,但传统SBST与concolic执行在处理复杂分支条件和外部依赖时覆盖率有限,现有LLM方法又依赖固定提示,编译成功率与覆盖率较低。PALM通过程序分析识别函数内部分支条件并组合为路径约束,再结合上下文构造提示,引导LLM生成单元测试。作者在15个开源Rust crate上评估,发现仅需两三小时即可显著提升项目覆盖率,部分项目整体覆盖率提升超过50%,生成测试平均覆盖率达72.30%,接近人工水平70.94%。提交的91个针对新代码的测试中80个被接受、5个被拒、6个待审,表明程序分析与AI结合能有效改进自动化测试生成。

问题
传统单元测试生成方法难以处理复杂分支与外部依赖,覆盖率不足;现有LLM方法受限于固定提示,编译成功率与覆盖率也较低。
方法
PALM先用程序分析提取函数内部分支条件并组合成路径约束,再连同上下文构造提示,引导LLM生成Rust单元测试。
评估
在15个开源Rust crate上评估,比较覆盖率与人工效果,并提交91个测试查看接受情况;生成测试平均覆盖72.30%,人工70.94%。
原文摘要(Abstract)

Unit testing is essential for ensuring software reliability and correctness. Classic Search-Based Software Testing (SBST) methods and concolic execution-based approaches for generating unit tests often fail to achieve high coverage due to difficulties in handling complex program units, such as branching conditions and external dependencies. Recent work has increasingly utilized large language models (LLMs) to generate test cases, improving the quality of test generation by providing better context and correcting errors in the model’s output. However, these methods rely on fixed prompts, resulting in relatively low compilation success rates and coverage.This paper presents PALM, an approach that leverages large language models (LLMs) to enhance the generation of high-coverage unit tests. PALM performs program analysis to identify branching conditions within functions, which are then combined into path constraints. These constraints and relevant contextual information are used to construct prompts that guide the LLMs in generating unit tests. We implement the approach and evaluate it in 15 open-source Rust crates. Experimental results show that within just two or three hours, PALM can significantly improve test coverage compared to classic methods, with increases in overall project coverage exceeding 50% in some instances and its generated tests achieving an average coverage of 72.30%, comparable to human effort (70.94%), highlighting the potential of LLMs in automated test generation. We submitted 91 PALM-generated unit tests targeting new code. Of these submissions, 80 were accepted, 5 were rejected, and 6 remain pending review. The results demonstrate the effectiveness of integrating program analysis with AI and open new avenues for future research in automated software testing.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot9537,
  title = {PALM: Synergizing Program Analysis and LLMs to Enhance Rust Unit Test Coverage},
  author = {Bei Chu and Yang Feng and Kui Liu and Hange Shi and Zifan Nan and Zhaoqiang Guo and Baowen Xu},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00223}
}