JavaScript (JS) is a popular, platform-independent programming language. To ensure the interoperability of JS programs across different platforms, the implementation of a JS engine should conform to the ECMAScript standard. However, doing so is challenging as there are many subtle definitions of API behaviors, and the definitions keep evolving. We present COMFORT, a new compiler fuzzing framework for detecting JS engine bugs and behaviors that deviate from the ECMAScript standard. COMFORT leverages the recent advance in deep learning-based language models to automatically generate JS test code. As a departure from prior fuzzers, COMFORT utilizes the well-structured ECMAScript specifications to automatically generate test data along with the test programs to expose bugs that could be overlooked by the developers or manually written test cases. COMFORT then applies differential testing methodologies on the generated test cases to expose standard conformance bugs. We apply COMFORT to ten mainstream JS engines. In 200 hours of automated concurrent testing runs, we discover bugs in all tested JS engines. We had identified 158 unique JS engine bugs, of which 129 have been verified, and 115 have already been fixed by the developers. Furthermore, 21 of the Comfort-generated test cases have been added to Test262, the official ECMAScript conformance test suite.
翻译:JavaScript (JS) 是一种受欢迎的、独立于平台的编程语言。 为了确保联署材料程序在不同平台的互操作性, 执行联署材料引擎应该符合ECMAScript 标准。 然而, 这样做具有挑战性, 因为对API行为有许多微妙的定义, 定义也不断演变。 我们介绍了CCOMFORT, 一个新的编译器模糊框架, 用于检测联署材料引擎错误和偏离ECMAScript 标准的行为。 COMFORT 利用最近深入学习语言模型的进展, 自动生成联署材料测试代码。 作为偏离先前的喷雾器, COMFORT 使用结构完善的ECMAScript 规格自动生成测试数据, 与测试程序一起自动生成测试数据, 暴露开发者或人工书面测试案例可能忽略的错误。 我们介绍了COMFORT 对产生的测试案例应用差异测试方法, 以暴露标准合规错误。 在200小时内, 我们在所有测试的联署材料引擎中发现了错误。 我们查明了158个独一无二的JSMAS IM B 。