arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2010.13464cs.SE
收藏

在工业中使用突变测试需要什么--Facebook的一项研究

What It Would Take to Use Mutation Testing in Industry--A Study at Facebook

Moritz Beller, Chu-Pan Wong, Johannes Bader, Andrew Scott, Mateusz Machalica, Satish Chandra, Erik Meijer

摘要:

传统上,突变测试会产生大量的程序小偏差,称为突变体。在Facebook这样规模的工业系统中,这样做是不可行的。我们不应该创建测试套件可能会失败的突变体,或者不给开发人员可操作的信号。为了解决这个问题,在本文中,我们半自动地从常见的Java编码错误语料库中学习错误诱导模式,并从导致Facebook操作异常的变化中学习。我们将突变与测量哪些测试恰好访问了突变的代码片段的检测相结合。超过15,000个生成的突变体的结果显示,超过一半的生成的突变体通过了Facebook严格的单元测试,集成测试和系统测试。此外,在一个有26名开发人员的案例研究中,除了两名开发人员之外,所有人都发现了自动检测到的测试漏洞的信息。因此,26人中几乎有一半会通过调整现有测试或创建新测试来对呈现给他们的突变体采取行动。其他人没有因为各种各样的原因,通常超出了突变测试的范围。如何将这些外部信息纳入突变体研究,以提高突变体的真实可操作性,这仍然是一个实际的挑战。

英文摘要:

Traditionally, mutation testing generates an abundance of small deviations of a program, called mutants. At industrial systems the scale and size of Facebook's, doing this is infeasible. We should not create mutants that the test suite would likely fail on or that give no actionable signal to developers. To tackle this problem, in this paper, we semi-automatically learn error-inducing patterns from a corpus of common Java coding errors and from changes that caused operational anomalies at Facebook specifically. We combine the mutations with instrumentation that measures which tests exactly visited the mutated piece of code. Results on more than 15,000 generated mutants show that more than half of the generated mutants survive Facebook's rigorous test suite of unit, integration, and system tests. Moreover, in a case study with 26 developers, all but two found information of automatically detected test holes interesting in principle. As such, almost half of the 26 would actually act on the mutant presented to them by adapting an existing or creating a new test. The others did not for a variety of reasons often outside the scope of mutation testing. It remains a practical challenge how we can include such external information to increase the true actionability rate on mutants.

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

↑