arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.19088cs.SE
收藏

混合故障驱动的Python变异测试

Hybrid Fault-Driven Mutation Testing for Python

Simon Fraser University(西蒙菲莎大学);University of Ottawa(渥太华大学)

Saba Alimadadi, Golnaz Gharachorlu

AI总结:

本文提出了一种基于静态和动态分析混合技术的Python变异测试方法,通过七种新的变异算子生成补充现有工具的变异体,提高测试覆盖率和发现缺陷的能力。

摘要:

变异测试是一种通过系统地将人工故障注入到程序中来评估测试套件有效性的有效技术。然而,现有的变异测试技术在捕捉动态类型语言如Python中许多常见故障类型方面存在不足。在本文中,我们介绍了一组新的七种变异算子,这些算子受到Python程序中常见反模式的启发,旨在补充现有的通用算子并扩大模拟故障的范围。我们提出了一种利用静态和动态分析混合技术的变异测试技术,基于这些算子对Python程序进行变异,同时最小化等价变异体。我们将在名为PyTation的工具中实现我们的方法,并在13个开源Python应用程序上进行评估。我们的结果表明,PyTation生成的变异体补充了通用工具生成的变异体,在测试执行下表现出不同的行为,并揭示了高覆盖率测试套件的不足。我们进一步证明,PyTation产生的独特变异体比例较高,交叉杀灭率和测试重叠率较低,相对于基准工具,突显了其新颖的故障模型。PyTation还通过动态分析启发式方法产生了少量等价变异体。

英文摘要:

Mutation testing is an effective technique for assessing the effectiveness of test suites by systematically injecting artificial faults into programs. However, existing mutation testing techniques fall short in capturing many types of common faults in dynamically typed languages like Python. In this paper, we introduce a novel set of seven mutation operators that are inspired by prevalent anti-patterns in Python programs, designed to complement the existing general-purpose operators and broaden the spectrum of simulated faults. We propose a mutation testing technique that utilizes a hybrid of static and dynamic analyses to mutate Python programs based on these operators while minimizing equivalent mutants. We implement our approach in a tool called PyTation and evaluate it on 13 open-source Python applications. Our results show that PyTation generates mutants that complement those from general-purpose tools, exhibiting distinct behaviour under test execution and uncovering inadequacies in high-coverage test suites. We further demonstrate that PyTation produces a high proportion of unique mutants, a low cross-kill rate, and a low test overlap ratio relative to baseline tools, highlighting its novel fault model. PyTation also incurs few equivalent mutants, aided by dynamic analysis heuristics.

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

↑