一句话:提出 Mart,一个基于 LLVM bitcode 的变异体生成工具,支持细粒度变异算子与编译器等价去重。
变异测试通过微小语法改动人工制造故障程序(变异体),但生成工具需灵活定义变异算子、限定变异代码范围,并剔除等价与重复变异体。Mart 面向 LLVM bitcode,将变异算子表示为匹配规则-替换模式对,默认提供 816 对,并支持限制待变异代码部分;生成时在内存中执行 Trivial Compiler Equivalence,以消除等价和重复变异体。工具可输出分离变异体文件、meta-mutants、weak mutation 及 mutant coverage 插桩文件。Mart 已公开,并应用于多个研究实验,累计生成超过 4,000,000 个变异体。
Program mutation makes small syntactic alterations to programs' code in order to artificially create faulty programs (mutants). Mutants creation (generation) tools are often characterized by their mutation operators and the way they create and represent the mutants. This paper presents Mart, a mutants generation tool, for LLVM bitcode, that supports the fine-grained definition of mutation operators (as matching rule - replacing pattern pair; uses 816 defined pairs by default) and the restriction of the code parts to mutate. New operators are implemented in Mart by implementing their matching rules and replacing patterns. Mart also implements in-memory Trivial Compiler Equivalence to eliminate equivalent and duplicate mutants during mutants generation. Mart generates mutant code as separated mutant files, meta-mutants file, weak mutation and mutant coverage instrumented files. Mart is publicly available (https://github.com/thierry-tct/mart). Mart has been applied to generate mutants for several research experiments and generated more than 4,000,000 mutants.