Font Size: a A A

Research On Code Recommendation For Code Repair

Posted on:2019-08-31Degree:MasterType:Thesis
Country:ChinaCandidate:Y Y WangFull Text:PDF
GTID:2428330590492469Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Bug repair is complex and usually time-consuming.Existing studies have shown that software companies have to spend significant costs on fixing bugs annually.Meanwhile,with the expansion of the open-source movement,vast source code has been reused and reimplemented.With high probability,a piece of defective code has been reimplemented correctly with slightly modifications in other software projects.Therefore,for a given buggy code,if its correct and similar versions can be found in other software,through comparing the differences between them,programmers might be able to understand the bug and design the repair quickly.Based on this idea,after learning technology of both static code analysis and automated bug repair,this paper has studied the application of similar code on bug repair.And a Java similar code recommendation technique,CRSearcher is proposed for simple bug repair.With static code analysis result of defective code,Abstract Syntax Tree analysis and RKR-GST algorithm,CRSearcher searches an mature open-source codebase for similar code,and provides programmers with code snippets that helps them repair bugs.It aims at improving the efficiency of bug repair though making it easier.At last,in order to verify the effectiveness of CRSearcher,this paper builds a code database that consists of approximately 930,000 lines of code from eight open-source projects for CRSearcher,and evaluated it with fifty bug snippets from Defects4 j,a famous Java bug repository.The experiment result shows that CRSearcher is able to provide helpful similar code for repairing some simple bugs.And CRSearcher's accuracy at top one,top three and top five is 0.26,0.46 and 0.50 respectively,the mean average precision at top one,top three and top five is 0.26,0.31,0.34.
Keywords/Search Tags:bugs repair, code recommendation, similar code
PDF Full Text Request
Related items