Diff-based mutation testing is a mutation testing approach that only mutates lines affected by a code change under review. Google's mutation testing service integrates diff-based mutation testing into the code review process and continuously gathers developer feedback on mutants surfaced during code review. To enhance the developer experience, the mutation testing service implements a number of suppression rules, which target not-useful mutants-that is, mutants that have consistently received negative developer feedback. However, while effective, manually implementing suppression rules require significant engineering time. An automatic system to rank and suppress mutants would facilitate the maintenance of the mutation testing service. This paper proposes and evaluates MuRS, an automated approach that groups mutants by patterns in the source code under test and uses these patterns to rank and suppress future mutants based on historical developer feedback on mutants in the same group. To evaluate MuRS, we conducted an A/B testing study, comparing MuRS to the existing mutation testing service. Despite the strong baseline, which uses manually developed suppression rules, the results show a statistically significantly lower negative feedback ratio of 11.45% for MuRS versus 12.41% for the baseline. The results also show that MuRS is able to recover existing suppression rules implemented in the baseline. Finally, the results show that statement-deletion mutant groups received both the most positive and negative developer feedback, suggesting a need for additional context that can distinguish between useful and not-useful mutants in these groups. Overall, MuRS has the potential to substantially reduce the development and maintenance cost for an effective mutation testing service by automatically learning suppression rules.
翻译:基于差异的变异测试是一种仅对代码审查中变更所影响的行进行变异的测试方法。谷歌的变异测试服务将基于差异的变异测试集成到代码审查流程中,并持续收集开发人员对审查期间出现的变异体的反馈。为提升开发体验,该服务实施了一系列抑制规则,旨在剔除无用的变异体——即持续收到负面反馈的变异体。然而,尽管效果显著,手动实现抑制规则需要大量工程时间。一个能够自动对变异体进行排序和抑制的系统将有助于维护该变异测试服务。本文提出并评估了MuRS这一自动化方法,该方法根据被测试源代码中的模式对变异体进行分组,并利用这些模式基于同一分组内变异体的历史开发者反馈,对未来的变异体进行排序和抑制。为评估MuRS,我们进行了A/B测试研究,将MuRS与现有变异测试服务进行对比。尽管基线方法采用了手动开发的抑制规则,但结果显示,MuRS的负面反馈率(11.45%)在统计上显著低于基线方法的12.41%。结果还表明,MuRS能够复现基线中已有的抑制规则。此外,语句删除变异体分组同时获得了最多正面和负面开发人员反馈,这表明需要额外的上下文来区分这些分组中有用和无用的变异体。总体而言,MuRS通过自动学习抑制规则,有望大幅降低构建有效变异测试服务的开发与维护成本。