Guided Pattern Mining for API Misuse Detection by Change-Based Code Analysis

08/01/2020
by   Sebastian Nielebock, et al.
0

Lack of experience, inadequate documentation, and sub-optimal API design frequently cause developers to make mistakes when re-using third-party implementations. Such API misuses can result in unintended behavior, performance losses, or software crashes. Therefore, current research aims to automatically detect such misuses by comparing the way a developer used an API to previously inferred patterns of the correct API usage. While research has made significant progress, these techniques have not yet been adopted in practice. In part, this is due to the still high numbers of false-positive patterns, but also due to the lack of a process capable of seamlessly integrating with software development processes. In this paper, we target both problems: (a) by providing a method which increases the likelihood of finding relevant and true-positive patterns concerning a given set of code changes and (b) by introducing a just-in-time API misuse detection process which analyzes changes at the time of commit. Particularly, we introduce different, lightweight code search and filtering strategies and evaluated them on 37 real-world API misuses to determine their usefulness in finding relevant API usage patterns. Our main results are (1) commit-based search with subsequent filtering effectively decreases the amount of code to be analyzed, (2) in particular method-level filtering is superior to file-level filtering, (3) project-internal and project-external code search find solutions for different types of misuses and thus are complementary, (4) incorporating prior knowledge of the misused API into the search has a negligible effect.

READ FULL TEXT

page 41

page 42

research
07/14/2022

Automated Change Rule Inference for Distance-Based API Misuse Detection

Developers build on Application Programming Interfaces (APIs) to reuse e...
research
02/16/2021

Automatic Detection of Five API Documentation Smells: Practitioners' Perspectives

The learning and usage of an API is supported by official documentation....
research
06/04/2023

Crypto-ransomware Detection through Quantitative API-based Behavioral Profiling

With crypto-ransomware's unprecedented scope of impact and evolving leve...
research
08/27/2021

An Experimental Analysis of Graph-Distance Algorithms for Comparing API Usages

Modern software development heavily relies on the reuse of functionaliti...
research
12/14/2022

API-Spector: an API-to-API Specification Recommendation Engine

When designing a new API for a large project, developers need to make sm...
research
04/21/2022

Active Learning of Discriminative Subgraph Patterns for API Misuse Detection

A common cause of bugs and vulnerabilities are the violations of usage c...
research
12/07/2021

IntelliTC: Automating Type Changes in IntelliJ IDEA

Developers often change the types of program elements. Such a refactorin...

Please sign up or login with your details

Forgot password? Click here to reset