paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Translating code comments to procedure specifications

将代码注释翻译为过程规范
ISSTA Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis2018匹配度 3/10 · 论文从 Javadoc 注释自动生成可执行过程规范并用于测试生成,属于程序规格挖掘与测试领域,与用户核心关注的 LLM/Agent 应用于静态分析/形式化验证、浮点程序分析或贝叶斯程序分析无直接交集。其非 LLM 的模式/词汇/语义匹配方法虽有形式化与工程结合,但并非当前研究画像的中心方向。引用 103 inbox
Arianna Blasi, Alberto Goffi, Konstantin Kuznetsov, Alessandra Gorla, Michael D. Ernst, Mauro Pezzè, Sergio Delgado Castellanos
crossref: 2026-09-12

AI 速览

一句话:提出 Jdoctor,结合模式、词汇和语义匹配,将 Javadoc 注释自动翻译为可执行过程规范,并提升测试生成质量。

程序规范在测试生成等任务中很有用,但实践中形式规范稀缺,开发者常用半结构化 Javadoc 注释表达过程规范。本文提出 Jdoctor,融合模式匹配、词汇匹配与语义匹配,把 Javadoc 注释翻译为用 Java 表达式表示的可执行过程规范。实证评估中,Jdoctor 的翻译精确率为 92%,召回率为 83%;将这些规范提供给自动化测试用例生成工具 Randoop 后,Randoop 能生成更高质量的测试用例。

问题
形式化过程规范在实际开发中很少见,而半结构化注释中蕴含的规范信息无法直接用于自动测试等任务。如何自动、准确地将 Javadoc 注释转化为可执行过程规范。
方法
Jdoctor 结合模式匹配、词汇匹配和语义匹配,将 Javadoc 注释翻译为 Java 表达式形式的过程规范。
评估
在实证评估中达到 92% 精确率和 83% 召回率,并将所得规范输入 Randoop,证明能生成更高质量的测试用例。
原文摘要(Abstract)

Procedure specifications are useful in many software development tasks. As one example, in automatic test case generation they can guide testing, act as test oracles able to reveal bugs, and identify illegal inputs. Whereas formal specifications are seldom available in practice, it is standard practice for developers to document their code with semi-structured comments. These comments express the procedure specification with a mix of predefined tags and natural language. This paper presents Jdoctor, an approach that combines pattern, lexical, and semantic matching to translate Javadoc comments into executable procedure specifications written as Java expressions. In an empirical evaluation, Jdoctor achieved precision of 92% and recall of 83% in translating Javadoc into procedure specifications. We also supplied the Jdoctor-derived specifications to an automated test case generation tool, Randoop. The specifications enabled Randoop to generate test cases of higher quality.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot4841,
  title = {Translating code comments to procedure specifications},
  author = {Arianna Blasi and Alberto Goffi and Konstantin Kuznetsov and Alessandra Gorla and Michael D. Ernst and Mauro Pezzè and Sergio Delgado Castellanos},
  booktitle = {ISSTA},
  year = {2018},
  doi = {10.1145/3213846.3213872}
}