D-ACT: Towards Diff-Aware Code Transformation for Code Review Under a Time-Wise Evaluation

被引:7
|
作者
Pornprasit, Chanathip [1 ]
Tantithamthavorn, Chakkrit [1 ]
Thongtanunam, Patanamon [2 ]
Chen, Chunyang [1 ]
机构
[1] Monash Univ, Clayton, Vic, Australia
[2] Univ Melbourne, Melbourne, Vic, Australia
基金
澳大利亚研究理事会;
关键词
Modern Code Review; Deep Learning; Neural Machine Translation;
D O I
10.1109/SANER56733.2023.00036
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code review is a software quality assurance practice, yet remains time-consuming (e g., due to slow feedback from reviewers). Recent Neural Machine Translation (NMT)-based code transformation approaches were proposed to automatically generate an approved version of changed methods for a given submitted patch. The existing approaches could change code tokens in any area in a changed method. However, not all code tokens need to be changed. Intuitively, the changed code tokens in the method should be paid more attention to than the others as they are more prone to be defective. In this paper, we present an NMT-based Diff-Aware Code Transformation approach (D-ACT) by leveraging token-level change information to enable the NMT models to better focus on the changed tokens in a changed method. We evaluate our D-ACT and the baseline approaches based on a time-wise evaluation (that is ignored by the existing work) with 5,758 changed methods. Under the time-wise evaluation scenario, our results show that (1) D-ACT can correctly transform 107 - 245 changed methods, which is at least 62% higher than the existing approaches; (2) the performance of the existing approaches drops by 57% to 94% when the time-wise evaluation is ignored; and (3) D-ACT is improved by 17% - 82% with an average of 29% when considering the token-level change information. Our results suggest that (1) NMT-based code transformation approaches for code review should be evaluated under the time-wise evaluation; and (2) the token-level change information can substantially improve the performance of NMT-based code transformation approaches for code review.
引用
收藏
页码:296 / 307
页数:12
相关论文
empty
未找到相关数据