The optimal class size for object-oriented software

被引:45
作者
El Emam, K
Benlarbi, S
Goel, N
Melo, W
Lounis, H
Rai, SN
机构
[1] Natl Res Council Canada, Inst Informat Technol, Ottawa, ON K1A 0R6, Canada
[2] Alcatel Networks Corp, Carrier Internetworking Div, Kanata, ON K2K 2E6, Canada
[3] Cistel Technol, Nepean, ON K2E 7L5, Canada
[4] Oracle Brazil, BR-70712900 Brasilia, DF, Brazil
[5] CRIM, Montreal, PQ H3A 1B9, Canada
[6] St Jude Childrens Res Hosp, Dept Biostat & Epidemiol, Memphis, TN 38105 USA
关键词
object-oriented metrics; software quality; quality models; quality prediction; software size; optimal size;
D O I
10.1109/TSE.2002.1000452
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
A growing body of literature suggests that there is an optimal size for software components. This means that components that are too small or too big will have a higher defect content (i.e., there is a U-shaped curve relating defect content to size). The U-shaped curve has become known as the "Goldilocks Conjecture." Recently, a cognitive theory has been proposed to explain this phenomenon and it has been expanded to characterize object-oriented software. This conjecture has wide implications for software engineering practice. It suggests 1) that designers should deliberately strive to design classes that are of the optimal size, 2) that program decomposition is harmful. and 3) that there exists a maximum (threshold) class size that should not be exceeded to ensure fewer faults in the software, The purpose of the current paper is to evaluate this conjecture for object-oriented systems. We first demonstrate that the claims of an optimal component/class size (1) above) and of smaller components/classes having a greater defect content (2) above) are due to a mathematical artifact in the analyses performed previously. We then empirically test the threshold effect claims of this conjecture (3) above). To our knowledge, the empirical test of size threshold effects for object-oriented systems has not been performed thus far, We performed an initial study with an industrial C++ system and repeated it twice on another C++ system and on a commercial Java application. Our results provide unambiguous evidence that there is no threshold effect of class size. We obtained the same result for three systems using four different size measures. These findings suggest that there is a simple continuous relationship between class size and faults, and that, optimal class size, smaller classes are better and threshold effects conjectures have no sound theoretical nor empirical basis.
引用
收藏
页码:494 / 509
页数:16
相关论文
共 51 条
[1]  
[Anonymous], P 1 INT SOFTW METR S
[2]  
[Anonymous], IEEE INT S SOFTW MET
[3]  
ARUR L, 1992, RAPID EVOLUTIONARY D
[4]   SOFTWARE ERRORS AND COMPLEXITY - AN EMPIRICAL-INVESTIGATION [J].
BASILI, VR ;
PERRICONE, BT .
COMMUNICATIONS OF THE ACM, 1984, 27 (01) :42-52
[5]  
Belsley D.A., 1980, Regression Diagnostics: Identifying Influential Data and Sources of Collinearity
[6]  
BINKLEY A, 1998, P 20 INT C SOFTW ENG
[7]   MODULE SIZE - A STANDARD OR HEURISTIC [J].
BOWEN, JB .
JOURNAL OF SYSTEMS AND SOFTWARE, 1984, 4 (04) :327-332
[8]  
Breslow N E, 1987, IARC Sci Publ, P1
[9]   Exploring the relationships between design measures and software quality in object-oriented systems [J].
Briand, LC ;
Wüst, J ;
Daly, JW ;
Porter, DV .
JOURNAL OF SYSTEMS AND SOFTWARE, 2000, 51 (03) :245-273
[10]  
Card DN., 1990, MEASURING SOFTWARE D