Code reviews are popular in both industrial and open source projects. The benefits of code reviews are widely recognized and include better code quality and lower likelihood of introducing bugs. However, since code review is a manual activity it comes at the cost of spending developers' time on reviewing their teammates' code. Our goal is to make the first step towards partially automating the code review process, thus, possibly reducing the manual costs associated with it. We focus on both the contributor and the reviewer sides of the process, by training two different Deep Learning architectures. The first one learns code changes performed by developers during real code review activities, thus providing the contributor with a revised version of her code implementing code transformations usually recommended during code review before the code is even submitted for review. The second one automatically provides the reviewer commenting on a submitted code with the revised code implementing her comments expressed in natural language. The empirical evaluation of the two models shows that, on the contributor side, the trained model succeeds in replicating the code transformations applied during code reviews in up to 16% of cases. On the reviewer side, the model can correctly implement a comment provided in natural language in up to 31% of cases. While these results are encouraging, more research is needed to make these models usable by developers.
翻译:守则审查的好处在工业和开放源码项目中都很受欢迎。 守则审查的好处在工业和开放源码项目中都得到广泛承认, 包括更好的守则质量和降低引入错误的可能性。 但是, 守则审查是一项人工活动, 其成本是开发者花时间审查队友守则。 我们的目标是采取第一步, 使守则审查过程部分自动化, 从而降低与守则有关的手册费用。 我们通过培训两个不同的深层学习架构, 以这一过程的提供者和审查者为重点。 第一次是学习开发者在实际代码审查活动期间进行的守则修改, 从而向提供其守则的提供者提供订正版, 实施通常在守则审查期间建议的守则变换的守则。 第二个是自动向审查者提供关于已提交的守则的评论, 订正的守则以自然语言执行她的评论, 从而降低与守则有关的手册有关的手册费用。 对两种模式的经验评价表明, 在贡献者方面,经过训练的模型成功地复制了在实际代码审查过程中应用的守则变换码, 高达16% 。 在审查者方面, 模型可以正确执行自然语言中提供的评论, 。 这些研究的结果需要到31 % 这些案例。 。