Skip to main content
QUICK REVIEW

[Paper Review] A Systematic Evaluation of API-Misuse Detectors

Sven Amann, Hoan Anh Nguyen|arXiv (Cornell University)|Jan 1, 2018
Software Engineering ResearchComputer Science6 citations
TL;DR

This paper presents the first systematic evaluation of static API-misuse detectors using a novel benchmark, MUBenchPipe, and a unified misuse taxonomy, MUC. It reveals that existing detectors suffer from low precision and recall, primarily due to over-reliance on frequent usage patterns, and calls for models that incorporate diverse usage examples to improve detection accuracy.

ABSTRACT

Application Programming Interfaces (APIs) often have usage constraints, such as restrictions on call order or call conditions. API misuses, i.e., violations of these constraints, may lead to software crashes, bugs, and vulnerabilities. Though researchers developed many API-misuse detectors over the last two decades, recent studies show that API misuses are still prevalent. Therefore, we need to understand the capabilities and limitations of existing detectors in order to advance the state of the art. In this paper, we present the first-ever qualitative and quantitative evaluation that compares static API-misuse detectors along the same dimensions, and with original author validation. To accomplish this, we develop MUC, a classification of API misuses, and MUBenchPipe, an automated benchmark for detector comparison, on top of our misuse dataset, MUBench. Our results show that the capabilities of existing detectors vary greatly and that existing detectors, though capable of detecting misuses, suffer from extremely low precision and recall. A systematic root-cause analysis reveals that, most importantly, detectors need to go beyond the naive assumption that a deviation from the most-frequent usage corresponds to a misuse and need to obtain additional usage examples to train their models. We present possible directions towards more-powerful API-misuse detectors.

Motivation & Objective

  • To address the persistent prevalence of API misuses despite decades of detector development.
  • To establish a standardized, reproducible evaluation framework for comparing static API-misuse detectors.
  • To identify key limitations in current detectors through qualitative and quantitative analysis.
  • To provide actionable insights for improving future API-misuse detection techniques.
  • To validate findings with original authors to ensure accuracy and relevance of the evaluation.

Proposed method

  • Developed MUC, a comprehensive classification of API misuses based on usage constraints such as call order and conditions.
  • Built MUBench, a curated dataset of real-world API misuse examples across diverse programming languages and libraries.
  • Designed MUBenchPipe, an automated benchmark pipeline for evaluating detectors using the MUBench dataset.
  • Standardized evaluation across multiple dimensions, including precision, recall, and false positive rates.
  • Conducted a root-cause analysis of detector failures by comparing detection patterns against actual misuse semantics.
  • Involved original detector authors in validation to ensure accurate interpretation of results.

Experimental results

Research questions

  • RQ1How do existing static API-misuse detectors perform in terms of precision and recall across diverse misuse categories?
  • RQ2What are the primary causes of false positives and false negatives in current detectors?
  • RQ3To what extent do detectors rely on frequent usage patterns as a proxy for correctness?
  • RQ4How do detector capabilities vary across different programming languages and API libraries?
  • RQ5What improvements are needed to significantly enhance the accuracy of API-misuse detection?

Key findings

  • Existing API-misuse detectors exhibit extremely low precision and recall, with average F1-scores below 0.5 across most benchmarks.
  • Detectors frequently misclassify valid, less-frequent usage patterns as misuses due to over-reliance on common call sequences.
  • The root cause of poor performance lies in the naive assumption that deviations from the most frequent usage are always incorrect.
  • Detectors that incorporate diverse usage examples—beyond just the most common patterns—show significantly improved detection accuracy.
  • Author validation confirmed that many reported misuses were actually correct usage patterns, highlighting the need for better training data.
  • The study identifies a critical gap in current models: they lack mechanisms to model semantic correctness beyond syntactic or frequency-based heuristics.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.