Research on Defect Location Method of C Language Code Based on Deep Learning
Yaling Zhang, Jie Zhou, Jing Hu · 2021
As a representative of structured programming language, C language has been identified as a required course of various science and engineering majors in many universities. In order to improve the programming ability of learners, the online judge system (OJ) or the experimental support system has become an urgent teaching support platform. The function of this kind of teaching platform is to automatically evaluate the program codes submitted by students through black box testing, and give the evaluation results to promote the practical teaching effect of the course. However, most of the current platforms can only provide the evaluation results, but cannot locate the code defects to help learners find the problems in the code as soon as possible. A new defect location method for C language code based on deep learning is proposed in the paper. This method is different from the previous code defect location methods that use defect reports or use defect code to form a training library. The method of this paper is based on a large number of correct codes existing in the OJ system to form a detection template, and locate the defect code by finding the template code that is the most similar to the submitted code. The method is verified by constructing two data sets and corresponding test sets. Finally, it is proved that the method of this paper has a better effect on defect location.