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

大规模实用突变检测

Practical Mutation Testing at Scale

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

摘要:

突变分析通过测量测试集检测系统地植入到被测程序中的小的人工错误的能力来评估测试集的充分性。突变分析被认为是最强的测试充分性标准之一。突变测试建立在突变分析之上,是一种使用突变体作为测试目标来创建或改进测试套件的测试技术。突变测试长期以来一直被认为是棘手的,因为可以创建的突变体的绝对数量代表了一个不可逾越的问题-无论是在人力还是计算方面。这阻碍了突变测试作为行业标准的采用。例如,Google拥有20亿行代码的代码库,每天执行超过5亿个测试。传统的突变测试方法无法扩展到这样的环境。为了解决这些问题,本文提出了一种基于以下主要思想的可扩展的突变测试方法:(1)突变测试是增量式的,在代码评审过程中只对更改的代码进行突变,而不是对整个代码库进行突变;(2)突变体被过滤,去除可能与开发人员无关的突变体,并限制每行代码和每个代码评审过程中的突变体数量;(3)根据突变算子的历史表现选择突变体,进一步剔除无关突变体,提高突变体质量。在一个基于代码审查的环境中,超过24,000名开发人员对1,000多个项目进行了评估,结果表明,所提出的方法产生的突变体数量级减少,基于上下文的突变体过滤和选择提高了突变体的质量和可操作性。总的来说,所提出的方法代表了一个突变测试框架,无缝集成到软件开发工作流程,适用于大规模的工业环境。

英文摘要:

Mutation analysis assesses a test suite's adequacy by measuring its ability to detect small artificial faults, systematically seeded into the tested program. Mutation analysis is considered one of the strongest test-adequacy criteria. Mutation testing builds on top of mutation analysis and is a testing technique that uses mutants as test goals to create or improve a test suite. Mutation testing has long been considered intractable because the sheer number of mutants that can be created represents an insurmountable problem -- both in terms of human and computational effort. This has hindered the adoption of mutation testing as an industry standard. For example, Google has a codebase of two billion lines of code and more than 500,000,000 tests are executed on a daily basis. The traditional approach to mutation testing does not scale to such an environment. To address these challenges, this paper presents a scalable approach to mutation testing based on the following main ideas: (1) Mutation testing is done incrementally, mutating only changed code during code review, rather than the entire code base; (2) Mutants are filtered, removing mutants that are likely to be irrelevant to developers, and limiting the number of mutants per line and per code review process; (3) Mutants are selected based on the historical performance of mutation operators, further eliminating irrelevant mutants and improving mutant quality. Evaluation in a code-review-based setting with more than 24,000 developers on more than 1,000 projects shows that the proposed approach produces orders of magnitude fewer mutants and that context-based mutant filtering and selection improve mutant quality and actionability. Overall, the proposed approach represents a mutation testing framework that seamlessly integrates into the software development workflow and is applicable up to large-scale industrial settings.

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

↑