Abstract
This paper presents a large-scale study that investigates the bug resolution characteristics among popular Github projects written in different programming languages. We explore correlations but, of course, we cannot infer causation. Specifically, we analyse bug resolution data from approximately 70 million Source Line of Code, drawn from 3 million commits to 600 GitHub projects, primarily written in 10 programming languages. We find notable variations in apparent bug resolution time and patch (fix) size. While interpretation of results from such large-scale empirical studies is inherently difficult, we believe that the differences in medians are sufficiently large to warrant further investigation, replication, re-analysis and follow up research. For example, in our corpus, the median apparent bug resolution time (elapsed time from raise to resolve) for Ruby was 4X that for Go and 2.5X for Java. We also found that patches tend to touch more files for the corpus of strongly typed and for statically typed programs. However, we also found evidence for a lower elapsed resolution time for bug resolution committed to projects constructed from statically typed languages. These findings, if replicated in subsequent follow on studies, may shed further empirical light on the debate about the importance of static typing.
Introduction
The "Great Debate" in software engineering often revolves around programming language choice, specifically the merits of static versus dynamic typing. Proponents of static typing argue it catches errors early and improves maintainability, while advocates for dynamic typing emphasize conciseness and developer velocity. Despite the intensity of these debates, empirical evidence at scale has been limited. This study addresses this gap by quantifying "bug-handling effort"—measured through resolution time and patch size—across ten of the world's most popular programming languages.
Methodology
The study analyzed a massive dataset comprising 600 GitHub projects (the top 60 for each of 10 languages), totaling approximately 70 million Source Lines of Code (SLOC) and 3 million commits. The languages studied include C, C#, C++, Go, Java, JavaScript, Objective-C, PHP, Python, and Ruby.
To ensure robust findings, the researchers employed:
- Median-Value Comparison: To identify typical bug-fixing characteristics.
- Multiple Linear Regression: To isolate the impact of the language while controlling for other factors like project size, age, and number of contributors.
- ScottKnott Clustering: A statistical method that groups languages into distinct "ranks" based on significant differences.
Bug-fixing commits were identified using automated keyword filtering (e.g., "fix", "bug") and validated through manual inspection to ensure high precision.
Key Findings
The Verbosity-Speed Trade-off
A primary finding is the "verbosity paradox" observed in statically typed languages like Java and C#. While these languages are often criticized for being verbose, the data shows that this verbosity does not necessarily equate to slower development. In fact, while Java and C# bug fixes involve significantly more lines of code and touch more files than languages like Ruby, they are resolved much faster.
The researchers hypothesize that the explicit structures of static languages (type declarations, interfaces) act as a roadmap, helping developers navigate codebases and identify root causes more efficiently, even if the resulting fix requires more code.
Language Paradigms and Bug Resolution
The study found significant differences when grouping languages by their type systems. Statically typed languages generally required larger patches but resulted in faster resolution times. Conversely, dynamically typed languages like Ruby and Python had smaller patches but significantly longer resolution times.
Specifically:
- Dynamic vs. Static: Dynamically typed languages used 37.5% fewer lines per fix but took 59.5% more time to resolve than statically typed ones.
- Weak vs. Strong: Weakly typed languages used 20% fewer lines but took 46.5% more time to resolve than strongly typed ones.
The Ruby Outlier
Ruby exhibited the longest resolution times in the study—median resolution was 2.5 times longer than Java and 4 times longer than Go. Further investigation suggested that the widespread use of "monkey patching" (dynamically modifying classes at runtime) in Ruby projects might contribute to harder-to-diagnose bugs.
Discussion and Limitations
While the correlations are striking, the authors emphasize that correlation does not imply causation. Factors such as community culture, developer experience, and ecosystem tooling also influence these metrics. The study's focus on the "most popular" projects may also reflect the practices of highly experienced developers rather than the broader programming community. Furthermore, "resolution time" is a proxy for effort and includes idle time when a bug may not have been actively worked on.
Future research could investigate "community migration"—observing changes in bug metrics as projects transition between paradigms, such as from JavaScript to TypeScript—to better isolate the causal effects of language features.
Summary updated