NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Feedback generation for performance problems in introductory programming assignments

Florian Zuleger, Ivan Radicek, Sumit GulwaniSoftware Engineering 2016

TL;DR

This paper tackles the challenge of providing automated performance feedback for introductory programming assignments. They introduce a novel "observe" language construct and a dynamic analysis approach to identify algorithmic strategies in student code, enabling targeted feedback that goes beyond mere functional correctness.

What Problem Does This Paper Address?

Manually providing feedback on programming assignments is a time-consuming and error-prone task for instructors. This problem is exacerbated by the rise of Massive Open Online Courses (MOOCs) with a large number of students. While existing tools can help students achieve functional correctness, they often fall short in addressing performance issues. The authors observed that a significant portion of functionally correct student submissions exhibit performance problems due to different algorithmic strategies or inefficient implementations of the same strategy. This gap leaves students without guidance on how to optimize their code, hindering their learning of crucial performance concepts.

Methods

The core of the paper's contribution lies in a novel approach to specifying and matching algorithmic strategies.

  • Specification Language (observe construct): Teachers can define an algorithmic strategy by annotating a sample implementation with an observe statement. This statement captures "key values" that are expected to occur during the execution of a program employing that specific strategy. The language also supports non-deterministic choices to account for variations in implementation details.
  • Dynamic Analysis for Matching: A dynamic analysis technique is employed to determine if a student's implementation matches a teacher's specification. This involves executing both the specification and the student's implementation on common inputs and comparing their execution traces. The matching criterion is based on "trace embedding," where the specification's trace must be a subsequence of the implementation's trace, with corresponding observed values matching.
  • Partial vs. Full Matching: The framework supports two types of matching: "partial matching" for identifying inefficient strategies and "full matching" for ensuring an implementation adheres to efficient algorithmic practices, including loop and library function call considerations.

Datasets

The authors evaluated their framework on two sets of programming problems:

  • Pre-existing MOOC benchmark: 3 programming problems from the PEX4FUN platform, with 2316 functionally correct student implementations.
  • Newly created benchmark: 21 programming problems hosted on PEX4FUN, used as homework for a second-year undergraduate course, with 732 functionally correct student implementations.

Key Insights and Ideas

  • Algorithmic Strategies Merit Different Feedback: The paper strongly emphasizes that different high-level algorithmic approaches to solving a problem, even if functionally correct, require distinct performance feedback. This moves beyond simply identifying "slow" code to understanding why it's slow.
  • Abstraction from Implementation Details: The observe construct is crucial for allowing teachers to specify strategies without getting bogged down in minor implementation variations (e.g., using different library functions for the same task). This makes specifications more robust and reusable.
  • Dynamic Analysis as a Bridge: Trace embedding provides a powerful mechanism to connect abstract strategy specifications with concrete program executions, bridging the gap between what a teacher intends and what a student implements.
  • Teacher Effort is Significantly Reduced: The experimental results highlight that the proposed semi-automatic approach drastically reduces the manual effort required from teachers to identify and provide feedback on performance issues.

Key Results

  • Efficiency of Specification: For a benchmark of 2316 implementations, teachers were able to specify 16 strategies in just 95 minutes, after inspecting only about 3% of the implementations.
  • Precision and Expressiveness: The specification language and dynamic analysis were found to be precise and expressive enough to capture all 82 identified strategies across their experiments.
  • Performance of the Tool: The matching process for a single implementation typically takes less than half a second, making it suitable for interactive teaching environments.
  • Prevalence of Performance Issues: A significant majority (around 60%) of functionally correct student solutions exhibited performance problems, underscoring the need for such a tool.

Limitations and Future Work

  • Unsoundness of Dynamic Analysis: The authors acknowledge that their method is technically unsound because it relies on dynamic analysis with a limited set of inputs. While they observed no unsoundness in their experiments, they suggest that an embedding witness could be used for formal verification.
  • Applicability to Larger Programs: The current framework has been evaluated on introductory programming assignments. Its applicability to larger, more complex software systems is not explicitly discussed.
  • Teacher Effort for Specification: While significantly reduced, writing specifications still requires teacher effort. The authors suggest that this could be a one-time investment, potentially handled by experienced personnel.
  • Future Work: The authors plan to integrate their framework into a MOOC platform to provide performance feedback in a large-scale educational setting. They also mention the possibility of extending the framework to handle more complex scenarios and potentially provide more automated repair suggestions.

Summary updated

BibTeX
@inproceedings{zuleger2016feedback,
  author = {Florian Zuleger and Ivan Radicek and Sumit Gulwani},
  title = {{Feedback generation for performance problems in introductory programming assignments}},
  booktitle = {Software Engineering},
  year = {2016},
}
Figure