论文标题

通过运行时信息增加差异

Augmenting Diffs With Runtime Information

论文作者

Etemadi, Khashayar, Sharma, Aman, Madeiral, Fernanda, Monperrus, Martin

论文摘要

源代码差异每天使用作为代码审查,检查和审计的一部分。为了促进理解,它们通常伴随着描述该计划中发生变化的本质的解释。由于手动制作高质量的解释是一项麻烦的任务,研究人员提出了自动技术来生成代码差异解释。现有的解释生成方法仅关注静态分析,即,它们不利用运行时信息来解释代码更改。在本文中,我们提出了collector-sahab,这是一种新颖的工具,可以通过运行时差异信息来增强代码差异。 collector-sahab比较了程序的原始(旧)和修补版本的程序状态,以查找唯一的变量值。然后,collector-sahab将此新颖的运行时信息添加到源代码差异中,例如,在代码审核系统中所示。作为评估,我们在584代码差异上运行Collector-sahab,以供缺陷4J错误,发现它成功地扩大了95%(555/584)的代码差异。我们还进行用户研究,并要求八名参与者为Collector-Sahab生成的增强代码差异。根据本用户研究,我们得出结论,开发人员发现将运行时数据添加到代码差异有希望且有用的想法。总体而言,我们的实验表明了collector-sahab在使用运行时差异信息增强代码差异方面的有效性和实用性。公共可用的存储库:https://github.com/assert-kth/collector-sahab。

Source code diffs are used on a daily basis as part of code review, inspection, and auditing. To facilitate understanding, they are typically accompanied by explanations that describe the essence of what is changed in the program. As manually crafting high-quality explanations is a cumbersome task, researchers have proposed automatic techniques to generate code diff explanations. Existing explanation generation methods solely focus on static analysis, i.e., they do not take advantage of runtime information to explain code changes. In this paper, we propose Collector-Sahab, a novel tool that augments code diffs with runtime difference information. Collector-Sahab compares the program states of the original (old) and patched (new) versions of a program to find unique variable values. Then, Collector-Sahab adds this novel runtime information to the source code diff as shown, for instance, in code reviewing systems. As an evaluation, we run Collector-Sahab on 584 code diffs for Defects4J bugs and find it successfully augments the code diff for 95% (555/584) of them. We also perform a user study and ask eight participants to score the augmented code diffs generated by Collector-Sahab. Per this user study, we conclude that developers find the idea of adding runtime data to code diffs promising and useful. Overall, our experiments show the effectiveness and usefulness of Collector-Sahab in augmenting code diffs with runtime difference information. Publicly-available repository: https://github.com/ASSERT-KTH/collector-sahab.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源