一句话:提出 SRCIROR 工具集,可在 C/C++ 源码与 LLVM IR 两个层面复用同类变异算子执行变异测试。
变异测试通过注入人工缺陷来评估测试套件质量,但现有工具通常只针对单一代码表示层面。本文提出 SRCIROR 工具集,支持在 C/C++ 源代码(SRC)和 LLVM 编译器中间表示(IR)两级进行变异测试。在源码层,SRCIROR 通过对 Clang AST 做模式匹配识别可变异构造;在 IR 层,它借助 LLVM pass 直接改写 IR 指令。该实现能够处理 Clang 支持的任意程序,扩展到大型程序时开销很小,且产生不可编译的无效变异体比例较低。工具在两级支持同一类变异算子,便于扩展新算子,并可通过收集覆盖率只对被执行到的代码元素生成变异体。作者在 Coreutils 上评估,揭示了 SRC 与 IR 层面之间的有趣差异,体现了该工具在跨代码表示层开展变异测试研究的价值。工具已在 GitHub 公开。
We present SRCIROR (pronounced “sorcerer“), a toolset for performing mutation testing at the levels of C/C++ source code (SRC) and the LLVM compiler intermediate representation (IR). At the SRC level, SRCIROR identifies program constructs for mutation by pattern-matching on the Clang AST. At the IR level, SRCIROR directly mutates the LLVM IR instructions through LLVM passes. Our implementation enables SRCIROR to (1) handle any program that Clang can handle, extending to large programs with a minimal overhead, and (2) have a small percentage of invalid mutants that do not compile. SRCIROR enables performing mutation testing using the same classes of mutation operators at both the SRC and IR levels, and it is easily extensible to support more operators. In addition, SRCIROR can collect coverage to generate mutants only for covered code elements. Our tool is publicly available on GitHub (https://github.com/TestingResearchIllinois/srciror). We evaluate SRCIROR on Coreutils subjects. Our evaluation shows interesting differences between SRC and IR, demonstrating the value of SRCIROR in enabling mutation testing research across different levels of code representation.
DOI 原文 ·
@inproceedings{paperbot4782,
title = {SRCIROR: a toolset for mutation testing of C source code and LLVM intermediate representation},
author = {Farah Hariri and August Shi},
booktitle = {ASE},
year = {2018},
doi = {10.1145/3238147.3240482}
}