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

09/21/2020
by   Sonal Mahajan, et al.
0

Using online Q A forums, such as Stack Overflow (SO), for guidance to resolve program bugs, among other development issues, is commonplace in modern software development practice. Runtime exceptions (RE) is one such important class of bugs that is actively discussed on SO. In this work we present a technique and prototype tool called MAESTRO that can automatically recommend an SO post that is most relevant to a given Java RE in a developer's code. MAESTRO compares the exception-generating program scenario in the developer's code with that discussed in an SO post and returns the post with the closest match. To extract and compare the exception scenario effectively, MAESTRO first uses the answer code snippets in a post to implicate a subset of lines in the post's question code snippet as responsible for the exception and then compares these lines with the developer's code in terms of their respective Abstract Program Graph (APG) representations. The APG is a simplified and abstracted derivative of an abstract syntax tree, proposed in this work, that allows an effective comparison of the functionality embodied in the high-level program structure, while discarding many of the low-level syntactic or semantic differences. We evaluate MAESTRO on a benchmark of 78 instances of Java REs extracted from the top 500 Java projects on GitHub and show that MAESTRO can return either a highly relevant or somewhat relevant SO post corresponding to the exception instance in 71 44 We also conduct a user experience study of MAESTRO with 10 Java developers, where the participants judge MAESTRO reporting a highly relevant or somewhat relevant post in 80 even better than the one manually found by the participant.

READ FULL TEXT
research
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...
research
02/09/2022

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

Runtime Exceptions (REs) are an important class of bugs that occur frequ...
research
10/11/2021

User-driven Design and Evaluation of Liquid Types in Java

Bugs that are detected earlier during the development lifecycle are easi...
research
10/28/2022

I Know What You Are Searching For: Code Snippet Recommendation from Stack Overflow Posts

Stack Overflow has been heavily used by software developers to seek prog...
research
06/06/2023

Large Language Models of Code Fail at Completing Code with Potential Bugs

Large language models of code (Code-LLMs) have recently brought tremendo...
research
07/17/2019

Syntax and Stack Overflow: A methodology for extracting a corpus of syntax errors and fixes

One problem when studying how to find and fix syntax errors is how to ge...
research
02/26/2021

EvoSpex: An Evolutionary Algorithm for Learning Postconditions

Software reliability is a primary concern in the construction of softwar...

Please sign up or login with your details

Forgot password? Click here to reset