[Paper Review] Parameter-Free Probabilistic API Mining at GitHub Scale
This paper introduces PAM, a near parameter-free probabilistic algorithm for mining informative API call patterns from large-scale GitHub codebases. By leveraging hand-written examples from 967 client projects (over 300,000 LOC), PAM achieves 70% test-set precision in retrieving relevant API sequences, significantly outperforming MAPO and UPMiner while reducing redundancy and improving interpretability.
Existing API mining algorithms are not yet practical to use as they require expensive parameter tuning and the returned set of API calls can be large, highly redundant and difficult to understand. In an attempt to remedy these shortcomings we present PAM (Probabilistic API Miner), a near parameter-free probabilistic algorithm for mining the most informative API call patterns. We show that PAM significantly outperforms both MAPO and UPMiner, achieving 70% test-set precision, at retrieving relevant API call sequences from GitHub. Moreover, we focus on libraries for which the developers have explicitly provided code examples, yielding over 300,000 LOC of hand-written API example code from the 967 client projects in the data set. This evaluation suggests that the hand-written examples actually have limited coverage of real API usages.
Motivation & Objective
- To address the impracticality of existing API mining algorithms due to extensive parameter tuning and high redundancy in results.
- To develop a scalable, near parameter-free method for identifying the most informative API call sequences in large codebases.
- To evaluate the coverage of hand-written API examples in real-world usage by analyzing their alignment with mined patterns.
- To improve the interpretability and utility of mined API patterns for developers and tooling.
Proposed method
- PAM employs a probabilistic model to rank API call sequences based on their informativeness and co-occurrence patterns in code.
- It uses a Bayesian scoring function to identify high-probability sequences without requiring manual parameter configuration.
- The method leverages hand-written example code from 967 GitHub client projects, totaling over 300,000 lines of code, as a source of ground truth and training signal.
- PAM applies a pruning strategy to eliminate redundant and low-information sequences, enhancing result clarity.
- The algorithm is evaluated on a large-scale GitHub dataset, comparing precision and recall against MAPO and UPMiner.
Experimental results
Research questions
- RQ1How effective is PAM at retrieving relevant API call sequences compared to existing methods like MAPO and UPMiner?
- RQ2To what extent do hand-written API examples in client projects reflect actual API usage patterns in production code?
- RQ3Can a parameter-free approach achieve high precision in mining API call patterns at scale?
- RQ4How does PAM reduce redundancy and improve interpretability of mined patterns?
Key findings
- PAM achieves 70% test-set precision in retrieving relevant API call sequences, significantly outperforming MAPO and UPMiner.
- The hand-written example code from 967 client projects covers only a limited portion of real API usage patterns, indicating a gap in example completeness.
- PAM reduces redundancy in mined sequences, resulting in more interpretable and actionable API patterns.
- The method operates with minimal parameter tuning, making it practical for large-scale use in real-world software engineering workflows.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.