arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2103.07189cs.SE
收藏

突变检测是否改善了检测实践?

Does mutation testing improve testing practices?

Goran Petrović, Marko Ivanković, Gordon Fraser, René Just

摘要:

已经定义了测试质量的各种代理度量,以便在编写测试时指导开发人员。代码覆盖率在实践中特别好地建立起来,尽管覆盖率如何与测试质量相关的问题是一个正在进行的辩论。突变测试提供了一个有希望的替代方案:人工缺陷可以识别测试套件中的漏洞,从而为额外的测试提供具体的建议。尽管突变检测有明显的优势,但在实践中还没有很好地建立起来。直到最近,突变测试工具和技术还不能扩展到复杂的系统。虽然他们现在做规模,剩下的障碍是缺乏证据表明,编写测试的突变体实际上提高测试质量。在本文中,我们的目标是填补这一空白:通过分析近1500万个突变体的大型数据集,我们研究了这些突变体如何随着时间的推移影响开发人员,以及这些突变体如何与真正的故障相关。我们的分析表明,使用突变测试的开发人员编写更多的测试,并积极改善他们的测试套件与高质量的测试,使更少的突变。通过分析一个数据集的过去修复真正的高优先级的故障,我们的分析进一步提供证据,突变体确实与真正的故障。换句话说,如果突变测试被用于引入错误的更改,它将报告一个可以防止错误的活突变体。

英文摘要:

Various proxy metrics for test quality have been defined in order to guide developers when writing tests. Code coverage is particularly well established in practice, even though the question of how coverage relates to test quality is a matter of ongoing debate. Mutation testing offers a promising alternative: Artificial defects can identify holes in a test suite, and thus provide concrete suggestions for additional tests. Despite the obvious advantages of mutation testing, it is not yet well established in practice. Until recently, mutation testing tools and techniques simply did not scale to complex systems. Although they now do scale, a remaining obstacle is lack of evidence that writing tests for mutants actually improves test quality. In this paper we aim to fill this gap: By analyzing a large dataset of almost 15 million mutants, we investigate how these mutants influenced developers over time, and how these mutants relate to real faults. Our analyses suggest that developers using mutation testing write more tests, and actively improve their test suites with high quality tests such that fewer mutants remain. By analyzing a dataset of past fixes of real high-priority faults, our analyses further provide evidence that mutants are indeed coupled with real faults. In other words, had mutation testing been used for the changes introducing the faults, it would have reported a live mutant that could have prevented the bug.

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

↑