What programmers do with inheritance in java

  • Authors:
  • Ewan Tempero;Hong Yul Yang;James Noble

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

  • Venue:
  • ECOOP'13 Proceedings of the 27th European conference on Object-Oriented Programming
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Inheritance is a distinguishing feature of object-oriented programming languages, but its application in practice remains poorly understood. Programmers employ inheritance for a number of different purposes: to provide subtyping, to reuse code, to allow subclasses to customise superclasses' behaviour, or just to categorise objects. We present an empirical study of 93 open-source Java software systems consisting over over 200,000 classes and interfaces, supplemented by longitudinal analyses of 43 versions of two systems. Our analysis finds inheritance is used for two main reasons: to support subtyping and to permit what we call external code reuse. This is the first empirical study to indicate what programmers do with inheritance.