ErrorCLR: Semantic Error Classification, Localization and Repair for Introductory Programming Assignments
Open Access
- 18 July 2023
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 1345-1354
Abstract
Programming education at scale increasingly relies on automated feedback to help students learn to program. An important form of feedback is to point out semantic errors in student programs and provide hints for program repair. Such automated feedback depends essentially on solving the tasks of classification, localization and repair of semantic errors. Although there are datasets for the tasks, we observe that they do not have the annotations supporting all three tasks. As such, existing approaches for semantic error feedback treat error classification, localization and repair as independent tasks, resulting in sub-optimal performance on each task. Moreover, existing datasets either contain few programming assignments or have few programs for each assignment. Therefore, existing approaches often leverage rule-based methods and evaluate them with a small number of programming assignments. To tackle the problems, we first describe the creation of a new dataset COJ2022 that contains 5,914 C programs with semantic errors submitted to 498 different assignments in an introductory programming course, where each program is annotated with the error types and locations and is coupled with the repaired program submitted by the same student. We show the advantages of COJ2022 over existing datasets on various aspects. Second, we treat semantic error classification, localization and repair as dependent tasks, and propose a novel two-stage method ErrorCLR to solve them. Specifically, in the first stage we train a model based on graph matching networks to jointly classify and localize potential semantic errors in student programs, and in the second stage we mask error spans in buggy programs using information of error types and locations and train a CodeT5 model to predict correct spans. The predicted spans replace the error spans to form repaired programs. Experimental results show that ErrorCLR remarkably outperforms the comparative methods for all three tasks on COJ2022 and other public datasets. We also conduct a case study to visualize and interpret what is learned by the graph matching network in ErrorCLR. We have released the source code and COJ2022 at https://github.com/DaSESmartEdu/ErrorCLR.Keywords
Funding Information
- National Natural Science Foundation of China (62137001)
- National Natural Science Foundation of China (62277017)
This publication has 19 references indexed in Scilit:
- Deep Reinforcement Learning for Syntactic Error Repair in Student ProgramsProceedings of the AAAI Conference on Artificial Intelligence, 2019
- A Novel Neural Source Code Representation Based on Abstract Syntax Tree2019
- code2vec: learning distributed representations of codeProceedings of the ACM on Programming Languages, 2019
- Search, align, and repair: data-driven feedback generation for introductory programming exercises2018
- Automated clustering and program repair for introductory programming assignments2018
- Neuro-symbolic program corrector for introductory programming assignments2018
- CodeWorkout2017
- BovInspector: automatic inspection and repair of buffer overflow vulnerabilities2016
- The ManyBugs and IntroClass Benchmarks for Automated Repair of C ProgramsIEEE Transactions on Software Engineering, 2015
- An Evaluation of Similarity Coefficients for Software Fault Localization2006