FAPR: Fast and Accurate Program Repair for Introductory Programming Courses

07/14/2021
by   Yunlong Lu, et al.
0

In introductory programming courses, it is challenging for instructors to provide debugging feedback on students' incorrect programs. Some recent tools automatically offer program repair feedback by identifying any differences between incorrect and correct programs, but suffer from issues related to scalability, accuracy, and cross-language portability. This paper presents FAPR – our novel approach that suggests repairs based on program differences in a fast and accurate manner. FAPR is different from current tools in three aspects. First, it encodes syntactic information into token sequences to enable high-speed comparison between incorrect and correct programs. Second, to accurately extract program differences, FAPR adopts a novel matching algorithm that maximizes token-level matches and minimizes statement-level differences. Third, FAPR relies on testing instead of static/dynamic analysis to validate and refine candidate repairs, so it eliminates the language dependency or high runtime overhead incurred by complex program analysis. We implemented FAPR to suggest repairs for both C and C++ programs; our experience shows the great cross-language portability of FAPR. More importantly, we empirically compared FAPR with a state-of-the-art tool Clara. FAPR suggested repairs for over 95.5 of incorrect solutions. We sampled 250 repairs among FAPR's suggestions, and found 89.6 by suggesting repairs for more cases, creating smaller repairs, producing higher-quality fixes, and causing lower runtime overheads. Our results imply that FAPR can potentially help instructors or TAs to effectively locate bugs in incorrect code, and to provide debugging hints/guidelines based on those generated repairs.

READ FULL TEXT
research
06/17/2022

C-Pack of IPAs: A C90 Program Benchmark of Introductory Programming Assignments

Due to the vast number of students enrolled in Massive Open Online Cours...
research
05/21/2022

Improving automatically generated code from Codex via Automated Program Repair

Large language models, e.g., Codex and AlphaCode, have shown capability ...
research
07/24/2023

Graph Neural Networks For Mapping Variables Between Programs – Extended Version

Automated program analysis is a pivotal research domain in many areas of...
research
11/20/2017

Data-Driven Feedback Generation for Introductory Programming Exercises

This paper introduces the "Search, Align, and Repair" data-driven progra...
research
08/12/2017

TraceDiff: Debugging Unexpected Code Behavior Using Trace Divergences

Recent advances in program synthesis offer means to automatically debug ...
research
06/16/2023

Demystifying GPT Self-Repair for Code Generation

Large Language Models (LLMs) have shown remarkable aptitude in code gene...
research
10/03/2017

Programming Not Only by Example

In recent years, there has been tremendous progress in automated synthes...

Please sign up or login with your details

Forgot password? Click here to reset