Object-oriented programming is about the creation of reusable classes that are to be extended to capture the specific requirements of the application at hand. However, instead of extending the methods of these classes, programmers often introduce subclasses in which they replace methods with new implementations that are completely detached from the superclass; that is, the subclass method does not invoke, directly or indirectly, its counterpart in the superclass. In this paper, we apply the SPOOL environment to the reverse-engineered C++ source code of the ET++ application framework to investigate the occurrences and causes for method replacements. To this end, we define a method replacement indicator (MRI) that quantifies the extent of method replacements. Based on the data obtained in our case study, we identify and discuss the ten causes why programmers replace non-primitive method implementations of reusable classes.
Rudolf K. Keller, Reinhard Schauer