一句话:提出七种源自 Python 反模式的变异算子,用静态与动态分析混合实现 PyTation,扩充故障模型并减少等价变异体。
变异测试通过注入人工故障评估测试套件有效性,但现有技术在 Python 这类动态类型语言上难以刻画常见故障。本文从 Python 程序中普遍存在的反模式出发,提出七个新的变异算子,用以补充通用算子并拓宽所模拟故障的范围。作者设计了一种混合静态与动态分析的变异测试技术,基于这些算子对 Python 程序进行变异,并借助动态分析启发式尽量减少等价变异体。该技术实现为工具 PyTation,并在 13 个开源 Python 应用上评估。结果表明,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.