API-Driven Program Synthesis for Testing Static Typing Implementations
Thodoris Sotiropoulos, Stefanos Chaliasos, Zhendong Su
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 7 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Divergence-Aware Testing of Graphics Shader Compiler Back-Ends 引用了 Finding typing compiler bugs
- Divergence-Aware Testing of Graphics Shader Compiler Back-Ends 引用了 Random testing for C and C++ compilers with YARPGen
- Divergence-Aware Testing of Graphics Shader Compiler Back-Ends 引用了 Fuzzing Loop Optimizations in Compilers for C++ and Data-Parallel Languages
- Divergence-Aware Testing of Graphics Shader Compiler Back-Ends 引用了 Test-case reduction and deduplication almost for free with transformation-based compiler testing
- Finding typing compiler bugs 引用了 Random testing for C and C++ compilers with YARPGen
- Finding typing compiler bugs 引用了 Test-case reduction and deduplication almost for free with transformation-based compiler testing
- API-Guided Dataset Synthesis to Finetune Large Code Models 引用了 Program synthesis by type-guided abstraction refinement
- Test-case reduction and deduplication almost for free with transformation-based compiler testing 引用了 Random testing for C and C++ compilers with YARPGen
引用它的顶会 Paper7
- Sharpen the Spec, Cut the Code: A Case for Generative File System with SYSSPECQingyuan Liu, Mo Zou, Hengbin Zhang, Dong Du 等FAST 2026 · 9 次引用
- API-Guided Dataset Synthesis to Finetune Large Code ModelsZongjie Li, Daoyuan Wu, Shuai Wang, Zhendong SuOOPSLA 2025 · 6 次引用
- Crabtree: Rust API Test Synthesis Guided by Coverage and TypeYoshiki Takashima, Chanhee Cho, Ruben Martins, Limin Jia 等OOPSLA 2024 · 3 次引用
- Divergence-Aware Testing of Graphics Shader Compiler Back-EndsDongwei Xiao, Shuai Wang, Zhibo Liu, Yiteng Peng 等PLDI 2025 · 1 次引用
- Diatom: Polylithic Binary Lifting with Data-Flow Summaries and Type-Aware IR LinkingAnshunkang Zhou, Charles ZhangOOPSLA 2026 · 1 次引用
它引用的 Paper10
- Random testing for C and C++ compilers with YARPGenVsevolod Livinskii, Dmitry Babokin, John RegehrOOPSLA 2020 · 140 次引用
- Program synthesis by type-guided abstraction refinementZheng Guo, Michael James, David Justo, Jiaxiao Zhou 等POPL 2020 · 45 次引用
- Fuzzing Loop Optimizations in Compilers for C++ and Data-Parallel LanguagesVsevolod Livinskii, Dmitry Babokin, John RegehrPLDI 2023 · 42 次引用
- Test-case reduction and deduplication almost for free with transformation-based compiler testingAlastair F. Donaldson, Paul Thomson, Vasyl Teliman, Stefano Milizia 等PLDI 2021 · 39 次引用
- Finding typing compiler bugsStefanos Chaliasos, Thodoris Sotiropoulos, Diomidis Spinellis, Arthur Gervais 等PLDI 2022 · 36 次引用
相关 Paper
- Well-typed programs can go wrong: a study of typing-related bugs in JVM compilersStefanos Chaliasos, Thodoris Sotiropoulos, Georgios-Petros Drosos, Charalambos Mitropoulos 等OOPSLA 2021 · 31 次引用
- Enumerating Ill-Typed Programs for Testing Type AnalyzersThodoris Sotiropoulos, Zhendong SuPLDI 2026
- No Harness, No Problem: Oracle-guided Harnessing for Auto-generating C API Fuzzing HarnessesGabriel Sherman, Stefan NagyICSE 2025 · 1 次引用
- Boosting Compiler Testing by Injecting Real-World CodeShaohua Li, Theodoros Theodoridis, Zhendong SuPLDI 2024 · 24 次引用
- Digging for fold: synthesis-aided API discovery for HaskellMichael B. James, Zheng Guo, Ziteng Wang, Shivani Doshi 等OOPSLA 2020 · 19 次引用
