What is it about?
We introduce a novel approach for testing for type checkers in compilers. 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, such as parametric polymorphism, overloading or higher-order functions.
Featured Image
Photo by Douglas Lopes on Unsplash
Why is it important?
The reliability of type checkers is crucial for robust software development. Flaws in type checkers can lead to (1) reliability and security ramifications on the programs compiled with the faulty compilers, and (2) degradation of the programmers’ experience and productivity. In particular, compiler typing bugs cause frustrating rejections of well-typed programs, dangerous acceptances of erroneous, type-unsafe programs, or annoying crashes and compilation performance issues. Using our approach, we have found more than 80 compiler typing bugs in the compilers of popular languages, such as Groovy, Scala, and Kotlin.
Perspectives
I think this paper is a nice example that demonstrates how combining real-world code with synthetic code can significantly improve the quality and the diversity of program generators. I strongly believe that in the future there will be more work towards this direction. Furthermore, due to its generality, our work has the potential to be applied to more languages with sophisticated type systems, such as Rust.
Thodoris Sotiropoulos
ETH Zurich
Read the Original
This page is a summary of: API-Driven Program Synthesis for Testing Static Typing Implementations, Proceedings of the ACM on Programming Languages, January 2024, ACM (Association for Computing Machinery),
DOI: 10.1145/3632904.
You can read the full text:
Contributors
The following have contributed to this page







