How Do Java Programs Use Inheritance? An Empirical Study of Inheritance in Java Software
Inheritance is a crucial part of object-oriented programming, but its use in practice, and the resulting large-scale inheritance structures in programs, remain poorly understood. Previous studies of inheritance have been relatively small and have generally not considered issues such as Java’s distinction between classes and interfaces, nor have they considered the use of external libraries.
In this paper we present the first substantial empirical study of the large-scale use of inheritance in a contemporary OO programming language. We present a suite of structured metrics for quantifying inheritance in Java programs. We present the results of performing a corpus analysis using those metrics to over 90 applications consisting of over 100,000 separate classes and interfaces. Our analysis finds higher use of inheritance than anticipated, variation in the use of inheritance between interfaces and classes, and differences between inheritance within application types compared with inheritance from external libraries.
KeywordsJava Program Java Application Library Class Standard Library Corpus Analysis
Unable to display preview. Download preview PDF.
- 2.Meyer, B.: Reusability: the case for object-oriented design. IEEE Software, 50–64 (March 1987)Google Scholar
- 3.Snyder, A.: Inheritance and the development of encapsulated software components. In: Research Directions in Object Oriented Programming, pp. 165–188. MIT Press, Cambridge (1987)Google Scholar
- 4.Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison Wesley Publishing Company, One Jacob Way, Reading, Massachusetts 01867 (1994)Google Scholar
- 5.Johnson, R.E., Foote, B.: Designing reusable classes. Journal of Object-Oriented Programming (June/July 1988)Google Scholar
- 6.Rumbaugh, J., Jacobson, I., Booch, G.: Unified Modeling Language Reference Manual, 2nd edn. Addison-Wesley, Reading (2004)Google Scholar
- 10.Chidamber, S.R., Kemerer, C.F.: Towards a metrics suite for object oriented design. In: ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 197–211 (1991)Google Scholar
- 12.Manel, D., Havanas, W.: A study of the impact of C++ on software maintenance. In: International Conference on Software Maintenance, pp. 63–69 (1990)Google Scholar
- 17.Briand, L.C., Daly, J., Porter, V., Wüst, J.K.: A comprehensive empirical validation of design measures for object-oriented systems. In: METRICS 1998: Proceedings of the 5th International Symposium on Software Metrics, pp. 246–257. IEEE Computer Society Press, Los Alamitos (1998)Google Scholar
- 20.Qualitas Research Group: Qualitas corpus (June 2007), http://www.cs.auckland.ac.nz/~ewan/corpus/
- 21.Baxter, G., Frean, M., Noble, J., Rickerby, M., Smith, H., Visser, M., Melton, H., Tempero, E.: Understanding the shape of Java software. In: Cook, W. (ed.) ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, Portland, OR, U.S.A, October 2006, pp. 397–412 (2006)Google Scholar
- 23.Benlarbi, S., Melo, W.L.: Polymorphism measures for early risk prediction. In: ICSE 1999: Proceedings of the 21st international conference on Software engineering, pp. 334–344. IEEE Computer Society Press, Los Alamitos (1999)Google Scholar