Abstract Modern software systems are increasingly polyglot, utilizing multiple programming languages to balance performance, productivity, and specialized functionality. While project-level polyglotism is well-documented, its impact at the commit level remains under-explored. This study analyzes 205,994 commits across 20 Apache Open Source Software (OSS) projects to characterize Multi-Programming-Language Commits (MPLCs)—changes involving files in two or more languages. Our findings reveal that MPLCs, while representing only 9% of total commits, exhibit significantly higher change complexity, longer resolution times, and increased defect density compared to single-language commits. These results highlight a critical need for cross-language development tools and better architectural management of language boundaries.
Introduction
We live in an era of polyglot programming. A single modern system might use Java for core logic, C++ for performance-critical components, and Python for data processing. While researchers have extensively studied the quality and maintenance of multi-language projects, there has been a lack of focus on the commit level.
This study addresses a practical gap: what happens when a developer must jump across language boundaries within a single atomic change? These "cross-language" changes are intuitively more difficult because they require context-switching between different syntaxes, type systems, and build tools. By quantifying this intuition, the authors explore whether MPLCs serve as "hotspots" for complexity and defects.
Methodology
The researchers conducted an empirical study following the Goal-Question-Metric (GQM) approach. An MPLC was defined as any commit involving modified source files in two or more programming languages. The study analyzed 20 non-trivial Apache OSS projects (e.g., Spark, Kafka, Cloudstack) involving over 200,000 commits.
To measure impact, several metrics were employed:
- Change Complexity: Quantified by Lines of Code Modified (LOCM), Number of Files Modified (NOFM), Number of Directories (NODM), and Entropy (measuring how "scattered" a change is).
- Issue Resolution Time: The duration JIRA issues associated with these commits remained open.
- Bug Proneness: Calculated via Defect Density (bugs per line of code) for files involved in MPLCs versus those that were not.
Statistical significance was verified using the Mann-Whitney U test to ensure observed differences were not due to random noise.
Key Insights and Results
- The "Two-Language" Norm: Data indicates that over 90% of MPLCs involve exactly two languages. This suggests that while systems are polyglot, developers typically only bridge one language gap at a time (e.g., Java to C++ via JNI).
- Architectural Equilibrium: In 80% of the projects, the proportion of MPLCs stabilized over time. This suggests that after an initial growth phase, projects reach an architectural state where the frequency of cross-language changes becomes predictable.
- Complexity and Entropy: MPLCs are not merely "larger" in terms of code volume; they have significantly higher entropy. This means changes are more geographically dispersed across the project's directory structure, making them harder to reason about and review.
- The Bug Magnet Effect: Files frequently modified in multi-language commits are significantly more likely to harbor bugs. In 16 out of 20 projects, files touched by MPLCs had a significantly higher defect density. In the case of Subversion, the difference exceeded 3,600%.
- Resolution Delay: Issues fixed via MPLCs took 8.0% to 124.7% longer to resolve in the majority of projects studied.
Conclusion and Future Work
The study demonstrates that MPLCs are a significant source of complexity and risk in polyglot software development. While they represent a small fraction of total commits, their impact on maintenance and quality is disproportionately high.
The authors highlight two major avenues for future research:
- Causality: Determining whether the multi-language nature itself causes bugs, or if complex features simply necessitate multiple languages.
- Tooling: Addressing the dire need for cross-language static analysis tools. Current tools often stop at language boundaries, leaving the "glue code" between languages—such as foreign function interfaces—as a primary source of undetected defects.
Summary updated