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

  • Authors:
  • Ewan Tempero;James Noble;Hayden Melton

  • Affiliations:
  • Department of Computer Science, University of Auckland, Auckland, New Zealand;School of Mathematics, Statistics, and Computer Science, Victoria University of Wellington, Wellington, New Zealand;Department of Computer Science, University of Auckland, Auckland, New Zealand

  • Venue:
  • ECOOP '08 Proceedings of the 22nd European conference on Object-Oriented Programming
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

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.