Skip to main content
QUICK REVIEW

[Paper Review] Deep Learning for Bug-Localization in Student Programs

Rahul Gupta, Aditya Kanade|arXiv (Cornell University)|May 28, 2019
Software Testing and Debugging TechniquesComputer Science27 references4 citations
TL;DR

This paper presents a novel deep learning approach for semantic bug localization in student programs using a tree convolutional neural network to predict test outcomes and a neural attribution technique to identify buggy code lines. The method outperforms state-of-the-art dynamic and static baselines in localizing bugs without requiring program execution or heuristics, and is programming language agnostic.

ABSTRACT

Providing feedback is an integral part of teaching. Most open online courses on programming make use of automated grading systems to support programming assignments and give real-time feedback. These systems usually rely on test results to quantify the programs' functional correctness. They return failing tests to the students as feedback. However, students may find it difficult to debug their programs if they receive no hints about where the bug is and how to fix it. In this work, we present the first deep learning based technique that can localize bugs in a faulty program w.r.t. a failing test, without even running the program. At the heart of our technique is a novel tree convolutional neural network which is trained to predict whether a program passes or fails a given test. To localize the bugs, we analyze the trained network using a state-of-the-art neural prediction attribution technique and see which lines of the programs make it predict the test outcomes. Our experiments show that the proposed technique is generally more accurate than two state-of-the-art program-spectrum based and one syntactic difference based bug-localization baselines.

Motivation & Objective

  • To address the challenge of providing actionable feedback in large-scale online programming courses where automated grading only reports failing tests.
  • To enable automated localization of buggy code lines in student programs without executing the code or relying on reference implementations.
  • To develop a programming language-agnostic technique that avoids heuristic-based static analysis or dynamic spectrum analysis.
  • To improve feedback quality by identifying suspicious code lines with high precision, aiding both students and instructors.

Proposed method

  • Train a novel tree convolutional neural network (Tree-CNN) on program-ASTs and test IDs to predict whether a program passes or fails a given test.
  • Use a state-of-the-art neural prediction attribution technique to trace the network's prediction back to specific lines in the source code.
  • Apply K-means clustering on program embeddings to reduce search cost during baseline comparison, improving efficiency without sacrificing accuracy.
  • Leverage program embeddings derived from ASTs to enable language-agnostic analysis, avoiding syntax- or structure-specific heuristics.
  • Compare the attribution scores of buggy programs against a set of correct programs from the same cluster to rank suspicious lines.
  • Use a discriminative model for bug localization, avoiding the need for explicit bug annotations during training.

Experimental results

Research questions

  • RQ1Can a deep learning model trained on program-AST and test ID pairs accurately predict functional correctness without executing the program?
  • RQ2Can neural attribution techniques effectively localize semantic bugs by identifying the most suspicious code lines in a faulty program?
  • RQ3How does the proposed method compare in accuracy to existing spectrum-based and syntactic difference-based bug-localization techniques?
  • RQ4To what extent does clustering program embeddings improve efficiency without degrading localization accuracy?
  • RQ5Can the proposed technique be generalized across different programming languages without language-specific tuning?

Key findings

  • The proposed deep learning-based bug-localization technique outperforms two state-of-the-art dynamic spectrum-based methods and one static syntactic difference-based method in most evaluation metrics.
  • The use of K-means clustering on program embeddings reduced the baseline search cost by a factor of 5 with less than 0.5% drop in accuracy across all metrics.
  • The model achieved high precision in identifying buggy lines, with top-5 suspicious lines correctly including the actual bugs in the example case (lines 9 and 10).
  • The technique is programming language agnostic, as it relies on AST-based embeddings and does not depend on syntactic or structural heuristics.
  • The method does not require any manual annotations, reference implementations, or program execution during training, making it scalable for large-scale online courses.
  • The neural attribution mechanism successfully localized semantic bugs by highlighting lines that contributed most to the failure prediction, even without access to execution traces.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.