skip to main content
10.1145/3374135.3385307acmconferencesArticle/Chapter ViewAbstractPublication Pagesacm-seConference Proceedingsconference-collections
short-paper

API Misuse Correction: A Fuzzy Logic Approach

Published:25 May 2020Publication History

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.

References

  1. S. Amann, S. Nadi, H. A. Nguyen, T. N. Nguyen, and M. Mezini. 2016. MUBench: A Benchmark for API-Misuse Detectors. In MSR. Austin, USA.Google ScholarGoogle Scholar
  2. S. Amann, H. A. Nguyen, S. Nadi, T. N. Nguyen, and M. Mezini. 2018. A Systematic Evaluation of Static API-Misuse Detectors. TSE (2018).Google ScholarGoogle Scholar
  3. S. Amann, H. A. Nguyen, S. Nadi, T. N.Nguyen, and M. Mezini. 2019. Investigating Next Steps in Static API-misuse Detection. In MSR. Montreal, Canada.Google ScholarGoogle Scholar
  4. M. Kechagia and D. Spinellis. 2014. Undocumented and Unchecked: Exceptions That Spell Trouble. In MSR. Hyderabad, India.Google ScholarGoogle Scholar
  5. T. Luo, J. Wu, M. Yang, S. Zhao, Y. Wu, and Y. Wang. 2018. MAD-API: Detection, Correction and Explanation of API Misuses in Distributed Android Applications. In AIMS. Taipei, Taiwan.Google ScholarGoogle Scholar
  6. M. Monperrus, M. Bruch, and M. Mezini. 2010. Detecting Missing Method Calls in Object-Oriented Software. In ECOOP. Maribor, Slovenia.Google ScholarGoogle Scholar
  7. M. Monperrus and M. Mezini. 2013. Detecting Missing Method Calls As Violations of the Majority Rule. TOSEM (2013).Google ScholarGoogle Scholar
  8. T. Nguyen, H. Nguyen, N. Pham, J. Al-Kofahi, and T. Nguyen. 2009. Graph-based Mining of Multiple Object Usage Patterns. In FSE. Amsterdam, Netherlands.Google ScholarGoogle Scholar
  9. T. Nguyen, H. Pham, P. Vu, and T. Nguyen. 2015. Recommending API Usages for Mobile Apps with Hidden Markov Model. In ASE. Lincoln, USA.Google ScholarGoogle Scholar
  10. T. Nguyen, P. Vu, and T. Nguyen. 2019. API Misuse Correction: A Statistical Approach. In ASE. San Diego, USA.Google ScholarGoogle Scholar
  11. T. Nguyen, P. Vu, and T. Nguyen. 2019. An Empirical Study of Exception Handling Bugs and Fixes. In ACMSE. Kennesaw, USA.Google ScholarGoogle Scholar
  12. T. Nguyen, P. Vu, and T. Nguyen. 2019. Recommending Exception Handling Code. In ICSME. Cleveland, USA.Google ScholarGoogle Scholar
  13. M. Syer, M. Nagappan, A. Hassan, and B. Adams. 2013. Revisiting Prior Empirical Findings for Mobile Apps: An Empirical Case Study on the 15 Most Popular Open-source Android Apps. In CASCON. Riverton, USA.Google ScholarGoogle Scholar
  14. S. Thummalapenta and T. Xie. 2009. Alattin: Mining Alternative Patterns for Detecting Neglected Conditions. In ASE. Auckland, New Zealand.Google ScholarGoogle Scholar
  15. S. Thummalapenta and T. Xie. 2009. Mining Exception-handling Rules As Sequence Association Rules. In ICSE. Vancouver, Canada.Google ScholarGoogle Scholar
  16. A. Wasylkowski and A. Zeller. 2009. Mining Temporal Specifications from Object Usage. In ASE. Auckland, New Zealand.Google ScholarGoogle Scholar
  17. A. Wasylkowski, A. Zeller, and C. Lindig. 2007. Detecting Object Usage Anomalies. In FSE. New York, USA.Google ScholarGoogle Scholar

Index Terms

  1. API Misuse Correction: A Fuzzy Logic Approach

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          ACM SE '20: Proceedings of the 2020 ACM Southeast Conference
          April 2020
          337 pages
          ISBN:9781450371056
          DOI:10.1145/3374135

          Copyright © 2020 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 25 May 2020

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • short-paper
          • Research
          • Refereed limited

          Acceptance Rates

          Overall Acceptance Rate178of377submissions,47%
        • Article Metrics

          • Downloads (Last 12 months)13
          • Downloads (Last 6 weeks)0

          Other Metrics

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader