Detecting API usage patterns from software repositories using method categorization

Rizky Januar Akbar*, Takayuki Omori, Katsuhisa Maruyama

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review


Developers often have difficulties using APIs. To aid developers in efficiently using APIs, API usage patterns can be extracted from source code stored in software repositories. Previous approaches have mined repositories to extract API usage patterns by simply applying a data mining technique to the collection of method invocations of API objects. However, respective roles of invoked methods within API objects are not considered in these approaches. This paper proposes an improved approach that extracts API usage patterns at a higher-level abstraction rather than mining the actual method invocations. Our approach embraces a multilevel sequential mining technique and uses categorization of method invocations to define their concept hierarchy. In the categorization, the method invocations are categorized based on their roles. The extracted API usage patterns represent recurring usages of API objects. Therefore, they are useful to recommend typical usages of APIs. The experimental results show that our approach is practical to discover patterns that reveal characteristics of usages.

Original languageEnglish
Title of host publicationKnowledge-Based Software Engineering - Proceedings of the Tenth Conference on Knowledge-Based Software Engineering
PublisherIOS Press BV
Number of pages10
ISBN (Print)9781614990932
Publication statusPublished - 2012
Externally publishedYes

Publication series

NameFrontiers in Artificial Intelligence and Applications
ISSN (Print)0922-6389
ISSN (Electronic)1879-8314


  • API usage patterns
  • Mining software repositories
  • categorization


Dive into the research topics of 'Detecting API usage patterns from software repositories using method categorization'. Together they form a unique fingerprint.

Cite this