An empirical study of overriding in open source Java

Ewan D. Tempero, Steve Counsell, James Noble · 2010

Inheritance is a key feature of object-oriented pro-gramming. Overriding is one of the most impor-tant parts of inheritance, allowing a subclass to re-place methods implemented in its superclass. Un-fortunately, 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 mea-sure overriding and present a corpus analysis that uses those metrics to analyse 100 open-source applications, containing over 100,000 separate classes and inter-faces. We found substantial overriding: most sub-classes override at least one method and many classes that only declare overriding methods. We also found questionable uses of overriding, such as removing su-perclass method implementations by overriding them with empty method bodies.

Read the paper · More papers on PaperTik