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

Source Code中基于自然语言通道的预测突变分析

Predictive Mutation Analysis via Natural Language Channel in Source Code

Jinhan Kim, Juyoung Jeon, Shin Hong, Shin Yoo

摘要:

突变分析可以为被测系统(SUT)及其测试套件提供有价值的见解。然而,由于构建和测试大量突变体的成本,它不可扩展。预测突变测试(PMT)已经被提出来降低突变测试的成本,但它只能提供关于突变体是否会被整个测试套件杀死的统计推断。我们提出了Seshat,一种预测突变分析(PMA)技术,可以准确地预测整个杀伤矩阵,而不仅仅是给定测试套件的突变得分。Seshat利用代码中的自然语言通道,并从给定的kill矩阵中学习每个测试用例的语法和语义概念与它可以杀死的突变体之间的关系。学习后的模型可以用于预测程序后续版本的杀伤矩阵,即使在源代码和测试代码都发生了重大变化之后。使用Defects 4J中的程序进行的经验评估表明,Seshat可以预测相隔数年的版本的平均F分数为0.83的杀伤矩阵。这是一个改进的F-分数由0.14和0.45点,比国家的最先进的预测突变测试技术,和一个简单的覆盖率为基础的启发式,分别。Seshat在预测突变分数方面也表现得和PMT一样好。一旦Seshat使用具体的突变分析训练其模型,Seshat随后做出的预测平均比实际的基于测试的分析快39倍。

英文摘要:

Mutation analysis can provide valuable insights into both System Under Test (SUT) and its test suite. However, it is not scalable due to the cost of building and testing a large number of mutants. Predictive Mutation Testing (PMT) has been proposed to reduce the cost of mutation testing, but it can only provide statistical inference about whether a mutant will be killed or not by the entire test suite. We propose Seshat, a Predictive Mutation Analysis (PMA) technique that can accurately predict the entire kill matrix, not just the mutation score of the given test suite. Seshat exploits the natural language channel in code, and learns the relationship between the syntactic and semantic concepts of each test case and the mutants it can kill, from a given kill matrix. The learnt model can later be used to predict the kill matrices for subsequent versions of the program, even after both the source and test code have changed significantly. Empirical evaluation using the programs in the Defects4J shows that Seshat can predict kill matrices with the average F-score of 0.83 for versions that are up to years apart. This is an improvement of F-score by 0.14 and 0.45 point over the state-of-the-art predictive mutation testing technique, and a simple coverage based heuristic, respectively. Seshat also performs as well as PMT for the prediction of mutation scores only. Once Seshat trains its model using a concrete mutation analysis, the subsequent predictions made by Seshat are on average 39 times faster than actual test-based analysis.

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

↑