This Article 
 Bibliographic References 
 Add to: 
A Controlled Experiment in Maintenance Comparing Design Patterns to Simpler Solutions
December 2001 (vol. 27 no. 12)
pp. 1134-1144

Software design patterns package proven solutions to recurring design problems in a form that simplifies reuse. We are seeking empirical evidence whether using design patterns is beneficial. In particular, one may prefer using a design pattern even if the actual design problem is simpler than that solved by the pattern, i.e., if not all of the functionality offered by the pattern is actually required. Our experiment investigates software maintenance scenarios that employ various design patterns and compares designs with patterns to simpler alternatives. The subjects were professional software engineers. In most of our nine maintenance tasks, we found positive effects from using a design pattern: Either its inherent additional flexibility was achieved without requiring more maintenance time or maintenance time was reduced compared to the simpler alternative. In a few cases, we found negative effects: The alternative solution was less error-prone or required less maintenance time. Although most of these effects were expected, a few were surprising: A negative effect occurs although a certain application of the Observer pattern appears to be well justified and a positive effect occurs despite superfluous flexibility (and, hence, complexity) introduced by a certain application of the Decorator pattern. Overall, we conclude that, unless there is a clear reason to prefer the simpler solution, it is probably wise to choose the flexibility provided by the design pattern because unexpected new requirements often appear. We identify several questions for future empirical research.

[1] K. Beck, J.O. Coplien, R. Crocker, L. Dominick, G. Meszaros, F. Paulisch, and J. Vlissides, “Industrial Experience with Design Patterns,” Proc. 18th Int'l Conf. Software Eng., pp. 103–114, Mar. 1996.
[2] F.J. Budinsky, M.A. Finnie, J.M. Vlissides, and P.S. Yu, “Automatic Code Generation from Design Patterns,” IBM Systems J., vol. 35, no. 2, pp. 151–171 1996.
[3] F. Buschmann et al., Pattern-Oriented Software Architecture: A System of Patterns, John Wiley, Chichester, UK, 1996.
[4] L.B. Christensen, Experimental Methodology, sixth ed. Heights, Mass.: Allyn and Bacon, Needham, 1994.
[5] B. Efron and R. Tibshirani, An Introduction to the Bootstrap, Monographs on Statistics and Applied Probability 57. New York, London: Chapman and Hall, 1993.
[6] G. Florijn, M. Meijers, and P. vanWinsen, “Tool Support for Object-Oriented Patterns,” Proc. 11th European Conf. Object-Oriented Programming (ECOOP), M. Aksit, ed., pp. 472–495, June 1997.
[7] E. Gamma et al., Design Patterns: Elements of Object-Oriented Software, Addison-Wesley, Reading, Mass., 1994.
[8] J.C. Knight and N.G. Leveson, "An Experimental Evaluation of the Assumption of Independence in Multiversion Programming," IEEE Trans. Software Eng., Vol. 12, No. 1, 1986, pp. 96-109.
[9] L. Prechelt, “An Experiment on the Usefulness of Design Patterns: Detailed Description and Evaluation,” Technical Report 9/1997, Fakultät für Informatik, Universität Karlsruhe, Germany, June 1997,
[10] L. Prechelt, B. Unger, M. Philippsen, and W.F. Tichy, “Two Controlled Experiments Assessing the Usefulness of Design Pattern Information During Program Maintenance,” to appear in IEEE Trans. Software Eng., /.
[11] L. Prechelt, B. Unger, and D. Schmidt, “Replication of the First Controlled Experiment on the Usefulness of Design Patterns: Detailed Description and Evaluation,” Technical Report wucs-97-34, Washington Univ., Dept. of Computer Science, St. Louis, Mo., Dec. 1997, .

Index Terms:
Controlled experiment, design pattern, design alternatives, maintenance, change effort
L. Prechelt, B. Unger, W.F. Tichy, P. Brössler, L.G. Votta, "A Controlled Experiment in Maintenance Comparing Design Patterns to Simpler Solutions," IEEE Transactions on Software Engineering, vol. 27, no. 12, pp. 1134-1144, Dec. 2001, doi:10.1109/32.988711
Usage of this product signifies your acceptance of the Terms of Use.