Two Controlled Experiments Assessing the Usefulness of Design Pattern Documentation in Program Maintenance

Using design patterns is claimed to improve programmer productivity and software quality. Such improvements may manifest both at construction time (in faster and better program design) and at maintenance time (in faster and more accurate program comprehension). The paper focuses on the maintenance context and reports on experimental tests of the following question: does it help the maintainer if the design patterns in the program code are documented explicitly (using source code comments) compared to a well-commented program without explicit reference to design patterns? Subjects performed maintenance tasks on two programs ranging from 360 to 560 LOC including comments. The experiments tested whether pattern comment lines (PCL) help during maintenance if patterns are relevant and sufficient program comments are already present. This question is a challenge for the experimental methodology: A setup leading to relevant results is quite difficult to find. We discuss these issues in detail and suggest a general approach to such situations. A conservative analysis of the results supports the hypothesis that pattern-relevant maintenance tasks were completed faster or with fewer errors if redundant design pattern information was provided. The article provides the first controlled experiment results on design pattern usage and it presents a solution approach to an important class of experiment design problems for experiments regarding documentation.

[1]  Ralph Johnson,et al.  Design patterns: elements of reuseable object-oriented software , 1994 .

[2]  James O. Coplien,et al.  Pattern languages of program design , 1995 .

[3]  N. Pennington Stimulus structures and mental representations in expert comprehension of computer programs , 1987, Cognitive Psychology.

[4]  Ben Shneiderman,et al.  Syntactic/semantic interactions in programmer behavior: A model and experimental results , 1979, International Journal of Computer & Information Sciences.

[5]  Mary Shaw,et al.  Software architecture - perspectives on an emerging discipline , 1996 .

[6]  James Coplien,et al.  Industrial experience with design patterns , 1996, Proceedings of IEEE 18th International Conference on Software Engineering.

[7]  Stanley Letovsky,et al.  Cognitive processes in program comprehension , 1986, J. Syst. Softw..

[8]  Ruven E. Brooks,et al.  Using a behavioral theory of program comprehension in software engineering , 1978, ICSE '78.

[9]  Walter F. Tichy,et al.  Do design patterns improve communication? An experiment with pair design , 2000 .

[10]  Peter Sommerlad,et al.  Pattern-Oriented Software Architecture: A System of Patterns: John Wiley & Sons , 1987 .

[11]  B. F. Castro Buschmann, Frank; Meunier, Regine; Rohnert, Hans; Sommerlad, Peter; Stal, Michael. Pattern-oriented software architecture: a system of patterns, John Wiley & Sons Ltd, 1996 , 1997 .

[12]  Lutz Prechelt,et al.  Replication of the first controlled experiment on the usefulness of design patterns: Detailed description and evaluation , 1997 .

[13]  Alexander L. Wolf,et al.  Acm Sigsoft Software Engineering Notes Vol 17 No 4 Foundations for the Study of Software Architecture , 2022 .

[14]  Ben Shneiderman,et al.  Empirical Studies of Programmers: First Workshop , 1987 .

[15]  William N. Venables,et al.  Modern Applied Statistics with S-Plus. , 1996 .

[16]  Peter Sommerlad,et al.  Pattern-Oriented Software Architecture , 1996 .

[17]  Curtis R. Cook,et al.  An Investigation of Procedure and Variable Names as Beacons During Program Comprehension , 1991 .

[18]  Norman Wilde,et al.  Maintaining object-oriented software , 1993, IEEE Software.

[19]  Elliot Soloway,et al.  Designing documentation to compensate for delocalized plans , 1988, CACM.

[20]  Brian D. Ripley,et al.  Modern Applied Statistics with S-Plus Second edition , 1997 .

[21]  Anneliese Amschler Andrews,et al.  A Coding Scheme to Support Systematic Analysis of Software Comprehension , 1999, IEEE Trans. Software Eng..

[22]  Lutz Prechelt An experiment on the usefulness of design patterns: Detailed description and evaluation , 1997 .

[23]  Ruven E. Brooks,et al.  Towards a Theory of the Comprehension of Computer Programs , 1983, Int. J. Man Mach. Stud..