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

上下文预测性变异测试

Contextual Predictive Mutation Testing

Kush Jain, Uri Alon, Alex Groce, Claire Le Goues

AI总结:

提出MutationBERT,通过同时编码源方法变异体和测试方法捕获上下文,提升预测性变异测试精度,节省33%验证时间,并在同项目与跨项目设置中优于现有技术。

摘要:

变异测试是一种评估和改进测试套件质量的有力技术,它通过人为引入缺陷并检查测试套件能否捕获这些缺陷来工作。然而,该技术计算成本高昂,因此无法扩展到大型系统和项目。最近一种有前景的解决该扩展性问题的方法利用机器学习来预测测试是否会检测到合成缺陷,而无需实际运行这些测试。然而,现有的预测性变异测试方法在随机抽样的变异体-测试套件对上仍有33%的检测结果被错误分类。我们提出了MutationBERT,一种用于预测性变异测试的方法,它同时编码源方法变异体和测试方法,在输入表示中捕获关键上下文。凭借其更高的精确度,MutationBERT相比先前方法节省了33%用于检查/验证存活变异体的时间。MutationBERT在相同项目和跨项目设置下均优于现有最先进技术,在精确度、召回率和F1分数上均有显著提升。我们验证了我们的输入表示以及将预测从测试矩阵级别提升到测试套件级别的聚合方法,发现性能有类似提升。MutationBERT不仅增强了预测性变异测试的最新技术水平,还为实际应用带来了实用益处,既节省了开发人员时间,又发现了难以检测的变异体。

英文摘要:

Mutation testing is a powerful technique for assessing and improving test suite quality that artificially introduces bugs and checks whether the test suites catch them. However, it is also computationally expensive and thus does not scale to large systems and projects. One promising recent approach to tackling this scalability problem uses machine learning to predict whether the tests will detect the synthetic bugs, without actually running those tests. However, existing predictive mutation testing approaches still misclassify 33% of detection outcomes on a randomly sampled set of mutant-test suite pairs. We introduce MutationBERT, an approach for predictive mutation testing that simultaneously encodes the source method mutation and test method, capturing key context in the input representation. Thanks to its higher precision, MutationBERT saves 33% of the time spent by a prior approach on checking/verifying live mutants. MutationBERT, also outperforms the state-of-the-art in both same project and cross project settings, with meaningful improvements in precision, recall, and F1 score. We validate our input representation, and aggregation approaches for lifting predictions from the test matrix level to the test suite level, finding similar improvements in performance. MutationBERT not only enhances the state-of-the-art in predictive mutation testing, but also presents practical benefits for real-world applications, both in saving developer time and finding hard to detect mutants.

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

↑