[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 14 ]

Journal of Information Science and Engineering, Vol. 34 No. 3, pp. 593-610

Methods for Categorizing and Recommending API Usage Patterns Based on Degree Centralities and Pattern Distances

1Computer and Network Center
3Department of Computer Science and Information Engineering
National Cheng Kung University
Tainan, 701 Taiwan

2Department of Clinical Sciences
University of Kentucky
Lexington, KY 40506 USA
E-mail: jielee@mail.ncku.edu.tw; wuchen_sue@hotmail.com; {tony4794; ygl0118}@gmail.com

  API usage patterns have been considered as significant materials in reusing software library APIs for saving development time and improving software quality. Although efforts have been made on discovering and searching API usage patterns, the following two issues are still largely unexplored: how to provide a well-organized view of the discovered API usage patterns? and how to recommend follow-up API usage patterns once a usage pattern is adopted? This paper proposes two methods for categorizing and recommending API usage patterns: first, categories of the usage patterns are automatically identified based on a proposed degree centrality-based clustering algorithm; and second, follow-up usage patterns of an adopted pattern are recommended based on a proposed metric of measuring distances between patterns. In the experimental evaluations, the patterns categorization can achieve 85.4% precision rate with 83% recall rate. The patterns recommendation had approximately half a chance of correctly predicting the follow-up patterns that were actually used by the programmers.

Keywords: API usage pattern, code example, code search system, API usage patterns categorization, API usage patterns recommendation

  Retrieve PDF document (JISE_201803_03.pdf)