Lune

POPL2024Top-tier venue

API-Driven Program Synthesis for Testing Static Typing Implementations

Thodoris Sotiropoulos, Stefanos Chaliasos, Zhendong Su

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Divergence-Aware Testing of Graphics Shader Compiler Back-Ends cites Finding typing compiler bugs
  • Divergence-Aware Testing of Graphics Shader Compiler Back-Ends cites Random testing for C and C++ compilers with YARPGen
  • Divergence-Aware Testing of Graphics Shader Compiler Back-Ends cites Fuzzing Loop Optimizations in Compilers for C++ and Data-Parallel Languages
  • Divergence-Aware Testing of Graphics Shader Compiler Back-Ends cites Test-case reduction and deduplication almost for free with transformation-based compiler testing
  • Finding typing compiler bugs cites Random testing for C and C++ compilers with YARPGen
  • Finding typing compiler bugs cites Test-case reduction and deduplication almost for free with transformation-based compiler testing
  • API-Guided Dataset Synthesis to Finetune Large Code Models cites Program synthesis by type-guided abstraction refinement
  • Test-case reduction and deduplication almost for free with transformation-based compiler testing cites Random testing for C and C++ compilers with YARPGen
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. Sharpen the Spec, Cut the Code: A Case for Generative File System with SYSSPECQingyuan Liu, Mo Zou, Hengbin Zhang, Dong Du et al.FAST 2026 · 9 citations
  2. API-Guided Dataset Synthesis to Finetune Large Code ModelsZongjie Li, Daoyuan Wu, Shuai Wang, Zhendong SuOOPSLA 2025 · 6 citations
  3. Crabtree: Rust API Test Synthesis Guided by Coverage and TypeYoshiki Takashima, Chanhee Cho, Ruben Martins, Limin Jia et al.OOPSLA 2024 · 3 citations
  4. Divergence-Aware Testing of Graphics Shader Compiler Back-EndsDongwei Xiao, Shuai Wang, Zhibo Liu, Yiteng Peng et al.PLDI 2025 · 1 citation
  5. Diatom: Polylithic Binary Lifting with Data-Flow Summaries and Type-Aware IR LinkingAnshunkang Zhou, Charles ZhangOOPSLA 2026 · 1 citation

Builds on10

  1. Random testing for C and C++ compilers with YARPGenVsevolod Livinskii, Dmitry Babokin, John RegehrOOPSLA 2020 · 140 citations
  2. Program synthesis by type-guided abstraction refinementZheng Guo, Michael James, David Justo, Jiaxiao Zhou et al.POPL 2020 · 45 citations
  3. Fuzzing Loop Optimizations in Compilers for C++ and Data-Parallel LanguagesVsevolod Livinskii, Dmitry Babokin, John RegehrPLDI 2023 · 42 citations
  4. Test-case reduction and deduplication almost for free with transformation-based compiler testingAlastair F. Donaldson, Paul Thomson, Vasyl Teliman, Stefano Milizia et al.PLDI 2021 · 39 citations
  5. Finding typing compiler bugsStefanos Chaliasos, Thodoris Sotiropoulos, Diomidis Spinellis, Arthur Gervais et al.PLDI 2022 · 36 citations

Related papers

  1. Well-typed programs can go wrong: a study of typing-related bugs in JVM compilersStefanos Chaliasos, Thodoris Sotiropoulos, Georgios-Petros Drosos, Charalambos Mitropoulos et al.OOPSLA 2021 · 31 citations
  2. Enumerating Ill-Typed Programs for Testing Type AnalyzersThodoris Sotiropoulos, Zhendong SuPLDI 2026
  3. No Harness, No Problem: Oracle-guided Harnessing for Auto-generating C API Fuzzing HarnessesGabriel Sherman, Stefan NagyICSE 2025 · 1 citation
  4. Boosting Compiler Testing by Injecting Real-World CodeShaohua Li, Theodoros Theodoridis, Zhendong SuPLDI 2024 · 24 citations
  5. Digging for fold: synthesis-aided API discovery for HaskellMichael B. James, Zheng Guo, Ziteng Wang, Shivani Doshi et al.OOPSLA 2020 · 19 citations
Dusk over the sea between two cliffs drawn in fine vertical lines