Mining API patterns as partial orders from source code: From usage scenarios to specifications

Mithun Acharya, Tao Xie, Jian Pei, Jun Xu

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

A software system interacts with third-party libraries through various APIs. Using these library APIs often needs tofollow certain usage patterns. Furthermore, ordering rules (specifications) exist between APIs, and these rules govern the secure and robust operation of the system using these APIs. But these patterns and rules may not be well documented by the API developers. Previous approaches mine frequent association rules, itemsets, or subsequences that capture API call patterns shared by API client code. However, these frequent API patterns cannot completely capture some useful orderings shared by APIs, especially when multiple APIs are involved across different procedures. In this paper, we present a framework to automatically extract usage scenarios among user-specified APIs as partial orders, directly from the source code (API client code). We adapt a model checker to generate interprocedural control-flow-sensitive static traces related to the APIs of interest. Different API usage scenarios are extracted from the static traces by our scenario extraction algorithm and fed to a miner. The miner summarizes different usage scenarios as compact partial orders. Specifications are extracted from the frequent partial orders using our specification extraction algorithm. Our experience of applying the framework on 72 X11 clients with 200K LOC in total has shown that theextracted API partial orders are useful in assisting effective API reuse and checking.

Original languageEnglish (US)
Title of host publication6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2007
Pages25-34
Number of pages10
DOIs
StatePublished - Dec 1 2007
Externally publishedYes
Event6th Joint Meeting of the European Software Engineering Conference and the 14th ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2007 - Dubrovnik, Croatia
Duration: Sep 3 2007Sep 7 2007

Publication series

Name6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2007

Other

Other6th Joint Meeting of the European Software Engineering Conference and the 14th ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2007
CountryCroatia
CityDubrovnik
Period9/3/079/7/07

Keywords

  • API patterns
  • Mining
  • Partial orders
  • Specification
  • Usage scenarios

ASJC Scopus subject areas

  • Software
  • Computer Science Applications

Fingerprint Dive into the research topics of 'Mining API patterns as partial orders from source code: From usage scenarios to specifications'. Together they form a unique fingerprint.

  • Cite this

    Acharya, M., Xie, T., Pei, J., & Xu, J. (2007). Mining API patterns as partial orders from source code: From usage scenarios to specifications. In 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2007 (pp. 25-34). (6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2007). https://doi.org/10.1145/1287624.1287630