Font Size: a A A

Research On Automatic Correction Of C/C++ Introductory Programming Assignments

Posted on:2020-12-24Degree:MasterType:Thesis
Country:ChinaCandidate:F S ZhouFull Text:PDF
GTID:2428330578963112Subject:Computer technology
Abstract/Summary:PDF Full Text Request
C/C++-is the main implementation language of system software and the core course of computer education in universities.In order to ensure the quality of teaching,home-work procedural correction is an important link.However,with the increase of the number of assignments and students,manual correction becomes more and more diffi-cult.Especially in the emerging MOOC platform,there are a large number of students to choose courses,and the traditional way of correcting is difficult to deal with.At present,the method of test case feedback and peer feedback adopted by MOOC plat-form has solved the problem of homework correction to a certain extent,but it still faces the problems of insufficient feedback content and too long feedback time,which seriously reduces the teaching effect.Aiming at the above problems,this paper presents a method of automatic correct-ing operation program.This method uses error mode and program spectrum to assist defect location.On this basis,the code generation technology based on deep learning and the repair verification method based on program synthesis technology are used to achieve automatic correction.The main work of this paper includes:1.A defect location method based on defect mode and program spectrum is proposed.The program analysis of the defect program is carried out to obtain the abstract syntax tree of the defect program.Based on this,the defect pattern and the pro-gram spectrum assisted defect location are integrated to obtain the potential defect location in the defect program.2.A method for generating repair options based on deep learning is proposed.The long and short-term neural network is used to learn the sentence structure in the correct program,and the structural model is formed through training.In the po-tential defect location of the error program,the trained structure model is used to predict the statement structure of the defect location,and the structure is extended to obtain all feasible repair candidates.3.A defect repair selection and verification method based on program synthesis is proposed.The repair candidate replaces the defect statement in the form of a se-lection expression,and uses the sample program as a specification,using program synthesis techniques,to pick the appropriate repair options for each selection ex-pression to satisfy the specification.Finally,replace the resulting repair option with the corresponding defect statement to generate the correct program after the repair.4.Based on the above method,a prototype tool for automatic correction of operation programs is implemented in this paper.The tool integrates the deep learning tool TensorFlow and the program synthesis tool SKETCH,and implements the conver-sion of C/C++ programs to SKETCH programs.We experimented on 32 small-scale programs and successfully repaired 25 small programs,correctly predicting 21 statement structures for 30 defect locations.The experimental results show that the structural model prediction has higher accuracy and the tool has a good effect on the correction of operation programs.
Keywords/Search Tags:Program Repair, Program Synthesis, Error mode, Program Spectrum, Program serialization
PDF Full Text Request
Related items