APIzation: Generating Reusable APIs from StackOverflow Code Snippets

被引:7
作者
Terragni, Valerio [1 ]
Salza, Pasquale [2 ]
机构
[1] Univ Auckland, Auckland, New Zealand
[2] Univ Zurich, Zurich, Switzerland
来源
2021 36TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING ASE 2021 | 2021年
关键词
APIs; software reuse; code snippets; StackOverflow; GitHub; program analysis; program synthesis; STACK; SEARCH;
D O I
10.1109/ASE51524.2021.9678576
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Developer forums like StackOverflow have become essential resources to modern software development practices. However, many code snippets lack a well-defined method declaration, and thus they are often incomplete for immediate reuse. Developers must adapt the retrieved code snippets by parameterizing the variables involved and identifying the return value. This activity, which we call APIzation of a code snippet, can be tedious and time-consuming. In this paper, we present APIzAToR to perform APIzations of JAVA code snippets automatically. APIzAToR is grounded by four common patterns that we extracted by studying real APIzations in GitHub. APIzAToR presents a static analysis algorithm that automatically extracts the method parameters and return statements. We evaluated APIzAToR with a ground-truth of 200 APIzations collected from 20 developers. For 113 (56.50 %) and 115 (57.50 %) APIzations, APIzAToR and the developers extracted identical parameters and return statements, respectively. For 163 (81.50 %) APIzations, either the parameters or the return statements were identical.
引用
收藏
页码:542 / 554
页数:13
相关论文
共 63 条
[1]   What Do Developers Use the Crowd For? A Study Using Stack Overflow [J].
Abdalkareem, Rabe ;
Shihab, Emad ;
Rilling, Juergen .
IEEE SOFTWARE, 2017, 34 (02) :53-60
[2]  
Ahasanuzzaman M, 2018, 2018 25TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2018), P244, DOI 10.1109/SANER.2018.8330213
[3]  
Badashian AS., 2014, CASCON, V14, P19
[4]   Usage and attribution of Stack Overflow code snippets in GitHub projects [J].
Baltes, Sebastian ;
Diehl, Stephan .
EMPIRICAL SOFTWARE ENGINEERING, 2019, 24 (03) :1259-1295
[5]   Attribution Required: Stack Overflow Code Snippets in GitHub Projects [J].
Baltes, Sebastian ;
Kiefer, Richard ;
Diehl, Stephan .
PROCEEDINGS OF THE 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C 2017), 2017, :161-163
[6]   A Manual Categorization of Android App Development Issues on Stack Overflow [J].
Beyer, Stefanie ;
Pinzger, Martin .
2014 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2014, :531-535
[7]  
Brandt J, 2010, CHI2010: PROCEEDINGS OF THE 28TH ANNUAL CHI CONFERENCE ON HUMAN FACTORS IN COMPUTING SYSTEMS, VOLS 1-4, P513
[8]   NLP2Code: Code Snippet Content Assist via Natural Language Tasks [J].
Campbell, Brock Angus ;
Treude, Christoph .
2017 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2017, :628-632
[9]   A Mobile Cloud Framework for Deep Learning and Its Application to Smart Car Camera [J].
Chen, Chien-Hung ;
Lee, Che-Rung ;
Lu, Walter Chen-Hua .
INTERNET OF VEHICLES - TECHNOLOGIES AND SERVICES, 2016, 10036 :14-25
[10]   TechLand: Assisting Technology Landscape Inquiries with Insights from Stack Overflow [J].
Chen, Chunyang ;
Xing, Zhenchang ;
Han, Lei .
32ND IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2016), 2016, :356-366