APISonar: Mining API usage examples

被引:4
|
作者
Hora, Andre [1 ]
机构
[1] Univ Fed Minas Gerais, Dept Comp Sci, Belo Horizonte, MG, Brazil
来源
SOFTWARE-PRACTICE & EXPERIENCE | 2021年 / 51卷 / 02期
关键词
API usage examples; framework; library; mining software repositories; software maintenance; CODE SEARCH ENGINE;
D O I
10.1002/spe.2906
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Developers spend a significant part of their time searching for code examples on the web. Often, they look for Application Programming Interface (API) usage examples, that is, how to use APIs provided by libraries and frameworks. For this purpose, several programming websites are available. Some programming websites provide manually created examples: unfortunately, as millions of APIs are available nowadays, they do not cover the majority of the APIs. To alleviate this limitation, other programming websites focus on automatically mining API usage examples from code repositories. To the best of our knowledge, however, these solutions are still very limited: they often present poor, duplicated, and similar API usage examples. In this article, we propose an approach, APISonar, to automatically mine API usage examples from code repositories. Our approach aims to overcome the limitations of current solutions: we focus on presenting readable and reusable API usage examples. We analyze millions of source files provided by 4486 software projects hosted on GitHub. Based on this data, we extract 11 million API usage examples about 1.5 million distinct APIs. We evaluate APISonar by assessing its quality and usage. We show that APISonar is a competitive solution, providing the best API examples in terms of readability and reusability, as compared with popular programming websites. Moreover, despite being a novel website, APISonar attracted a significant amount of users in a short period (3.7K users from 119 countries during 5 months). APISonar is available at www.apisonar.com.
引用
收藏
页码:319 / 352
页数:34
相关论文
共 50 条
  • [31] Mining Succinct and High-Coverage API Usage Patterns from Source Code
    Wang, Jue
    Dang, Yingnong
    Zhang, Hongyu
    Chen, Kai
    Xie, Tao
    Zhang, Dongmei
    2013 10TH IEEE WORKING CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR), 2013, : 319 - 328
  • [32] Mining Android API Usage to Generate Unit Test Cases for Pinpointing Compatibility Issues
    Sun, Xiaoyu
    Chen, Xiao
    Zhao, Yanjie
    Liu, Pei
    Grundy, John
    Li, Li
    PROCEEDINGS OF THE 37TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE 2022, 2022,
  • [33] API documentation with executable examples
    Hoffman, D
    Strooper, P
    JOURNAL OF SYSTEMS AND SOFTWARE, 2003, 66 (02) : 143 - 156
  • [34] Improving API Documentation Using API Usage Information
    Stylos, Jeffrey
    Faulring, Andrew
    Yang, Zizhuang
    Myers, Brad A.
    2009 IEEE SYMPOSIUM ON VISUAL LANGUAGES AND HUMAN-CENTRIC COMPUTING, PROCEEDINGS, 2009, : 119 - 126
  • [35] Discovering API usage specifications for security detection using two-stage code mining
    Yin, Zhongxu
    Song, Yiran
    Zong, Guoxiao
    CYBERSECURITY, 2024, 7 (01):
  • [36] Detecting Inefficient API Usage
    Kawrykow, David
    Robillard, Martin P.
    2009 31ST INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, COMPANION VOLUME, 2009, : 183 - 186
  • [37] Mining API Popularity
    Mileva, Yana Momchilova
    Dallmeier, Valentin
    Zeller, Andreas
    TESTING - PRACTICE AND RESEARCH TECHNIQUES, 2010, 6303 : 173 - 180
  • [38] MULAPI: Improving API method recommendation with API usage location
    Xu, Congying
    Sun, Xiaobing
    Li, Bin
    Lu, Xintong
    Guo, Hongjing
    JOURNAL OF SYSTEMS AND SOFTWARE, 2018, 142 : 195 - 205
  • [39] The Use of Tin Can API for Web Usage Mining in E-learning Applications on the Social Network
    Hamzah, W. M. Amir Fazamin W.
    Ali, Noraida Haji
    Saman, Md. Yazid Mohd
    Yusoff, Mohd Hafiz
    Yacob, Azliza
    ISCAIE 2015 - 2015 IEEE SYMPOSIUM ON COMPUTER APPLICATIONS AND INDUSTRIAL ELECTRONICS, 2015, : 113 - 118
  • [40] A Cooperative Approach for Combining Client-based and Library-based API Usage Pattern Mining
    Saied, Mohamed Aymen
    Sahraoui, Houari
    2016 IEEE 24TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC), 2016,