arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2103.11453cs.SE
收藏

RAID:重构感知代码评审的工具支持

RAID: Tool Support for Refactoring-Aware Code Reviews

Rodrigo Brito, Marco Tulio Valente

摘要:

代码评审是一种关键的开发实践,有助于提高软件质量和促进开发人员之间的知识共享。然而,代码审查通常需要时间,并且需要对文本差异进行详细而耗时的分析。特别是,在代码审查期间检测重构不是一个简单的任务,因为它们没有显式地表示在差异中。例如,移动函数重构由删除的(-)和添加的(+)行代码表示,这些代码可以位于不同的源代码文件中。为了解决这个问题,我们引入了RAID,一个重构感知和智能比较工具。除了提出RAID架构外,我们还实现了一个支持我们解决方案的Chrome浏览器插件。然后,我们进行了现场实验,8名专业开发人员谁使用RAID三个月。我们的结论是,RAID可以减少检测和审查文本差异中的重构所需的认知努力。除了在差异中记录重构之外,RAID还减少了检查这些操作所需的行数。例如,在移动重构的情况下,要查看的行的中位数从14.5减少到2行,在提取的情况下,从113减少到55行。

英文摘要:

Code review is a key development practice that contributes to improve software quality and to foster knowledge sharing among developers. However, code review usually takes time and demands detailed and time-consuming analysis of textual diffs. Particularly, detecting refactorings during code reviews is not a trivial task, since they are not explicitly represented in diffs. For example, a Move Function refactoring is represented by deleted (-) and added lines (+) of code which can be located in different and distant source code files. To tackle this problem, we introduce RAID, a refactoring-aware and intelligent diff tool. Besides proposing an architecture for RAID, we implemented a Chrome browser plug-in that supports our solution. Then, we conducted a field experiment with eight professional developers who used RAID for three months. We concluded that RAID can reduce the cognitive effort required for detecting and reviewing refactorings in textual diff. Besides documenting refactorings in diffs, RAID reduces the number of lines required for reviewing such operations. For example, the median number of lines to be reviewed decreases from 14.5 to 2 lines in the case of move refactorings and from 113 to 55 lines in the case of extractions.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑