An empirical study of class sizes for large Java systems

作者:Zhang Hongyu*; Tan Hee Beng Kuan
来源:14th Asia-Pacific Software Engineering Conference, 2007-12-04 To 2007-12-07.
DOI:10.1109/ASPEC.2007.64

摘要

We perform an empirical study of class sizes (in terms of Lines of Code) on a number of large Java software systems, and discover an interesting pattern - that many classes have only small sizes whereas a few classes have large size. We call this phenomenon the small class phenomenon. Further analysis shows that the class sizes follow the lognormal distribution. Having understood the distribution of class sizes, we then derive a general size estimation model, which reveals the relationship between the size of a large Java system and the number of classes the system has. In this paper, we also show that the adoption of object-orientation is a possible cause of the small class phenomenon. We believe our study reveals the regularity that emerges from large-scale object-oriented software construction, and hope our research can contribute to a deep understanding of computer programming.