How Do Java Programs Use Inheritance? An Empirical Study of Inheritance in Java Software

  • Ewan Tempero
  • James Noble
  • Hayden Melton
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5142)

Abstract

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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Taivalsaari, A.: On the notion of inheritance. Comp. Surv. 28(3), 438–479 (1996)CrossRefGoogle Scholar
  2. 2.
    Meyer, B.: Reusability: the case for object-oriented design. IEEE Software, 50–64 (March 1987)Google Scholar
  3. 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. 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. 5.
    Johnson, R.E., Foote, B.: Designing reusable classes. Journal of Object-Oriented Programming (June/July 1988)Google Scholar
  6. 6.
    Rumbaugh, J., Jacobson, I., Booch, G.: Unified Modeling Language Reference Manual, 2nd edn. Addison-Wesley, Reading (2004)Google Scholar
  7. 7.
    Daly, J., Brooks, A., Miller, J., Roper, M., Wood, M.: Evaluating inheritance depth on the maintainability of object-oriented software. Empirical Software Engineering 1(2), 109–132 (1996)CrossRefGoogle Scholar
  8. 8.
    Cartwright, M.: An empirical view of inheritance. Information and Software Technology 40, 795–799 (1998)CrossRefGoogle Scholar
  9. 9.
    Harrison, R., Counsell, S., Nithi, R.: Experimental assessment of the effect of inheritance on the maintainability of object-oriented systems. Journal of Systems and Software 52, 173–179 (2000)CrossRefGoogle Scholar
  10. 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
  11. 11.
    Chidamber, S.R., Kemerer, C.F.: A metrics suite for object oriented design. IEEE Trans. Softw. Eng. 20(6), 476–493 (1994)CrossRefGoogle Scholar
  12. 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
  13. 13.
    Succi, G., Pedrycz, W., Djokic, S., Zuliani, P., Russo, B.: An empirical exploration of the distributions of the Chidamber and Kemerer object-oriented metrics suite. Empirical Softw. Engg. 10(1), 81–104 (2005)CrossRefGoogle Scholar
  14. 14.
    Collberg, C., Myles, G., Stepp, M.: An empirical study of Java bytecode programs. Softw. Pract. Exper. 37(6), 581–641 (2007)CrossRefGoogle Scholar
  15. 15.
    Chidamber, S., Darcy, D., Kemerer, C.: Managerial use of metrics for object-oriented software: an exploratory analysis. IEEE Trans. Software Engineering 24(8), 629–639 (1998)CrossRefGoogle Scholar
  16. 16.
    Basili, V.R., Briand, L.C., Melo, W.L.: A validation of object-oriented design metrics as quality indicators. IEEE Trans. Softw. Eng. 22(10), 751–761 (1996)CrossRefGoogle Scholar
  17. 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
  18. 18.
    Kitchenham, B., Pfleeger, S.L., Fenton, N.: Towards a framework for software measurement validation. IEEE Trans. Softw. Eng. 21(12), 929–944 (1995)CrossRefGoogle Scholar
  19. 19.
    Melton, H., Tempero, E.: An empirical study of cycles among classes in Java. Empirical Software Engineering 12(4), 389–415 (2007)CrossRefGoogle Scholar
  20. 20.
    Qualitas Research Group: Qualitas corpus (June 2007), http://www.cs.auckland.ac.nz/~ewan/corpus/
  21. 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
  22. 22.
    Potanin, A., Noble, J., Frean, M., Biddle, R.: Scale-free geometry in OO programs. Commun. ACM 48(5), 99–103 (2005)CrossRefGoogle Scholar
  23. 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
  24. 24.
    Steimann, F., Mayer, P.: Patterns of interface-based programming. Journal of Object Technology 4(5), 75–94 (2005), http://www.jot.fm/issues/issue_2005_07/article1 Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Ewan Tempero
    • 1
  • James Noble
    • 2
  • Hayden Melton
    • 1
  1. 1.Department of Computer ScienceUniversity of AucklandAucklandNew Zealand
  2. 2.School of Mathematics, Statistics, and Computer ScienceVictoria University of WellingtonWellingtonNew Zealand

Personalised recommendations