arrow
Return

Identifying change patterns of API misuses from code changes

delete2021-02-07
delete5
PRE
AI
W
Wenjian Liu
B
Bihuan Chen *
X
Xin Peng
Q
Qinghao Sun
DOI:10.1007/s11432-019-2745-5delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
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 Cpam to 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, Cpam first 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 Cpam for 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.
Keywords:
API misuses
API mining
AST differencing
change patterns
bug fixing
AI Summary

AI Summary

Key information extracted from the uploaded paper, including a brief overview, abstract, background, key highlights, visual analysis, and future outlook.

Journal

Science China Information Sciences cover
Science China Information Sciences
IF:
7.6
Papers:
4.9K
Citations:
8.9K

Organization

F
fudan university
Scholars:
11.8W
Papers: 7.7W
Citations: 121
Cited Papers

Cited Papers

A Hybrid ACO+CP for Balancing Bicycle Sharing Systems
err2013-01-01
err0
PREAI
errLuca Di Gaspero; Andrea Rendl; Tommaso Urli
errShare
errSave
Titania Nanobelts as a Scattering Layer with Cu2ZnSnS4 as a Counter Electrode for DSSC with Improved Efficiency
err2018-01-01
err0
PREAI
errSiva Sankar Nemala; Krishnaiah Mokurala; Parag Bhargava; Sudhanshu Mallick
errShare
errSave
Supercurrent in a Double Quantum Dot
err2018-12-20
err0
errOAAI
errJ. C. Estrada Saldaña; A. Vekris; G. Steffensen; R. Žitko; P. Krogstrup; J. Paaske; K. Grove-Rasmussen; J. Nygård
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
Psychometric properties of the Chinese version of the Infertility Self-Efficacy Scale
err2016-09-01
err0
errOAAI
errBing Fu; Pingping Yan; Hang Yin; Shujuan Zhu; Qing Liu; Yulan Liu; Chanyuan Dai; Guanxiu Tang; Chunli Yan; Jun Lei
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
A Socially Responsible Islamic Finance
err
IF0
err2017-01-01
err0
PREAI
errUmar F. Moghul
errShare
errSave
researcher View more