PTE:基于公理化语义的编译器测试
PTE: Axiomatic Semantics based Compiler Testing
AI总结:
本文提出基于公理化语义的编译器测试方法PTE,通过增量开发(前置条件,转换,期望)三元组公理自动测试编译器,在Cangjie和Java编译器中成功发现42个实现缺陷和9个语言设计问题。
摘要:
编译器的正确性影响着用该语言编写的每个程序的正确性,因此必须对其进行全面评估。然而,现有的自动编译器测试方法要么依赖弱测试预言(例如,如果仅修改死代码,程序行为保持不变),要么需要大量的初始投入(例如,具备完整的操作语言语义)。前者阻碍了全面的正确性评估,而后者使这些方法在实践中失去意义。在本研究中,我们提出了一种基于公理化语义的编译器测试方法,称为PTE。其核心思想是增量开发一组“公理”,以(前置条件,转换,期望)三元组的形式捕捉语言语义的轶事,从而允许我们自动测试编译器。这些公理使用与被测编译器相同的语言编写,可以基于语言规范开发,或通过概括错误报告来生成。PTE已应用于一个新开发的编译器(即Cangjie)和一个成熟的编译器(即Java),成功识别出42个实现缺陷和9个潜在的语言设计问题。
英文摘要:
The correctness of a compiler affects the correctness of every program written in the language, and thus must be thoroughly evaluated. Existing automatic compiler testing methods however either rely on weak oracles (e.g., a program behaves the same if only dead code is modified), or require substantial initial effort (e.g., having a complete operational language semantics). While the former prevents a comprehensive correctness evaluation, the latter makes those methods irrelevant in practice. In this work, we propose an axiomatic semantics based approach for testing compilers, called PTE. The idea is to incrementally develop a set of ``axioms'' capturing anecdotes of the language semantics in the form of \emph{(\textbf{p}recondition, \textbf{t}ransformation, \textbf{e}xpectation) triples, which allows us to test the compiler automatically.} Such axioms are written in the same language whose compiler is under test, and can be developed either based on the language specification, or by generalizing the bug reports. PTE has been applied to a newly developed compiler (i.e., Cangjie) and a mature compiler (i.e., Java), and successfully identified 42 implementation bugs and 9 potential language design issues.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。