一句话:提出 CoRA,自动将单个提交分解为独立变更部分并为评审者生成简洁描述。
代码评审是软件质量保证的重要手段,但提交中常捆绑大量相互纠缠、关联松散的代码变更,给评审者带来困难。本文提出 CoRA(Code Review Assistant),自动将一个 commit 分解为不同部分并生成简洁描述。CoRA 通过代码依赖分析与基于树的相似代码检测,将提交划分为独立部分(如缺陷修复、新增功能或重构),再基于 PageRank 算法和启发式规则识别各部分中最重要的代码变更,从而为每个部分生成简洁描述。作者在 7 个开源项目和 50 个代码提交上评估,结果显示其分解准确率较当前最佳实践提高 6.3%,重要变更识别的 MAP 达 87.7%;8 名参与者的人因研究反馈表明 CoRA 能有效帮助评审者。
Code review is an important mechanism for code quality assurance both in open source software and industrial software. Reviewers usually suffer from numerous, tangled and loosely related code changes that are bundled in a single commit, which makes code review very difficult. In this paper, we propose CoRA (Code Review Assistant), an automatic approach to decompose a commit into different parts and generate concise descriptions for reviewers. More specifically, CoRA can decompose a commit into independent parts (e.g., bug fixing, new feature adding, or refactoring) by code dependency analysis and tree-based similar-code detection, then identify the most important code changes in each part based on the PageRank algorithm and heuristic rules. As a result, CoRA can generate a concise description for each part of the commit. We evaluate our approach in seven open source software projects and 50 code commits. The results indicate that CoRA can improve the accuracy of decomposing code changes by 6.3% over the state-of-art practice. At the same time, CoRA can identify the important part from the fine-grained code changes with a mean average precision (MAP) of 87.7%. We also conduct a human study with eight participants to evaluate the performance and usefulness of CoRA, the user feedback indicates that CoRA can effectively help reviewers.
DOI 原文 ·
@inproceedings{paperbot5248,
title = {CoRA: Decomposing and Describing Tangled Code Changes for Reviewer},
author = {Min Wang and Zeqi Lin and Yanzhen Zou and Bing Xie},
booktitle = {ASE},
year = {2019},
doi = {10.1109/ase.2019.00101}
}