Nowadays, most software use multiple programming languages to implement certain functionalities based on the strengths and weaknesses of different languages. Researchers in the past have studied the impact of independent programming languages on software quality, however, there has been little or no research on the impact of multiple languages on the quality of software. Does the use of multiple languages cause more bugs? Are certain languages when used with other languages make software more bug prone? What are the relationships between multi-language usage and various bug categories?
In this study, we perform a large scale empirical investigation to provide some answers to these questions. We gather a large dataset consisting of popular projects from GitHub (628 projects, 85 million SLOC, 134 thousand authors, 3 million commits, in 17 languages) to understand the impact of using multiple languages on software quality. We build multiple regression models to study the effects of using different languages on the number of bug fixing commits while controlling for factors such as project age, project size, team size, and the number of commits. Our results show that in general implementing a project with more languages has a significant effect on project quality, as it increases defect proneness. Moreover, we find specific languages that are statistically significantly more defect prone when they are used in a multi-language setting. These include popular languages like C++, Objective-C, and Java. Furthermore, we note that the use of more languages significantly increases bug proneness across all bug categories. The effect is strongest for memory, concurrency, and algorithm bugs.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
A Large Scale Study of Multiple Programming Languages and Code Quality
1. A Large Scale Study of
Multiple Programming Languages
and Code Quality
Pavneet S. Kochhar, Dinusha Wijedasa, and David Lo
Singapore Management University
{kochharps.2012,dwijedasa,davidlo}@smu.edu.sg
International Conference on Software Analysis, Evolution and
Reengineering (SANER 2016)
2. Motivation
• Over 700 languages1 available
• Developers often use multiple languages
– To improve performance, productivity and agility
– Linux OS kernel mainly written in C
Utilities & app. written in C++, Perl, Python
• Concerns
– Increase in complexity
– Proper interfaces between languages
1. https://en.wikipedia.org/wiki/List_of_programming_languages
2
3. Study Goal
3
What is the impact of the usage of
multiple languages
on bug proneness?
4. Outline
• Study Goal
• Empirical Study Methodology
– Data Collection and Basic Statistics
– Categorizing Bugs
– Statistical Methods
• Research Questions
• Findings
• Conclusion and Future Work
4
5. Data Collection
• We collect projects hosted on
• Most popular projects in 17 languages
– C, C++, C#, Objective-C, Go, Java, JavaScript,
CoffeeScript, TypeScript, Ruby, Php, Python, Perl,
Clojure, Erlang, Haskell, Scala
• In total, we have 628 popular projects
– Linux, Redis, Php-src, Elasticsearch
– 85M SLOC, 134K developers, 3.17M commits
5
6. Basic Statistics
6
Distribution of GitHub Projects w.r.t Number of
Language Usage
Language Usage Number of
Projects
% of Projects
Written in a single
language
297 47.29%
Written in multiple
languages
331 52.71%
Total – 628 projects
7. Basic Statistics
7
Project Details
Primary
Language
Number
of
Projects
Number of
Associated
Languages
Number of
Developers
SLOC
(KLOC)
Period
C 104 9 25,203 17,350 4/1999 - 10/2015
C++ 94 12 6,855 14,179 7/2000 - 10/2015
C# 46 8 4,818 8,848 6/2001 - 10/2015
Objective-C 38 4 2,319 378 7/2008 - 10/2015
Go 41 10 6,297 4,013 3/2008 - 10/2015
8. Basic Statistics
8
Evolution History Details
Primary
Language
Total Commits BugFix Commits
Number of
Commits
Code Churn
(KLOC)
Bug Fixes Code Churn
(KLOC)
C 780,153 229,411 258,822 42,736
C++ 284,331 250,238 112,591 63,881
C# 235,048 138,719 69,974 15,786
Objective-C 30,048 16,617 7,561 1,031
Go 117,282 33,134 32,371 4,486
9. Categorizing Bugs
• Categorize each bug fix commit – cause
and impact
• Keyword matching
– 10% of bug fix commits (926,789)
– Semi-automated ways (Keywords & manual)
• Supervised classification
– To classify remaining 90% of the commits
– Randomly selected 270 commits & manually
classified to check precision & recall.
9
10. Statistical Method
• Negative Binomial Regression (NBR)
• To handle multi-collinearity, we compute
variance inflation factors (VIFs)
• Dependent variable - Number of bug fix
commits
• Control variables - age, size (LOC), number
of developers and total number of commits.
10
11. Outline
• Study Goal
• Empirical Study Methodology
–Data Collection and Basic Statistics
–Categorizing Bugs
–Statistical Methods
• Research Questions
• Findings
• Conclusion and Future Work
11
12. Research Questions
12
RQ1: Does the use of more languages correlate with
higher bug proneness?
RQ2: Are some languages more bug prone when
they are used with other languages?
RQ3: What are the relationships between multi-
language usage and bugs of various
categories?
18. 18
Six languages C++, Objective-C,
Java, TypeScript, Clojure, and Scala
are more defect prone when they are
used with other languages.
RQ2: Multi-Language Setting
21. 21
Number of languages has a
positive and significant impact on
the number of bug fixing commits
for all categories of bugs – highest
for memory, concurrency and
algorithm bugs.
RQ3: Bug Categories
22. Threats to Validity
22
• Construct Validity
• Bug fix commits as a proxy of bug proneness
instead of issue reports.
• Semi-automated way to classify bug into its
cause & impact categories.
• Internal Validity
• Use of CLOC tool to compute lines of code.
• Don’t consider complexity of applications.
• External Validity
• Only projects on GitHub.
23. Conclusion
23
• Increasing the number of languages to implement a
project, significantly increases bug proneness.
• Six languages C++, Objective-C, Java,
TypeScript, Clojure, and Scala are significantly
defect prone when used with other languages.
• The impact of the number of languages to cause
higher bug proneness is significantly observed in all
bug categories.
• Higher impact in memory, concurrency and
algorithm categories.
24. Future Work
• Identify language pairs that are less
compatible and more bug prone.
• Identify the types of bugs that affect multi-
language programs.
• Expand the study beyond 17 programming
languages.
24
26. Appendix (Basic Statistics)
26
Other Languages Used with each Primary
Language
Primary
Language
Languages Used with the Primary Language
C Java, C++, Ruby, PHP, Python, Javascript, Perl, Objective-C, TypeScript
C++ Javascript, C, Java, Objective-C, Python, Ruby, CoffeeScript, PHP, Perl, Haskell,
C#, TypeScript
C# C++, C, Javascript, Ruby, Perl, Python, Objective-C, Java
Objective-C Python, Javascript, C, Ruby
Go C++, TypeScript, Javascript, Ruby, C, Python, Perl, Java, PHP, Objective-C
27. Appendix
27
Project Details
Primary
Language
#Projects #Associated
Languages
#Developers SLOC
(KLOC)
Period
C 104 9 25,203 17,350 4/1999 to 10/2015
C++ 94 12 6,855 14,179 7/2000 to 10/2015
C# 46 8 4,818 8,848 6/2001 to 10/2015
Objective-C 38 4 2,319 378 7/2008 to 10/2015
Go 41 10 6,297 4,013 3/2008 to 10/2015
Java 84 10 5,456 5,004 3/2006 to 10/2015
CoffeeScript 44 3 3,930 564 12/2009 to 10/2015
JavaScript 245 13 10,536 3,596 3/2006 to 10/2015
TypeScript 42 8 4,941 16,792 5/2002 to 10/2015
Ruby 87 8 24,184 2,991 1/1998 to 10/2015
Php 59 4 12,145 2,959 4/2003 to 10/2015
Python 152 5 11,397 1,864 7/2005 to 10/2015
Perl 38 5 1,482 297 1/2004 to 10/2015
Clojure 46 5 2,171 432 4/2008 to 10/2015
Erlang 36 7 2,429 2,670 5/2001 to 10/2015
Haskell 37 5 4,158 1,053 4/2004 to 10/2015
Scala 42 8 5,698 2,319 2/2003 to 10/2015
Summary 628 134,019 85,309 1/1998 to 10/2015