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

Cerebro:静态包容突变体选择

Cerebro: Static Subsuming Mutant Selection

Aayush Garg, Milos Ojdanic, Renzo Degiovanni, Thierry Titcheu Chekam, Mike Papadakis, Yves Le Traon

摘要:

突变测试研究表明,其应用成本的主要部分是由于它引入了大量的低效用突变体。虽然以前的研究已经发现了这个问题,但没有以前的研究提出任何有效的解决方案。因此,仍然不清楚如何以最佳努力的方式改变和测试给定的代码片段,即,在投入的努力和测试有效性之间实现良好的权衡。为了实现这一点,我们提出了Cerebro,一种静态选择包含突变体的机器学习方法,即,基于突变体周围的代码上下文,位于包容层次结构顶部的突变体集合。我们分别使用48个和10个用C和Java编写的程序对Cerebro进行了评估,并证明它保留了突变测试的优势,同时限制了应用成本,即,降低了所有的成本应用因素,例如等效突变体、突变体执行和需要分析的突变体。我们证明,Cerebro具有很强的项目间预测能力,这是显着高于两个基线方法,即,对最先进的特征进行监督学习,以及随机突变选择。更重要的是,我们的研究结果表明,Cerebro选择的突变体导致了强有力的测试,当选择相同数量的突变体时,这些测试分别能够杀死比基线杀死的包含突变体数量高2倍的数量。与此同时,Cerebro减少了成本相关因素,因为它选择的等效突变体平均减少了68%,而需要的测试执行比基线减少了90%。

英文摘要:

Mutation testing research has indicated that a major part of its application cost is due to the large number of low utility mutants that it introduces. Although previous research has identified this issue, no previous study has proposed any effective solution to the problem. Thus, it remains unclear how to mutate and test a given piece of code in a best effort way, i.e., achieving a good trade-off between invested effort and test effectiveness. To achieve this, we propose Cerebro, a machine learning approach that statically selects subsuming mutants, i.e., the set of mutants that resides on the top of the subsumption hierarchy, based on the mutants' surrounding code context. We evaluate Cerebro using 48 and 10 programs written in C and Java, respectively, and demonstrate that it preserves the mutation testing benefits while limiting application cost, i.e., reduces all cost application factors such as equivalent mutants, mutant executions, and the mutants requiring analysis. We demonstrate that Cerebro has strong inter-project prediction ability, which is significantly higher than two baseline methods, i.e., supervised learning on features proposed by state-of-the-art, and random mutant selection. More importantly, our results show that Cerebro's selected mutants lead to strong tests that are respectively capable of killing 2 times higher than the number of subsuming mutants killed by the baselines when selecting the same number of mutants. At the same time, Cerebro reduces the cost-related factors, as it selects, on average, 68% fewer equivalent mutants, while requiring 90% fewer test executions than the baselines.

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

↑