Re-Evaluating Inheritance Depth on the Maintainability of Object-Oriented Software

John Daly et al. reported on two experiments evaluating the effects of inheritance depth on program maintenance. One experiment, which was performed twice, found that main- tenance was performed significantly quicker for software us ing 3 levels of inheritance, com- pared to equivalent 'flattened' software without inheritan ce (0 levels). A second experiment found that maintenance for software using 5 levels of inheri tance tended to be slower than for equivalent software without inheritance. We report on similar experiments on the same question. Our results clearly contradict those mentioned above: the flattened versions clearly tende d to be superior. We made several crucial changes to the setup. In particular we used a longer a nd more complex program, made an inheritance diagram available to the subjects, and used additional kinds of maintenance tasks. Furthermore, our experiment design compares 0-level, 3-level and 5-level inheritance directly in one experiment. Our results suggest that there is no such thing as usefulness or harmfulness of a certain inheritance depth per se. Maintenance effort depends on other factors partly related to inheri- tance depth. Using a post-hoc analysis, we identify the number of relevant methods to be one such factor.