Font Size: a A A

Research On Automatic Code Review Methods Based On Machine Learning

Posted on:2021-02-19Degree:MasterType:Thesis
Country:ChinaCandidate:S T ShiFull Text:PDF
GTID:2428330647450750Subject:Computer science and technology
Abstract/Summary:PDF Full Text Request
Code review is the process of manual inspection on the revision of the source code in order to find out whether the revised source code eventually meets the revision requirements.However,manual code review is time-consuming,and automating such the code review process will alleviate the burden of code reviewers and speed up the software maintenance process.To construct the model for automatic code review,the characteristics of the revisions of source code(i.e.,the difference between the two pieces of source code)should be properly captured and modeled.Unfortunately,most of the existing techniques can easily model the overall correlation between two pieces of source code,but not for the “difference” between two pieces of source code.To propose a model on code review,we have the following contributions:1.To automatic capture the revision feature,we propose a novel deep model named DACE.Such a model is able to learn “revision features” by contrasting the revised hunks from the original and revised source code with respect to the code context containing the hunks.Experimental results on six open source software projects indicate that DACE can outperform the competing baselines in automatic code review.2.To capture a better revision feature,we propose a novel method VACE(Variational Attention for Code revi Ew).In particular,we straightforwardly model the revision as the attention that captures how the transformation is generated and how the original statements contribute to the edit of revised statements.The attention mechanism is also used to enrich the feature representation of the revised piece of code from the unchanged context.Meanwhile,to model the uncertainty in the revision generation process,we employ the variational encoder-decoder and introduce the randomness that makes the variational attention a mixture Gaussian.And once this variational attention captures the characteristics of revisions,code review is cast as an inference task in the continuous latent space.Experimental results on six open source software projects indicate VACE can archive a better result.
Keywords/Search Tags:Code Review, Deep Learning, Autoencoder, Variational Inference
PDF Full Text Request
Related items