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

基于意图的变异测试:从自然编写的编程意图到变异体

Intent-Based Mutation Testing: From Naturally Written Programming Intents to Mutants

SnT, University of Luxembourg(卢森堡大学 SnT);Medtech, South Mediterranean University(南地中海大学 Medtech)

Asma Hamidi, Ahmed Khanfir, Mike Papadakis

AI总结:

提出基于意图的变异测试,通过改变被测程序实现的编程意图来生成变异体,与传统测试不同,能捕获不同类型故障,用大语言模型实现并评估,可补充传统变异测试。

摘要:

本文提出基于意图的变异测试,一种通过改变被测程序中实现的编程意图来生成变异的测试方法。与传统变异测试不同,意图变异通过产生实现与原程序略有不同意图的变异来改变程序行为。编程意图的变异代表程序行为的可能边界情况和误解,能捕获不同类型故障。基于意图的变异测试使用大语言模型实现,评估结果表明其可补充传统变异测试。

英文摘要:

This paper presents intent-based mutation testing, a testing approach that generates mutations by changing the programming intents that are implemented in the programs under test. In contrast to traditional mutation testing, which changes (mutates) the way programs are written, intent mutation changes (mutates) the behavior of the programs by producing mutations that implement (slightly) different intents than those implemented in the original program. The mutations of the programming intents represent possible corner cases and misunderstandings of the program behavior, i.e., program specifications, and thus can capture different classes of faults than traditional (syntax-based) mutation. Moreover, since programming intents can be implemented in different ways, intent-based mutation testing can generate diverse and complex mutations that are close to the original programming intents (specifications) and thus direct testing towards the intent variants of the program behavior/specifications. We implement intent-based mutation testing using Large Language Models (LLMs) that mutate programming intents and transform them into mutants. We evaluate intent-based mutation on 29 programs and show that it generates mutations that are syntactically complex, semantically diverse, and quite different (semantically) from the traditional ones. We also show that 55% of the intent-based mutations are not subsumed by traditional mutations. Overall, our analysis shows that intent-based mutation testing can be a powerful complement to traditional (syntax-based) mutation testing.

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

↑