An Empirical Study on API Parameter Rules

An Empirical Study on API Parameter Rules
复制标题

DOI:
10.1145/3377811.3380922
复制
发表时间:
2020-06
期刊:
2020 IEEE/ACM 42nd International Conference on Software Engineering (ICSE)
影响因子:
--
通讯作者:
Hao Zhong;Na Meng;Zexuan Li;Li Jia
Hao Zhong;Na Meng;Zexuan Li;Li Jia
中科院分区:
其他
文献类型:
--
作者:
Hao Zhong;Na Meng;Zexuan Li;Li Jia

文献摘要

相似文献

开发人员基于软件库来减少编码工作仍然未知(1)有哪些类型的参数规则,(2)这些规则在本文中如何分发文档和源文件。我们采用了一种混合方法,将约束参数的自动定位与手动检查结合在一起。 ) ,只有187个参数具有两种规则,而这些参数规则的79对也无与伦比。先前的方法。我们发现,有86.2%的参数仅具有文档规则,并且只有3.5%的参数具有文档和代码规则我们的发现,我们讨论了先前方法的潜力,并提供了对未来工具设计的见解。
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.