API Misuse Correction: A Statistical Approach

08/18/2019
by   Tam The Nguyen, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

research
02/18/2021

APIScanner – Towards Automated Detection of Deprecated APIs in Python Libraries

Python libraries are widely used for machine learning and scientific com...
research
12/12/2018

CAMLroot: revisiting the OCaml FFI

The OCaml language comes with a facility for interfacing with C code -- ...
research
02/01/2021

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...
research
01/05/2022

ARCLIN: Automated API Mention Resolution for Unformatted Texts

Online technical forums (e.g., StackOverflow) are popular platforms for ...
research
12/31/2021

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

OWLOOP is an Application Programming Interface (API) for using the Ontol...
research
06/11/2023

ARIST: An Effective API Argument Recommendation Approach

Learning and remembering to use APIs are difficult. Several techniques h...
research
10/16/2022

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...

Please sign up or login with your details

Forgot password? Click here to reset