arrow
Return

Assisting Example-Based API Misuse Detection via Complementary Artificial Examples

delete2022-09-01
delete2
PRE
AI
M
Maxime Lamothe *
H
Heng Li
W
Weiyi Shang
DOI:10.1109/TSE.2021.3093246delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
Application Programming Interfaces (APIs) allow their users to reuse existing software functionality without implementing it by themselves. However, using external functionality can come at a cost. Because developers are decoupled from the API's inner workings, they face the possibility of misunderstanding, and therefore misusing APIs. Prior research has proposed state-of-the-art example-based API misuse detectors that rely on existing API usage examples mined from existing code bases. Intuitively, without a varied dataset of API usage examples, it is challenging for the example-based API misuse detectors to differentiate between infrequent but correct API usages and API misuses. Such mistakes lead to false positives in the API misuse detection results, which was reported in a recent study as a major limitation of the state-of-the-art. To tackle this challenge, in this paper, we first undertake a qualitative study of 384 falsely detected API misuses. We find that around one third of the false-positives are due to missing alternative correct API usage examples. Based on the knowledge gained from the qualitative study, we uncover five patterns which can be followed to generate artificial examples for complementing existing API usage examples in the API misuse detection. To evaluate the usefulness of the generated artificial examples, we apply a state-of-the-art example-based API misuse detector on 50 open source Java projects. We find that our artificial examples can complement the existing API usage examples by preventing the detection of 55 false API misuses. Furthermore, we conduct a pre-designed experiment in an automated API misuse detection benchmark (MUBench), in order to evaluate the impact of generated artificial examples on recall. We find that the API misuse detector covers the same true positive results with and without the artificial example, i.e., obtains the same recall of 94.7 percent. Our findings highlight the potential of improving API misuse detection by pattern-guided source code transformation techniques.
Keywords:
Detectors
Software
Tools
Usability
Java
Data mining
Task analysis
API-misuse detection
mining software repositories
empirical software engineering
software reuse
A3: Assisting Android API Migrations Using Code Examples
err2022-02-01
err21
errOAAI
errLamothe, Maxime; Shang, Weiyi; Chen, Tse-Hsun (Peter)
errShare
errSave
On the use of replacement messages in API deprecation: An empirical study
err2018-03-01
err32
errOAAI
errBrito, Gleison; Hora, Andre; Valente, Marco Tulio; Robbes, Romain
errShare
errSave
API beauty is in the eye of the clients: 2.2 million Maven dependencies reveal the spectrum of client-API usages
err2022-02-01
err12
errOAAI
errHarrand, Nicolas; Benelallam, Amine; Soto-Valero, Cesar; Bettega, Francois; Barais, Olivier; Baudry, Benoit
errShare
errSave
Use and Misuse of the Term Experiment in Mining Software Repositories Research
err2022-11-01
err9
errOAAI
errAyala, Claudia; Turhan, Burak; Franch, Xavier; Juristo, Natalia
errShare
errSave
Automatic Detection of Java Cryptographic API Misuses: Are We There Yet?
err2023-01-01
err8
PREAI
errZhang, Ying; Kabir, Md Mahir Asef; Xiao, Ya; Yao, Danfeng; Meng, Na
errShare
errSave
The Impact of API Change- and Fault-Proneness on the User Ratings of Android Apps
err2015-04-01
err151
errOAAI
errBavota, Gabriele; Linares-Vasquez, Mario; Bernal-Cardenas, Carlos Eduardo; Di Penta, Massimiliano; Oliveto, Rocco; Poshyvanyk, Denys
errShare
errSave
errShare
errSave

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
3.0K
Citations:
1.3W

Organization

P
Polytechnique Montréal
Scholars:
194
Papers: 87
Citations: 2.2K
U
université de montréal
Scholars:
1.0K
Papers: 435
Citations: 2.3W
Cited Papers

Cited Papers

err
IF0
err
err0
PREAI
err
errShare
errSave
Overexpression of Mitochondrial IF1 Prevents Metastatic Disease of Colorectal Cancer by Enhancing Anoikis and Tumor Infiltration of NK Cells
err2019-12-19
err0
errOAAI
errLucía González-Llorente; Fulvio Santacatterina; Ana García-Aguilar; Cristina Nuevo-Tapioles; Sara González-García; Zuzana Tirpakova; María Luisa Toribio; José M. Cuezva
errShare
errSave
Subnormal parasympathetic activity after cardiac transplantation
err1990-11-01
err0
PREAI
errMichael L. Smith; Kenneth A. Ellenbogen; Dwain L. Eckberg; Helen M. Sheehan; Marc D. Thames
errShare
errSave
Incidence of urinary tract complications with myelomeningocele
err1985-04-01
err0
PREAI
errA.S. Cass; M. Luxenberg; C.F. Johnson; P. Gleich
errShare
errSave
researcher View more