Application of Reinforcement Learning in Code Repair

Young Hoon Kim · International Journal of Software & Hardware Research in Engineering · 2022

Novice coders very frequently come across compile errors and learning to code without syntactical errors or debugging based on the given error messages can be a challenging task.In this study, I created a machine learning model that collects compile error messages of codes created by novice students, learns them using an LSTM recurrent neural network model, and repairs them correctly.Training data were collected from an online judge system, in which functioning codes were purposely and systematically modified to become erroneous.After the tokenization preprocessing step, I used LSTM to repair the erroneous parts of the given code.It was confirmed that the machine learning model created in this study solved 43% of the errors generated by novice programmers.Specifically, relatively simple errors including missing semicolons or unmatched brackets could be fixed with high accuracies of 78% and 73%, respectively.The results of this study highlight those errors of simple syntax are easy to fix with artificial intelligence, whereas those that depend more on context and user intention are harder to repair.

Read the paper · More papers on PaperTik