DeepAI AI Chat
Log In Sign Up

API Misuse Correction: A Statistical Approach

by   Tam The Nguyen, et al.
Auburn University

Modern software development relies heavily on Application Programming Interface (API) libraries. However, there are often certain constraints on using API elements in such libraries. Failing to follow such constraints (API misuse) could lead to serious programming errors. Many approaches have been proposed to detect API misuses, but they still have low accuracy and cannot repair the detected misuses. In this paper, we propose SAM, a novel approach to detect and repair API misuses automatically. SAM uses statistical models to describe five factors involving in any API method call: related method calls, exceptions, pre-conditions, post-conditions, and values of arguments. These statistical models are trained from a large repository of high-quality production code. Then, given a piece of code, SAM verifies each of its method calls with the trained statistical models. If a factor has a sufficiently low probability, the corresponding call is considered as an API misuse. SAM performs an optimal search for editing operations to apply on the code until it has no API issue.


page 1

page 2

page 3


APIScanner – Towards Automated Detection of Deprecated APIs in Python Libraries

Python libraries are widely used for machine learning and scientific com...

CAMLroot: revisiting the OCaml FFI

The OCaml language comes with a facility for interfacing with C code -- ...

Automatically Identifying Parameter Constraints in Complex Web APIs: A Case Study at Adyen

Web APIs may have constraints on parameters, such that not all parameter...

ARCLIN: Automated API Mention Resolution for Unformatted Texts

Online technical forums (e.g., StackOverflow) are popular platforms for ...

OWLOOP: A Modular API to Describe OWL Axioms in OOP Objects Hierarchies

OWLOOP is an Application Programming Interface (API) for using the Ontol...

ARIST: An Effective API Argument Recommendation Approach

Learning and remembering to use APIs are difficult. Several techniques h...

Interpretable Machine Learning for Detection and Classification of Ransomware Families Based on API Calls

Ransomware has appeared as one of the major global threats in recent day...