MAPO: Mining and Recommending API Usage Patterns

被引:0
|
作者
Zhong, Hao [2 ,3 ]
Xie, Tao [1 ]
Zhang, Lu [2 ,3 ]
Pei, Jian [4 ]
Mei, Hong [2 ,3 ]
机构
[1] N Carolina State Univ, Dept Comp Sci, Raleigh, NC 27695 USA
[2] Key Lab High Confidence Software Technol, Minist Educ, Hong Kong, Peoples R China
[3] Peking Univ, Sch Elect Engn & Comp Sci, Beijing, Peoples R China
[4] Simon Fraser Univ, Sch Comp Sci, Burnaby, BC V5A 1S6, Canada
来源
基金
加拿大自然科学与工程研究理事会; 美国国家科学基金会;
关键词
STRUCTURAL CONTEXT;
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
To improve software productivity, when constructing new software systems, programmers often reuse existing libraries or frameworks by invoking methods provided in their APIs. Those API methods, however, are often complex and not well documented. To get familiar with how those API methods are used, programmers often exploit a source code search tool to search for code snippets that use the API methods of interest. However, the returned code snippets are often large in number, and the huge number of snippets places a barrier for programmers to locate useful ones. In order to help programmers overcome this barrier, we have developed an API usage mining framework and its supporting tool called MAPO (Mining API usage Pattern from Open source repositories) for mining API usage patterns automatically. A mined pattern describes that in a certain usage scenario, some API methods are frequently called together and their usages follow some sequential rules. MAPO further recommends the mined API usage patterns and their associated code snippets upon programmers requests. Our experimental results show that with these patterns MAPO helps programmers locate useful code snippets more effectively than two state-of-the-art code search tools. To investigate whether MAPO can assist programmers in programming tasks, we further conducted an empirical study. The results show that using MAPO, programmers produce code with fewer bugs when facing relatively complex API usages, comparing with using the two state-of-the-art code search tools.
引用
收藏
页码:318 / +
页数:4
相关论文
共 50 条
  • [1] Mining usage patterns for the Android API
    Borges, Hudson S.
    Valente, Marco Tulio
    PEERJ COMPUTER SCIENCE, 2015, 2015 (07)
  • [2] Recommending Optimal API Orchestration with Mining Frequent Mashup Patterns
    Peng, Dunlu
    Xie, Lei
    Kai, Duan
    Li, Feitian
    INTERNATIONAL JOURNAL OF GRID AND DISTRIBUTED COMPUTING, 2014, 7 (03): : 233 - 250
  • [3] Categorizing and Recommending API Usage Patterns based on Degree Centralities and Pattern Distances
    Lee, Shin-Jie
    Su, Wu-Chen
    Huang, Chi-En
    You, Jie-Lin
    2016 INTERNATIONAL COMPUTER SYMPOSIUM (ICS), 2016, : 583 - 588
  • [4] Mining Multi-level API Usage Patterns
    Saied, Mohamed Aymen
    Benomar, Omar
    Abdeen, Hani
    Sahraoui, Houari
    2015 22ND INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER), 2015, : 23 - 32
  • [5] Methods for Categorizing and Recommending API Usage Patterns Based on Degree Centralities and Pattern Distances
    Lee, Shin-Jie
    Su, Wu-Chen
    Huang, Chi-En
    You, Jie-Lin
    JOURNAL OF INFORMATION SCIENCE AND ENGINEERING, 2018, 34 (03) : 593 - 610
  • [6] 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
  • [7] 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
  • [8] 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
  • [9] 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
  • [10] APISonar: Mining API usage examples
    Hora, Andre
    SOFTWARE-PRACTICE & EXPERIENCE, 2021, 51 (02): : 319 - 352