paperbot · PL 论文追踪

全部论文 待读 收藏

P2 An empirical study on API parameter rules

API 参数规则的实证研究
ICSE Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering2020匹配度 2/10 · 该论文属于软件工程中 API 参数规则挖掘的实证研究,虽与静态分析和开发者工具有一定关联,但未涉及用户核心关注的 ML/Agentic 程序静态分析、LLM 与静态分析/形式化验证的交叉、浮点程序分析或贝叶斯程序分析。引用 18 inbox
Hao Zhong, Na Meng, Zexuan Li, Li Jia
crossref: 2026-09-12

AI 速览

一句话:结合自动定位与人工检查,对 9 个库中 API 参数规则的类型与分布开展大规模实证研究。

当开发者不适当地设置软件库 API 参数时,程序可能表现出意外的运行时行为;已有研究构建工具挖掘 API 参数规则,但人们尚不清楚参数规则有哪些类型,以及它们如何在文档与源码中分布。为回答这些问题,本文采用自动定位与人工检查相结合的混合方法:自动工具 PaRu 定位受约束的参数,这些约束或记录于 Javadoc(文档规则),或隐含于源代码(代码规则);随后人工识别并归类这些参数的规则,并建立文档规则与代码规则之间的映射。作者将 PaRu 应用于 9 个广泛使用的库,共定位到 5334 个具有文档或代码规则的参数,其中仅 187 个参数同时具有两类规则,且这 187 个参数中有 79 对规则不匹配;PaRu 还从 Javadoc 与代码中抽取了 1688 条规则语句,人工将其划分为六类,其中两类被以往方法忽视。统计显示,86.2% 的参数只有代码规则,10.3% 只有文档规则,仅 3.5% 同时具有两类规则。研究揭示了参数规则自动抽取所面临的挑战,并基于发现讨论了既有方法的潜力与未来工具设计的启示。

问题
已有工具可挖掘 API 参数规则,但缺少对参数规则类型及其在文档与源码中分布规律的实证认识,导致自动抽取工具的设计缺乏依据。
方法
采用自动与人工相结合的混合方法:用 PaRu 自动定位 Javadoc 中记载或源码中隐含的受约束参数,再人工识别和归类规则,并建立文档规则与代码规则之间的映射。
评估
将 PaRu 应用于 9 个广泛使用的库,定位 5334 个带规则的参数、抽取 1688 条规则语句,并通过人工分类与统计揭示文档规则与代码规则的覆盖与不一致情况。
原文摘要(Abstract)

Developers build programs based on software libraries to reduce coding effort. If a program inappropriately sets an API parameter, the program may exhibit unexpected runtime behaviors. To help developers correctly use library APIs, researchers built tools to mine API parameter rules. However, it is still unknown (1) what types of parameter rules there are, and (2) how these rules distribute inside documents and source files. In this paper, we conducted an empirical study to investigate the above-mentioned questions. To analyze as many parameter rules as possible, we took a hybrid approach that combines automatic localization of constrained parameters with manual inspection. Our automatic approach---PaRu---locates parameters that have constraints either documented in Javadoc (i.e., document rules) or implied by source code (i.e., code rules). Our manual inspection (1) identifies and categorizes rules for the located parameters, and (2) establishes mapping between document and code rules. By applying PaRu to 9 widely used libraries, we located 5,334 parameters with either document or code rules. Interestingly, there are only 187 parameters that have both types of rules, and 79 pairs of these parameter rules are unmatched. Additionally, PaRu extracted 1,688 rule sentences from Javadoc and code. We manually classified these sentences into six categories, two of which are overlooked by prior approaches. We found that 86.2% of parameters have only code rules; 10.3% of parameters have only document rules; and only 3.5% of parameters have both document and code rules. Our research reveals the challenges for automating parameter rule extraction. Based on our findings, we discuss the potentials of prior approaches and present our insights for future tool design.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5615,
  title = {An empirical study on API parameter rules},
  author = {Hao Zhong and Na Meng and Zexuan Li and Li Jia},
  booktitle = {ICSE},
  year = {2020},
  doi = {10.1145/3377811.3380922}
}