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 条
  • [21] Mining API usage change rules for software framework evolution
    Yu, Ping
    Yang, Fei
    Cao, Chun
    Hu, Hao
    Ma, Xiaoxing
    SCIENCE CHINA-INFORMATION SCIENCES, 2018, 61 (05)
  • [22] Mining API usage change rules for software framework evolution
    Ping YU
    Fei YANG
    Chun CAO
    Hao HU
    Xiaoxing MA
    Science China(Information Sciences), 2018, 61 (05) : 104 - 106
  • [23] Mining Complex Temporal API Usage Patterns: An Evolutionary Approach
    Huppe, Samuel
    Saied, Mohamed Aymen
    Sahraoui, Houari
    PROCEEDINGS OF THE 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C 2017), 2017, : 274 - 276
  • [24] Detecting API-Misuse Based on Pattern Mining via API Usage Graph with Parameters
    Wu, Yulin
    Xu, Zhiwu
    Qin, Shengchao
    THEORETICAL ASPECTS OF SOFTWARE ENGINEERING, TASE 2023, 2023, 13931 : 344 - 363
  • [25] FOCUS: A Recommender System for Mining API Function Calls and Usage Patterns
    Nguyen, Phuong T.
    Di Rocco, Juri
    Di Ruscio, Davide
    Ochoa, Lina
    Degueule, Thomas
    Di Penta, Massimiliano
    Proceedings - International Conference on Software Engineering, 2019, 2019-May : 1050 - 1060
  • [26] FOCUS: A Recommender System for Mining API Function Calls and Usage Patterns
    Nguyen, Phuong T.
    Di Rocco, Jun
    Di Ruscio, Davide
    Ochoa, Lina
    Degueule, Thomas
    Di Penta, Massimiliano
    2019 IEEE/ACM 41ST INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2019), 2019, : 1050 - 1060
  • [27] Towards Combining Usage Mining and Implementation Analysis to Infer API Preconditions
    Hoan Anh Nguyen
    Nguyen, Tien N.
    Rajan, Hridesh
    Dyer, Robert
    WASPI'18: PROCEEDINGS OF THE 1ST ACM SIGSOFT INTERNATIONAL WORKSHOP ON AUTOMATED SPECIFICATION INFERENCE, 2018, : 15 - 16
  • [28] Mining API Usage Patterns by Applying Method Categorization to Improve Code Completion
    Akbar, Rizky Januar
    Omori, Takayuki
    Maruyama, Katsuhisa
    IEICE TRANSACTIONS ON INFORMATION AND SYSTEMS, 2014, E97D (05): : 1069 - 1083
  • [29] Task-Oriented API Usage Examples Prompting Powered By Programming Task Knowledge Graph
    Sun, Jiamou
    Xing, Zhenchang
    Peng, Xin
    Xu, Xiwei
    Zhu, Liming
    2021 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2021), 2021, : 448 - 459
  • [30] A Dataset For API Usage
    Sawant, Anand Ashok
    Bacchelli, Alberto
    12TH WORKING CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR 2015), 2015, : 506 - 509