Write a Blog >>
ASE 2020
Mon 21 - Fri 25 September 2020 Melbourne, Australia
Wed 23 Sep 2020 09:50 - 10:10 at Wombat - AI for Software Engineering (3) Chair(s): Artur Andrzejak

Code comments are valuable for program comprehension and software maintenance, and also require maintenance with code evolution. However, when changing code, developers sometimes neglect updating the related comments, bringing in inconsistent or obsolete comments (aka., bad comments). Such comments are detrimental since they may mislead developers and lead to future bugs. Therefore, it is necessary to fix and avoid bad comments. In this work, we argue that bad comments can be reduced and even avoided by automatically performing comment updates with code changes. We refer to this task as “Just-In-Time (JIT) Comment Updating” and propose an approach named CUP (Comment UPdater) to automate this task. CUP can be used to assist developers in updating comments during code changes and can consequently help avoid the introduction of bad comments. Specifically, CUP leverages a novel neural sequence-to-sequence model to learn comment update patterns from extant code-comment co-changes and can automatically generate a new comment based on its corresponding old comment and code change. Several customized enhancements, such as a special tokenizer and a novel co-attention mechanism, are introduced in CUP by us to handle the characteristics of this task. We build a dataset with over 108K comment-code co-change samples and evaluate CUP on it. The evaluation results show that CUP outperforms an information-retrieval-based and a rule-based baselines by substantial margins, and can reduce developers’ edits required for JIT comment updating. In addition, the comments generated by our approach are identical to those updated by developers in 1612 (16.7%) test samples, 7 times more than the best-performing baseline.

Wed 23 Sep
Times are displayed in time zone: (UTC) Coordinated Universal Time change

ase-2020-papers
09:10 - 10:10: Research Papers - AI for Software Engineering (3) at Wombat
Chair(s): Artur AndrzejakHeidelberg University
ase-2020-papers09:10 - 09:30
Talk
Julian FrattiniBlekinge Institute of Technology, Maximilian JunkerTechnische Universität Muenchen, Michael UnterkalmsteinerBlekinge Institute of Technology, Daniel MendezBlekinge Institute of Technology
ase-2020-papers09:30 - 09:50
Talk
Ke LiUniversity of Exeter, Zilin XiangUniversity of Electronic Science and Technology of China, Tao ChenLoughborough University, Kay Chen TanCity University of Hong Kong
Pre-print
ase-2020-papers09:50 - 10:10
Talk
Zhongxin LiuZhejiang University, Xin XiaMonash University, Meng YanChongqing University, Shanping LiZhejiang University
Pre-print