DeepAI AI Chat
Log In Sign Up

Providing Real-time Assistance for Repairing Runtime Exceptions using Stack Overflow Posts

02/09/2022
by   Sonal Mahajan, et al.
0

Runtime Exceptions (REs) are an important class of bugs that occur frequently during code development. Traditional Automatic Program Repair (APR) tools are of limited use in this "in-development" use case, since they require a test-suite to be available as a patching oracle. Thus, developers typically tend to manually resolve their in-development REs, often by referring to technical forums, such as Stack Overflow (SO). To automate this manual process we extend our previous work, MAESTRO, to provide real-time assistance to developers for repairing Java REs by recommending a relevant patch-suggesting SO post and synthesizing a repair patch from this post to fix the RE in the developer's code. MAESTRO exploits a library of Runtime Exception Patterns (REPs) semi-automatically mined from SO posts, through a relatively inexpensive, one-time, incremental process. An REP is an abstracted sequence of statements that triggers a given RE. REPs are used to index SO posts, retrieve a post most relevant to the RE instance exhibited by a developer's code and then mediate the process of extracting a concrete repair from the SO post, abstracting out post-specific details, and concretizing the repair to the developer's buggy code. We evaluate MAESTRO on a published RE benchmark comprised of 78 instances. MAESTRO is able to generate a correct repair patch at the top position in 27 and overall return a useful artifact in 81 REPs proves instrumental to all aspects of MAESTRO's performance, from ranking and searching of SO posts to synthesizing patches from a given post. In particular, 45 by a baseline technique not using REPs, even when provided with MAESTRO's SO-post ranking. MAESTRO is also fast, needing around 1 second, on average, to generate its output.

READ FULL TEXT
09/21/2020

Recommending Stack Overflow Posts for Fixing Runtime Exceptions using Failure Scenario Matching

Using online Q A forums, such as Stack Overflow (SO), for guidance to ...
10/11/2019

Repairnator patches programs automatically

Repairnator is a bot. It constantly monitors software bugs discovered du...
08/23/2021

Q A MAESTRO: Q A Post Recommendation for Fixing Java Runtime Exceptions

Programmers often use Q A sites (e.g., Stack Overflow) to understand a...
11/10/2018

Nopol: Automatic Repair of Conditional Statement Bugs in Java Programs

We propose NOPOL, an approach to automatic repair of buggy conditional s...
11/04/2018

Automatic Repair of Real Bugs in Java: A Large-Scale Experiment on the Defects4J Dataset

Defects4J is a large, peer-reviewed, structured dataset of real-world Ja...
03/31/2021

Exploring Plausible Patches Using Source Code Embeddings in JavaScript

Despite the immense popularity of the Automated Program Repair (APR) fie...
03/20/2018

SOTorrent: Reconstructing and Analyzing the Evolution of Stack Overflow Posts

Stack Overflow (SO) is the most popular question-and-answer website for ...