Two controlled experiments assessing the usefulness of design pattern documentation in program maintenance

被引:87
作者
Prechelt, L
Unger-Lamprecht, B
Philippsen, M
Tichy, WF
机构
[1] abaXX Technol, D-70174 Stuttgart, Germany
[2] Sd&M, D-63065 Offenbach, Germany
[3] Univ Karlsruhe, Fak Informat, D-76128 Karlsruhe, Germany
关键词
controlled experiment; design pattern; comments; documentation; maintenance;
D O I
10.1109/TSE.2002.1010061
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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). This 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. Both programs contained design patterns. The controlled variable was whether the use of design patterns was documented explicitly or not. The experiments thus tested whether pattern comment lines (PCL) help during maintenance if patterns are relevant and sufficient program comments are already present. It turns out that 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. The experiment was performed with Java by 74 German graduate students and then repeated with C++ by 22 American undergraduate students. 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. Redundant means that the information carried in pattern comments is also available in different form in other comments. The contribution of this article is twofold: It 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.
引用
收藏
页码:595 / 606
页数:12
相关论文
共 30 条
[1]  
[Anonymous], 1996, Pattern-Oriented Software Architecture: A System of Patterns
[2]  
[Anonymous], PATTERN LANGUAGES PR
[3]  
[Anonymous], 1986, ESP 86
[4]  
Beck DJS, 1996, INEC SER, P103, DOI 10.1109/ICSE.1996.493406
[5]   TOWARDS A THEORY OF THE COMPREHENSION OF COMPUTER-PROGRAMS [J].
BROOKS, R .
INTERNATIONAL JOURNAL OF MAN-MACHINE STUDIES, 1983, 18 (06) :543-554
[6]  
BROOKS R, 1978, P 3 INT C SOFTW ENG, P196
[7]  
CHRISTENSEN LB, 1994, EXPT METHODOLOGY
[8]  
Efron B., 1993, INTRO BOOTSTRAP, V1st ed., DOI DOI 10.1201/9780429246593
[9]  
Gamma E., 1995, Design Patterns: Elements of Reusable Object-Oriented Software, V206, P395, DOI 10.1093/carcin/bgs084
[10]  
Gellenbeck E. M., 1991, Empirical Studies of Programmers: Fourth Workshop, P65