The reviewed record of science sign in
Pith

arxiv: 1908.06492 · v1 · pith:5JQI7DIE · submitted 2019-08-18 · cs.SE

API Misuse Correction: A Statistical Approach

Reviewed by Pith T0 review T1 audit T2 compute T3 formal T4 kernel pith:5JQI7DIErecord.jsonopen to challenge →

classification cs.SE
keywords statisticalcodemethodmisusemisusesmodelsapproachcall
0
0 comments X
read the original abstract

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.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.