A metrics-based comparative study on object-oriented programming languages
Di Wu, Lin Chen, Yuming Zhou et al. · Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering · 2015
There has been a long debate on which programming language can help write better object-oriented programs.However, to date little response is given to this issue with empirical evidence.In this paper, we perform a comparative study on C++, C#, and Java programs by using object-oriented metrics, which comprise measures for class size, complexity, coupling, cohesion, inheritance, encapsulation, polymorphism, and reusability.Our experiment is conducted on 78 tasks in Rosetta Code, a code repository providing solutions to the same programming tasks in different languages.The experimental results show that: (1) C++ classes are significantly larger than C# and Java classes in size, but their complexity does not differ significantly; (2) C# classes are significantly more likely to be coupled than C++ and Java classes through inter-class method invocations instead of direct data access; (3) C# and Java classes tend to be more cohesive than C++ classes; (4) C# and Java significantly outperform C++ in building deep inheritance trees; and (5) programs written in C++, C#, and Java do not show a significant difference in class encapsulation, polymorphism, and reusability.These findings could help practitioners choose suitable languages to develop object-oriented systems. 1
Cited by 11 works. doi:10.18293/seke2015-064 Open-access PDF
Authors
References
- A metrics suite for object oriented design
- Object-oriented metrics: measures of complexity
- Empirical validation of object-oriented metrics on open source software for fault prediction
- An empirical comparison of seven programming languages
- A Unified Framework for Cohesion Measurement in Object-Oriented Systems
- An evaluation of the MOOD set of object-oriented software metrics
- A systematic and comprehensive investigation of methods to build and evaluate fault prediction models
- A unified framework for cohesion measurement in object-oriented systems
- Measuring the Coupling and Cohesion of an Object-Oriented Program Based on Information Flow
- A large scale study of programming languages and code quality in github