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 条
  • [1] Mining API Usage Examples from Test Code
    Zhu, Zixiao
    Zou, Yanzhen
    Xie, Bing
    Jin, Yong
    Lin, Zeqi
    Zhang, Lu
    2014 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2014, : 301 - 310
  • [2] Mining unit test cases to synthesize API usage examples
    Ghafari, Mohammad
    Rubinov, Konstantin
    Pourhashem K, Mohammad Mehdi
    JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2017, 29 (12)
  • [3] Synthesizing API Usage Examples
    Buse, Raymond P. L.
    Weimer, Westley
    2012 34TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2012, : 782 - 792
  • [4] Synthesising Linear API Usage Examples for API Documentation
    Alharbi, Seham
    Kolovos, Dimitris
    Matragkas, Nicholas
    2022 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2022), 2022, : 607 - 611
  • [5] Unit Tests as API Usage Examples
    Nasehi, Seyed Mehdi
    Maurer, Frank
    2010 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE, 2010,
  • [6] Visualizing API Usage Examples at Scale
    Glassman, Elena L.
    Zhang, Tianyi
    Hartmann, Bjoern
    Kim, Miryung
    PROCEEDINGS OF THE 2018 CHI CONFERENCE ON HUMAN FACTORS IN COMPUTING SYSTEMS (CHI 2018), 2018,
  • [7] An Exploratory Study of API Usage Examples on the Web
    Wang, Lijie
    Zou, Yanzhen
    Fang, Lu
    Xie, Bing
    Yang, Fuqing
    2012 19TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC), VOL 1, 2012, : 396 - 405
  • [8] Inappropriate Usage Examples in Web API Documentations
    Hosono, Masaki
    Washizaki, Hironori
    Honda, Kiyoshi
    Nagumo, Hiromasa
    Sonoda, Hisanobu
    Fukazawa, Yoshiaki
    Munakata, Kazuki
    Nakagawa, Takao
    Nemoto, Yusuke
    Tokumoto, Susumu
    Monpratarnchai, Supasit
    2019 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2019), 2019, : 343 - 347
  • [9] Mining usage patterns for the Android API
    Borges, Hudson S.
    Valente, Marco Tulio
    PEERJ COMPUTER SCIENCE, 2015, 2015 (07)
  • [10] A Study of the Effectiveness of Usage Examples in REST API Documentation
    Sohan, S. M.
    Maurer, Frank
    Anslow, Craig
    Robillard, Martin P.
    2017 IEEE SYMPOSIUM ON VISUAL LANGUAGES AND HUMAN-CENTRIC COMPUTING (VL/HCC), 2017, : 53 - 61