Skip to Main content Skip to Navigation
Conference papers

Detecting and Ranking API Usage Pattern in Large Source Code Repository: A LFM Based Approach

Abstract : Code examples are key resources for helping programmers to learn correct Application Programming Interface (API) usages efficiently. However, most framework and library APIs fail in providing sufficient and adequate code examples in corresponding official documentations. Thus, it takes great programmers’ efforts to browse and extract API usage examples from websites. To reduce such effort, this paper proposes a graph-based pattern-oriented mining approach, LFM-OUPD (Local fitness measure for detecting overlapping usage patterns) for API usage facility, that recommends proper API code examples from data analytics. API method queries are accepted from programmers and corresponding code files are collected from related API dataset. The detailed structural links among API method elements in conceptual source codes are captured and generate a code graph structure. Lancichinetti et al. proposed an overlapping community detecting algorithm (Local fitness measure, LFM), based on the local optimization of a fitness function. In LFM-OUPD, a mining algorithm based on LFM is presented to explore the division of method sequences in the directed source code element graph and detect candidates of different API usage patterns. Then a ranking approach is applied to obtain appropriate API usage pattern and code example candidates. A case study on Google Guava is conducted to evaluate the effectiveness of this approach.
Complete list of metadata

Cited literature [22 references]  Display  Hide  Download

https://hal.inria.fr/hal-01677142
Contributor : Hal Ifip <>
Submitted on : Monday, January 8, 2018 - 9:50:05 AM
Last modification on : Wednesday, March 28, 2018 - 4:35:04 PM
Long-term archiving on: : Saturday, May 5, 2018 - 1:35:23 AM

File

456304_1_En_4_Chapter.pdf
Files produced by the author(s)

Licence


Distributed under a Creative Commons Attribution 4.0 International License

Identifiers

Citation

Jitong Zhao, Yan Liu. Detecting and Ranking API Usage Pattern in Large Source Code Repository: A LFM Based Approach. 1st International Cross-Domain Conference for Machine Learning and Knowledge Extraction (CD-MAKE), Aug 2017, Reggio, Italy. pp.41-56, ⟨10.1007/978-3-319-66808-6_4⟩. ⟨hal-01677142⟩

Share

Metrics

Record views

637

Files downloads

124