扩展论文:用于测试静态类型实现的 API 驱动程序综合
Extended Paper: API-driven Program Synthesis for Testing Static Typing Implementations
AI总结:
本文提出 API 驱动的程序综合方法及工具 Thalia,通过复用库 API 并结合故障注入与语义保持模式测试静态类型实现,在 Scala、Kotlin 和 Groovy 编译器中发现 84 个类型错误。
摘要:
我们提出了一种测试静态类型实现的新颖方法,该方法基于 API 驱动程序综合的概念。其思路是通过利用并组合源自现有软件库的应用程序编程接口(API),综合出类型密集但规模较小且类型良好的程序。我们的主要洞见有现实证据支持:大量编译器类型错误是由使用被测语言标准库中 API 的小型测试用例引发的。这归因于大多数此类 API 固有的复杂性,它们往往会运用各种复杂的类型相关特性。我们方法的主要贡献在于能够生成具有更高特性覆盖率的小型客户端程序,而无需承担从头生成相应格式良好的 API 定义的负担。为了验证静态类型过程的多个方面(即可靠性、类型推断的精确性),我们还通过故障注入模式和语义保持模式及其相应的测试预言,丰富了这种 API 驱动方法。我们在三种流行语言(即 Scala、Kotlin 和 Groovy)的编译器上评估了所实现的工具 Thalia 对静态类型实现的测试效果。Thalia 已发现 84 个类型错误(其中 77 个已确认,22 个已修复),其中大多数由具有依赖参数多态、重载和高阶函数的 API 的测试用例触发。我们与最先进技术的比较表明,Thalia 生成的测试程序具有鲜明特征,可提供额外且互补的收益。
英文摘要:
We introduce a novel approach for testing static typing implementations based on the concept of API-driven program synthesis. The idea is to synthesize type-intensive but small and well-typed programs by leveraging and combining application programming interfaces (APIs) derived from existing software libraries. Our primary insight is backed up by real-world evidence: a significant number of compiler typing bugs are caused by small test cases that employ APIs from the standard library of the language under test. This is attributed to the inherent complexity of the majority of these APIs, which often exercise a wide range of sophisticated type-related features. The main contribution of our approach is the ability to produce small client programs with increased feature coverage, without bearing the burden of generating the corresponding well-formed API definitions from scratch. To validate diverse aspects of static typing procedures (i.e., soundness, precision of type inference), we also enrich our API-driven approach with fault-injection and semantics-preserving modes, along with their corresponding test oracles. We evaluate our implemented tool, Thalia on testing the static typing implementations of the compilers for three popular languages, namely, Scala, Kotlin, and Groovy. Thalia has uncovered 84 typing bugs (77 confirmed and 22 fixed), most of which are triggered by test cases featuring APIs that rely on parametric polymorphism, overloading, and higher-order functions. Our comparison with state-of-the-art shows that Thalia yields test programs with distinct characteristics, offering additional and complementary benefits.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。