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

08/27/2021
by   Sebastian Nielebock, et al.
0

Modern software development heavily relies on the reuse of functionalities through Application Programming Interfaces (APIs). However, client developers can have issues identifying the correct usage of a certain API, causing misuses accompanied by software crashes or usability bugs. Therefore, researchers have aimed at identifying API misuses automatically by comparing client code usages to correct API usages. Some techniques rely on certain API-specific graph-based data structures to improve the abstract representation of API usages. Such techniques need to compare graphs, for instance, by computing distance metrics based on the minimal graph edit distance or the largest common subgraphs, whose computations are known to be NP-hard problems. Fortunately, there exist many abstractions for simplifying graph distance computation. However, their applicability for comparing graph representations of API usages has not been analyzed. In this paper, we provide a comparison of different distance algorithms of API-usage graphs regarding correctness and runtime. Particularly, correctness relates to the algorithms' ability to identify similar correct API usages, but also to discriminate similar correct and false usages as well as non-similar usages. For this purpose, we systematically identified a set of eight graph-based distance algorithms and applied them on two datasets of real-world API usages and misuses. Interestingly, our results suggest that existing distance algorithms are not reliable for comparing API usage graphs. To improve on this situation, we identified and discuss the algorithms' issues, based on which we formulate hypotheses to initiate research on overcoming them.

READ FULL TEXT
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
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
07/30/2022

Mining unit test cases to synthesize API usage examples

Software developers study and reuse existing source code to understand h...
research
08/01/2020

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

Lack of experience, inadequate documentation, and sub-optimal API design...
research
03/16/2018

Identifying Components from Object-Oriented APIs Based on Dynamic Analysis

The reuse at the component level is generally more effective than the on...
research
12/28/2020

API Misuse Detection An Immune System inspired Approach

APIs are essential ingredients for developing complex software systems. ...
research
08/26/2019

Analyzing 2.3 Million Maven Dependencies to Reveal an Essential Core in APIs

This paper addresses the following question: does a small, essential, co...

Please sign up or login with your details

Forgot password? Click here to reset