Automated Program Repair Based on REST API Specifications Using Large Language Models

📅 2025-10-29
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
To address the challenge of locating and fixing REST API client misuses in cloud services, this paper proposes dcFix—a novel approach that jointly injects API specifications and non-compliant code snippets into large language model (LLM) prompts, integrating static analysis with prompt engineering to enable both violation detection and automated repair. Its core contribution is a specification-driven context enhancement mechanism that significantly improves the LLM’s comprehension of API semantic constraints. Experimental evaluation demonstrates that dcFix substantially outperforms baseline methods lacking specification integration, achieving higher accuracy in violation identification and greater success rates in automatic repair. The method enables end-to-end effective fixes across multiple real-world cloud API scenarios, validating its practical applicability and robustness.

Technology Category

Application Category

📝 Abstract
Many cloud services provide REST API accessible to client applications. However, developers often identify specification violations only during testing, as error messages typically lack the detail necessary for effective diagnosis. Consequently, debugging requires trial and error. This study proposes dcFix, a method for detecting and automatically repairing REST API misuses in client programs. In particular, dcFix identifies non-conforming code fragments, integrates them with the relevant API specifications into prompts, and leverages a Large Language Model (LLM) to produce the corrected code. Our evaluation demonstrates that dcFix accurately detects misuse and outperforms the baseline approach, in which prompts to the LLM omit any indication of code fragments non conforming to REST API specifications.
Problem

Research questions and friction points this paper is trying to address.

Automatically repairs REST API misuse in client programs
Detects non-conforming code fragments using API specifications
Leverages Large Language Models to generate corrected code
Innovation

Methods, ideas, or system contributions that make the work stand out.

Automated program repair using Large Language Models
Detects REST API specification violations in code
Generates corrected code via API-integrated prompts
🔎 Similar Papers
No similar papers found.