AI 中文总结
本文针对转译器测试难题,提出基于转译后程序突变一致性的变形测试技术,实现工具MCP-Tester,案例研究显示其能发现纯模糊测试漏检的故障。
AI 中文摘要
转译器在软件开发中应用日益广泛,尤其在依赖领域特定语言(DSL)的工业领域,可让工程师使用熟悉的概念和合适的抽象进行工作。因此,确保这些工具的正确性在许多工业场景中至关重要。本文发现,现有编译器测试方法几乎无法推广到转译器:差分测试方法受限于实践中很少有被测转译器的多个等价实现;基于变形测试的方法假设能执行编译后的二进制文件,但转译器常生成源代码,需复杂工具链、硬件在环设置,且依赖非平凡输入,该假设无法总是满足。本文提出一种专为转译器设计的新型变形测试技术,不推理编译后程序的运行时行为,而是直接在转译器生成的源代码上定义变形关系,这些关系捕捉(转译后)程序的突变一致性属性:输入DSL程序的突变式变更必须在生成的输出中引发可预测且结构一致的变更。我们将该思想实现在工具MCP-Tester中,并通过一项技术转让项目背景下的案例研究进行评估。当前实证结果表明,所提方法可有效发现纯模糊测试无法检测到的故障。
英文摘要
Transpilers are increasingly used for software development, especially in industrial domains that rely on domain-specific languages (DSLs), to allow engineers to work with familiar concepts and appropriate abstractions. Ensuring the correctness of these instruments is therefore critical in many industrial settings. This paper observes that existing approaches for compiler testing hardly generalize to transpilers. Differential testing approaches are hindered as multiple equivalent implementations of the transpiler under test are seldom available in practice. The approaches based on metamorphic testing assume the ability to execute the compiled binaries, an assumption that cannot be always made for transpilers, which oftentimes produce results expressed as source code, requiring complex toolchains, hardware-in-the-loop setups, and depending on non trivial inputs. This paper introduces a novel metamorphic testing technique tailored to transpilers. Instead of reasoning about the runtime behavior of compiled programs, our approach defines metamorphic relations directly over the source code produced by the transpiler. These relations capture a property that we call mutation consistency of the (transpiled) programs: mutation-style changes in the input DSL program must induce predictable and structurally consistent changes in the generated output. We implemented this idea in a tool, MCP-Tester, and evaluated it through a case study conducted in the context of a technology-transfer project. Our current empirical results indicate that the proposed approach can effectively reveal faults that would remain undetected with pure fuzzing.
Comments11 pages, 4 figures