Table of Contents
Fetching ...

ASAP-Repair: API-Specific Automated Program Repair Based on API Usage Graphs

Sebastian Nielebock, Paul Blockhaus, Jacob Krüger, Frank Ortmeier

TL;DR

This work tackles API misuse by proposing ASAP-Repair, an API-specific automated program repair method that uses API Usage Graphs (AUGs) and templates derived from misuse detectors. It employs two template families—pattern AUGs and change-rule AUGs—and a graph-matching workflow (Kuhn–Munkres) to generate fixes at the AUG level without requiring test execution. Preliminary evaluation on the MUBench dataset indicates that rule-based repairs yield higher precision than pattern-based ones, though both face practical limitations such as timeouts and invalid augmentations. The paper outlines future work to translate AUG repairs into source code, expand misuse datasets, and benchmark against state-of-the-art APR techniques to progress toward a full APR solution for API misuses.

Abstract

Modern software development relies on the reuse of code via Application Programming Interfaces (APIs). Such reuse relieves developers from learning and developing established algorithms and data structures anew, enabling them to focus on their problem at hand. However, there is also the risk of misusing an API due to a lack of understanding or proper documentation. While many techniques target API misuse detection, only limited efforts have been put into automatically repairing API misuses. In this paper, we present our advances on our technique API-Specific Automated Program Repair (ASAP-Repair). ASAP-Repair is intended to fix API misuses based on API Usage Graphs (AUGs) by leveraging API usage templates of state-of-the-art API misuse detectors. We demonstrate that ASAP-Repair is in principle applicable on an established API misuse dataset. Moreover, we discuss next steps and challenges to evolve ASAP-Repair towards a full-fledged Automatic Program Repair (APR) technique.

ASAP-Repair: API-Specific Automated Program Repair Based on API Usage Graphs

TL;DR

This work tackles API misuse by proposing ASAP-Repair, an API-specific automated program repair method that uses API Usage Graphs (AUGs) and templates derived from misuse detectors. It employs two template families—pattern AUGs and change-rule AUGs—and a graph-matching workflow (Kuhn–Munkres) to generate fixes at the AUG level without requiring test execution. Preliminary evaluation on the MUBench dataset indicates that rule-based repairs yield higher precision than pattern-based ones, though both face practical limitations such as timeouts and invalid augmentations. The paper outlines future work to translate AUG repairs into source code, expand misuse datasets, and benchmark against state-of-the-art APR techniques to progress toward a full APR solution for API misuses.

Abstract

Modern software development relies on the reuse of code via Application Programming Interfaces (APIs). Such reuse relieves developers from learning and developing established algorithms and data structures anew, enabling them to focus on their problem at hand. However, there is also the risk of misusing an API due to a lack of understanding or proper documentation. While many techniques target API misuse detection, only limited efforts have been put into automatically repairing API misuses. In this paper, we present our advances on our technique API-Specific Automated Program Repair (ASAP-Repair). ASAP-Repair is intended to fix API misuses based on API Usage Graphs (AUGs) by leveraging API usage templates of state-of-the-art API misuse detectors. We demonstrate that ASAP-Repair is in principle applicable on an established API misuse dataset. Moreover, we discuss next steps and challenges to evolve ASAP-Repair towards a full-fledged Automatic Program Repair (APR) technique.
Paper Structure (5 sections, 2 figures, 1 table)

This paper contains 5 sections, 2 figures, 1 table.

Figures (2)

  • Figure 1: AUG (left) and change rule (right) for the example code in \ref{['fig:code']}.
  • Figure 2: Concept of Pattern- and Rule-based API-specific Automated Program Repair