Proceedings of the ACM on Programming Languages · 2021 · 26 citations · 44 references
ComputingComputer EngineeringComputer ScienceCompilersProgramming LanguagesSoftware EngineeringAbstract Syntax TreesCompiler Back EndsControl-flow AnalysisSoftware TestingType CheckingType SystemsCompiler Front EndsPolymorphic Type SystemsStatic Type CheckingTest CasesType AnalysisType Error ReportingType InferenceType Soundness
Despite the substantial progress in compiler testing, research endeavors have mainly focused on detecting compiler crashes and subtle miscompilations caused by bugs in the implementation of compiler optimizations. Surprisingly, this growing body of work neglects other compiler components, most notably the front-end. In statically-typed programming languages with rich and expressive type systems and modern features, such as type inference or a mix of object-oriented with functional programming features, the process of static typing in compiler front-ends is complicated by a high-density of bugs. Such bugs can lead to the acceptance of incorrect programs (breaking code portability or the type system's soundness), the rejection of correct (e.g. well-typed) programs, and the reporting of misleading errors and warnings. We conduct, what is to the best of our knowledge, the first empirical study for understanding and characterizing typing-related compiler bugs. To do so, we manually study 320 typing-related bugs (along with their fixes and test cases) that are randomly sampled from four mainstream JVM languages, namely Java, Scala, Kotlin, and Groovy. We evaluate each bug in terms of several aspects, including their symptom, root cause, bug fix's size, and the characteristics of the bug-revealing test cases. Some representative observations indicate that: (1) more than half of the typing-related bugs manifest as unexpected compile-time errors: the buggy compiler wrongly rejects semantically correct programs, (2) the majority of typing-related bugs lie in the implementations of the underlying type systems and in other core components related to operations on types, (3) parametric polymorphism is the most pervasive feature in the corresponding test cases, (4) one third of typing-related bugs are triggered by non-compilable programs. We believe that our study opens up a new research direction by driving future researchers to build appropriate methods and techniques for a more holistic testing of compilers.
44
A theory of type polymorphism in programming
Robin Milner · Journal of Computer and System Sciences · 1978 · 2.2K citations · Full text
Finding and understanding bugs in C compilers
Xuejun Yang, Yang Chen, Eric Eide et al. · 2011 · 733 citations
An Overview of the Scala Programming Language
Martin Odersky, Philippe Altherr, Vincent Cremet et al. · Infoscience (Ecole Polytechnique Fédérale de Lausanne) · 2004 · 511 citations · Full text
Making the future safe for the past
Gilad Bracha, Martin Odersky, David Stoutamire et al. · 1998 · 503 citations · Full text
Compiler validation via equivalence modulo inputs
Vu Le, Mehrdad Afshari, Zhendong Su · 2014 · 372 citations