Identifying change patterns of API misuses from code changes

Identifying change patterns of API misuses from code changes
复制标题

从代码更改中识别 API 滥用的更改模式

DOI:
10.1007/s11432-019-2745-5
复制
发表时间:
2021-02
期刊:
Science China Information Sciences
影响因子:
--
通讯作者:
Zhao Wenyun
Zhao Wenyun
中科院分区:
其他
文献类型:
--
作者:
Liu Wenjian;Chen Bihuan;Peng Xin;Sun Qinghao;Zhao Wenyun

文献摘要

参考文献

相似文献

库或框架API很难学习和使用,导致意外的软件行为或错误。因此,已经引入了各种API挖掘技术来挖掘关于API调用的共现或API调用的前提条件的API使用模式。然而,它们无法挖掘关于API调用本身的模式(例如,是否正确设置了API调用的参数,以及是否适当地选择了API而不是其他类似的API)。为了弥补这一差距,我们建议CPAM使用历史代码更改来识别更改模式(以代码更改前后的一对API的形式)来修复API误用。给定一组目标API和一组开源项目语料库,Cpam首先从语料库中选择可能修复API误用的提交,然后在每个选择的提交中提取对API误用的更改,最后识别API误用的更改模式。我们实现了Cpamfor Java,并针对Java SE API进行了大规模评估,使用了1162个Java项目的语料库。实验结果证明了CPAM的有效性和高效性。通过将识别的变化模式应用于错误检测,我们发现了44个新的错误,其中18个已经得到确认和修复。
Library or framework APIs are difficult to learn and use, leading to unexpected software behaviors or bugs. Hence, various API mining techniques have been introduced to mine API usage patterns about the co-occurring of API calls or pre-conditions of API calls. However, they fail to mine patterns about an API call itself (e.g., whether the arguments of the API call are correctly set and whether the API is suitably chosen over other similar APIs). To bridge this gap, we propose Cpamto identify change patterns (in the form of a pair of APIs before and after code changes) to fix API misuses, using historical code changes. Given a set of target APIs and a corpus of open-source projects, Cpamfirst selects the commits that potentially fix API misuses from the corpus, then extracts changes to API misuses in each selected commit, and finally identifies change patterns of API misuses. We implement Cpamfor Java, and conduct large-scale evaluation, targeting Java SE APIs and using a corpus of 1162 Java projects. Our experimental results demonstrate Cpam’s effectiveness and efficiency. By applying identified change patterns to bug detection, we find 44 new bugs, and 18 of them have been confirmed and fixed.
DOI: 10.1016/j.jss.2017.05.039
发表时间: 2017-08
期刊: J. Syst. Softw.
影响因子: --
作者:
H. E. Salman
通讯作者: H. E. Salman
DOI: 10.1145/3106237.3117771
发表时间: 2017-08
期刊: Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering
影响因子: --
作者:
Yaqin Zhou;Asankhaya Sharma
通讯作者: Yaqin Zhou;Asankhaya Sharma
DOI: 10.1109/tse.2005.63
发表时间: 2005-06
影响因子: 7.4
作者:
Chadd C. Williams;J. Hollingsworth
通讯作者: Chadd C. Williams;J. Hollingsworth
DOI: 10.1145/3180155.3180260
发表时间: 2018-05
期刊: 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE)
影响因子: --
作者:
Tianyi Zhang;Ganesha Upadhyaya;Anastasia Reinhardt;Hridesh Rajan;Miryung Kim
通讯作者: Tianyi Zhang;Ganesha Upadhyaya;Anastasia Reinhardt;Hridesh Rajan;Miryung Kim
DOI: 10.1007/978-3-642-03013-0_15
发表时间: 2009-07
期刊: --
影响因子: --
作者:
Hao Zhong;Tao Xie;Lu Zhang;J. Pei;Hong Mei
通讯作者: Hao Zhong;Tao Xie;Lu Zhang;J. Pei;Hong Mei