Copyright © 2002 Elsevier Science Inc. All rights reserved.
A controlled experiment on inheritance depth as a cost factor for code maintenance
Received 24 November 2001;
References and further reading may be available for this article. To view references and further reading you must purchase this article.
Abstract
In two controlled experiments we compare the performance on code maintenance tasks for three equivalent programs with 0, 3, and 5 levels of inheritance. For the given tasks, which focus on understanding effort more than change effort, programs with less inheritance were faster to maintain. Daly et al. previously reported similar experiments on the same question with quite different results. They found that the 5-level program tended to be harder to maintain than the 0-level program, while the 3-level program was significantly easier to maintain than the 0-level program. We describe the design and setup of our experiment, the differences to the previous ones, and the results obtained. Ours and the previous experiments are different in several ways: We used a longer and more complex program, made an inheritance diagram available to the subjects, and added a second kind of maintenance task. When taken together, the previous results plus ours suggest that there is no such thing as usefulness or harmfulness of a certain inheritance depth as such. Code maintenance effort is hardly correlated with inheritance depth, but rather depends on other factors (partly related to inheritance depth). Using statistical modeling, we identify the number of relevant methods to be one such factor. We use it to build an explanation model of average code maintenance effort that is much more powerful than a model relying on inheritance depth.
Author Keywords: Controlled experiment; Inheritance depth; Maintenance; Cost model
Article Outline
- 1. Inheritance and complexity
- 2. Comparison of P
and N
- 3. Description of the experiments
- 3.1. Hypotheses
- 3.2. Subjects and environment
- 3.3. Program used
- 3.4. Experiment design
- 3.5. Tasks and assignments
- 3.6. Procedure and measurements
- 3.7. Threats to internal validity
- 3.8. Threats to external validity
- 4. Results and discussion
- 4.1. Experiment G
- 4.2. Experiment U
- 4.3. Statistical robustness
- 4.4. Subjective experience of subjects
- 4.5. Discussion
- 5. Building explanation models of code maintenance effort
- 5.1. Input variables: properties of programs, tasks, and subjects
- 5.2. Models with two coefficients
- 5.3. Models with three or four coefficients
- 5.4. Discussion
- 6. Conclusion
- 7. Further details
- Acknowledgements
- References
- Vitae







E-mail Article
Add to my Quick Links

Cited By in Scopus (9)






