Compilation Error Repair: For the Student Programs, From the Student Programs

  • Umair Ahmed ,
  • Pawan Kumar ,
  • Amey Karkare ,
  • Purushottam Kar ,

40th International Conference on Software Engineering (ICSE), Software Engineering Education and Training Track |

Publication

Compile-time errors pose a major learning hurdle for students of introductory programming courses. Compiler error messages, while accurate, are targeted at seasoned programmers and seem cryptic and distracting to beginners. The problem of pedagogically-inspired program repair that can provide more helpful feedback on erroneous programs has generated a lot of interest in recent years. In this work, we report TRACER (Targeted RepAir of Compilation ERrors), an end-to-end system for performing repairs on compilation errors, aimed at introductory programmers.

TRACER invokes a novel combination of tools from programming language theory and deep learning, and offers far more relevant repairs than existing works. TRACER distinguishes itself in generating repairs that not only enable successful compilation of erroneous programs, but those that are very close to repairs actually performed by students on similar errors. This is in sharp contrast to the relatively meek evaluation criteria used by existing works, such as compilation success rates. These targeted corrections are much more useful in pedagogical situations than code that merely compiles. TRACER learns repairs from erroneous student programs themselves and requires minimal expert intervention. It scales well and can be used to offer real-time feedback to students during a programming lab or tutorial session.

We report experimental results of TRACER on 4500 erroneous C programs written by students in a freshman year programming course. In 68% of these, TRACER recommends a repair that exactly matches the repair expected by the student. In 79.27% of these programs, TRACER produces a compilable repair. On a further set of 3200 programs that require errors to be fixed on multiple lines, TRACER enjoys a success rate of 44% compared to the 27% success rate offered by the state-of-the-art technique DeepFix.