• DocumentCode
    745316
  • Title

    The optimal class size for object-oriented software

  • Author

    Emam, Khaled El ; Benlarbi, Saida ; Goel, Nishith ; Melo, Walcelio ; Lounis, Hakim ; Rai, Shesh N.

  • Author_Institution
    Inst. for Inf. Technol., Nat. Res. Council of Canada, Ottawa, Ont., Canada
  • Volume
    28
  • Issue
    5
  • fYear
    2002
  • fDate
    5/1/2002 12:00:00 AM
  • Firstpage
    494
  • Lastpage
    509
  • Abstract
    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
  • Keywords
    object-oriented programming; software metrics; software quality; U-shaped curve; object-oriented metrics; object-oriented software; optimal class size; program decomposition; software components; software quality; Java; Performance analysis; Performance evaluation; Size measurement; Software engineering; System testing;
  • fLanguage
    English
  • Journal_Title
    Software Engineering, IEEE Transactions on
  • Publisher
    ieee
  • ISSN
    0098-5589
  • Type

    jour

  • DOI
    10.1109/TSE.2002.1000452
  • Filename
    1000452