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 FAMI, a novel approach to detect and repair API misuses automatically. FAMI uses fuzzy set theory to represent usage rules of five factors involving in any API method call: related method calls, exceptions, pre-conditions, post-conditions, and values of arguments. These fuzzy sets are trained from a large repository of high-quality production code. Then, given a piece of code, FAMI verifies each of its method calls with the trained fuzzy sets. If a factor violates a usage rule defined by a fuzzy set, the corresponding call is considered as an API misuse. FAMI performs an optimal search for editing operations to apply on the code until it has no API issue.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.