paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Write Your Own Code Checker: An Automated Test-Driven Checker Development Approach with LLMs

编写你自己的代码检查器:一种基于 LLM 的自动化测试驱动检查器开发方法
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 7/10 · 该论文属于“AI→PL”方向,即利用 LLM/Agent 改进静态分析工具的构建,通过测试驱动与 API 检索自动生成代码检查器,并在 PMD 规则上评测,与用户关注的用 LLM 改进静态分析/程序分析高度相关。但它不涉及 ML/Agentic 程序分析、浮点程序分析或贝叶斯程序分析等用户其他核心兴趣,因此未达到正中核心的程度。引用 3 inbox
Jun Liu, Yuanyuan Xie, Jiwei Yan, Jinhao Huang, Jun Yan, Jian Zhang
crossref: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 AutoChecker,仅凭规则描述与测试套件,用 LLM 迭代生成代码检查器,平均测试通过率达 82.28%。

针对开发者定制静态代码检查器时面临规则逻辑复杂、检查器框架 API 庞大难以上手的问题,本文提出 AutoChecker:一种由 LLM 驱动的自动化检查器生成方法,输入仅为一条规则描述和一个测试套件。为覆盖完整的检查逻辑,AutoChecker 采取增量式更新策略,每次迭代只聚焦解决一个选定的测试用例,从而逐步补全检查器逻辑;为获取准确的 API 知识,每次迭代还引入细粒度的逻辑引导式 API 上下文检索——先将检查逻辑分解为一系列子操作,再为每个子操作检索与之相关的检查器框架 API 上下文。评估中,作者使用多种 LLM,让 AutoChecker、五个基线方法与三种消融方法为随机选取的 20 条 PMD 规则生成检查器。实验结果显示 AutoChecker 在所有有效性指标上均显著优于对比方法,平均测试通过率为 82.28%;并且在真实项目上应用时,其生成的检查器性能与官方检查器相当。

问题
定制静态代码检查器需要同时掌握复杂的规则检查逻辑与大型检查器框架的海量 API,开发门槛高,因此需要自动化的检查器生成方法来减轻开发者负担。
方法
AutoChecker 以规则描述和测试套件为输入,通过迭代方式每次解决一个测试用例来增量补全检查逻辑,并在每轮迭代中把检查逻辑分解为子操作、为每个子操作检索细粒度的 API 上下文。
评估
在 20 条随机选取的 PMD 规则上,用多种 LLM 对比 AutoChecker、五个基线与三种消融方法,报告测试通过率等有效性指标,并在真实项目上与官方检查器比较性能。
原文摘要(Abstract)

With the rising demand for code quality assurance, developers are not only utilizing existing static code checkers but also seeking custom checkers to satisfy their specific needs. Nowadays, various code-checking frameworks provide extensive checker customization interfaces to meet this need. However, both the complex checking logic of rules and massive API usages of large-scale checker frameworks make this task challenging. To this end, automated code checker generation is anticipated to ease the burden of checker development. In this paper, we propose AutoChecker, an innovative LLM-powered approach that can write code checkers automatically based on only a rule description and a test suite. To achieve comprehensive checking logic, AutoChecker incrementally updates the checker’s logic by focusing on solving one selected case each time. To obtain precise API knowledge, during each iteration, it leverages fine-grained logic-guided API-context retrieval, where it first decomposes the checking logic into a series of sub-operations and then retrieves checker-related API-contexts for each sub-operation. For evaluation, we apply AutoChecker, five baselines, and three ablation methods using multiple LLMs to generate checkers for 20 randomly selected PMD rules. Experimental results show that AutoChecker significantly outperforms others across all effectiveness metrics, with an average test pass rate of 82.28%. Additionally, checkers generated by AutoChecker show performance comparable to that of the official checkers when applied to real-world projects.

链接与引用

DOI 原文 · arXiv ·

BibTeX
@inproceedings{paperbot11506,
  title = {Write Your Own Code Checker: An Automated Test-Driven Checker Development Approach with LLMs},
  author = {Jun Liu and Yuanyuan Xie and Jiwei Yan and Jinhao Huang and Jun Yan and Jian Zhang},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3764560}
}