arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1908.06492cs.SE
收藏

API Misuse Correction: A Statistical Approach

Tam The Nguyen, Phong Minh Vu, Tung Thanh Nguyen

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑