A Study of Bug Resolution Characteristics in Popular Programming Languages

Jie M. Zhang, Feng Li, Dan Hao, Meng Wang, Hao Tang, Lu Zhang, Mark Harman

Abstract

This paper presents a large-scale study investigating bug resolution characteristics among popular GitHub projects across ten programming languages. Analyzing approximately 70 million Source Lines of Code (SLOC) from 3 million commits in 600 projects, we identify notable variations in bug resolution time and patch size. Our findings indicate that while statically typed languages like Java and C# often require larger patches (touching more lines and files), they are resolved significantly faster than dynamically typed languages like Ruby. Specifically, the median resolution time for Ruby was 4x that of Go and 2.5x that of Java. These results suggest that type systems may serve as valuable documentation that aids the debugging process.

Introduction

The debate between static and dynamic typing has persisted for decades. Proponents of static typing argue for safety and maintainability, while advocates of dynamic typing prize flexibility and speed of development. However, empirical evidence regarding how these language choices affect the actual maintenance phase—specifically bug resolution—has been sparse. This study aims to quantify these differences by examining the effort required to fix bugs across different language ecosystems.

Methodology and Dataset

The researchers analyzed 600 of the most popular GitHub projects, spanning ten languages: C, C#, C++, Go, Java, JavaScript, Objective-C, PHP, Python, and Ruby. The dataset comprised 3 million commits and 70 million SLOC.

To ensure statistical robustness, the study employed:

  1. Median-Value Comparison: To mitigate the influence of extreme outliers.
  2. Multiple Linear Regression: To isolate the language's effect while controlling for project age, size, and contributor count.
  3. ScottKnott Clustering: To group languages into statistically distinct ranks.

Analysis was conducted at both the project level (aggregating data per project) and the commit level (analyzing individual bug-fix patches).

Key Findings: Fix Size vs. Resolution Speed

The study revealed a fascinating trade-off between the "size" of a fix and the "time" taken to implement it.

The Verbosity of Static Languages

Languages often criticized for verbosity, such as Java and C#, indeed showed larger patch sizes. Bug fixes in these languages typically involved significantly more lines of code and touched more files compared to languages like Ruby or Python. The data confirms that Java and C# bug fixes change roughly 2.2 times as many lines of code as Ruby fixes.

The Speed of Resolution

Despite the larger patch sizes, bugs in statically typed languages were resolved much faster. For instance, the median time to resolve a bug in Ruby was 2.5 times longer than in Java and 4 times longer than in Go.

Figure 1: Bug resolution characteristics (SLOC changed, files touched, and resolution time) across ten popular programming languages at both project and commit levels.

The Impact of Type Systems

When languages were grouped by their type systems, clear patterns emerged. Statically typed languages (where types are checked at compile-time) required 60.6% less time to resolve bugs than dynamically typed languages, even though their fixes were 37.5% larger in terms of SLOC.

Figure 3: Comparison of bug resolution metrics (SLOC, files touched, and time) categorized by static vs. dynamic and strong vs. weak typing.

This suggests that explicit type declarations and compile-time checks might act as a form of "living documentation," helping developers navigate codebases and identify root causes more efficiently. Conversely, the flexibility of dynamic languages—such as "monkey patching" in Ruby—may lead to complex runtime behaviors that are harder to diagnose.

Project Context and Domain

Interestingly, the study found that project-specific factors like total SLOC, project age, and the number of contributors had minimal correlation with bug resolution time. Furthermore, the application domain (e.g., whether the project was a database, framework, or library) also had negligible impact. The programming language itself remained the strongest predictor of bug resolution behavior.

Conclusion

While this study identifies strong correlations, the authors emphasize that correlation does not imply causation. The differences observed could stem from language features, community-specific development cultures, or the inherent nature of the problems typically solved in those languages. Nonetheless, the magnitude of the differences in resolution time warrants serious consideration by project managers and language designers alike. Future research focusing on projects migrating between type systems (e.g., JavaScript to TypeScript) will be crucial in further isolating the impact of the language itself.

Summary updated

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.
BibTeX
@article{zhang2021study,
  author = {Jie M. Zhang and Feng Li and Dan Hao and Meng Wang and Hao Tang and Lu Zhang and Mark Harman},
  title = {{A Study of Bug Resolution Characteristics in Popular Programming Languages}},
  journal = {IEEE Trans. Software Eng.},
  year = {2021},
  url = {https://openreview.net/forum?id=b2ikek1YpF},
}
Figure