The Method Replacement Indicator: A Metric for Analyzing Behavioral Substitution

  • Authors:
  • Reinhard Schauer;Rudolf K. Keller

  • Affiliations:
  • Université de Montréal;Zühlke Engineering AG

  • Venue:
  • ICSM '01 Proceedings of the IEEE International Conference on Software Maintenance (ICSM'01)
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

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 these methods with 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 two industrial systems to investigate the occurrences and causes for method replacements, both at the method and at the class level. We define the method replacement indicator (MRI), which quantifies the extent of method replacements. Based on the data obtained in the analysis, we identify and discuss the causes why programmers replace non-primitive method implementations of reusable classes.