An empirical study of overriding in open source Java

  • Authors:
  • Ewan Tempero;Steve Counsell;James Noble

  • Affiliations:
  • University of Auckland, Auckland, New Zealand;Brunel University, Uxbridge, United Kingdom;Victoria University of Wellington, Wellington, New Zealand

  • Venue:
  • ACSC '10 Proceedings of the Thirty-Third Australasian Conferenc on Computer Science - Volume 102
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Inheritance is a key feature of object-oriented programming. Overriding is one of the most important parts of inheritance, allowing a subclass to replace methods implemented in its superclass. Unfortunately, the way programmers use overriding in practise is not well understood. We present the first large-scale empirical study of overriding. We describe a suite of metrics that measure overriding and present a corpus analysis that uses those metrics to analyse 100 open-source applications, containing over 100,000 separate classes and interfaces. We found substantial overriding: most subclasses override at least one method and many classes that only declare overriding methods. We also found questionable uses of overriding, such as removing superclass method implementations by overriding them with empty method bodies.