Skip to main content
Log in

Predicting object-oriented class reuse-proneness using internal quality attributes

  • Published:
Empirical Software Engineering Aims and scope Submit manuscript

Abstract

Class reuse-proneness is the likelihood that a class can be reused and is a key quality characteristic in object-oriented design. Because it is clearly impossible to know with certainty when, where, how, and how often a class will be reused, this likelihood can only be estimated when a class is developed. At that stage, the internal quality attributes of a class such as cohesion, coupling, and size can be measured. In this paper, we empirically study the ability of 29 internal class quality measures, individually and in combination, to estimate class reuse-proneness. Specifically, we take into account both class inheritance and class instantiation, which are two ways in which a class can be reused. Our results show that most of the considered measures are predictors for the considered reuse-proneness attributes to some degree. The capability of the considered internal quality measures to predict class reuse-proneness is enhanced when the measures are combined using an optimized multivariate statistical model. The results also show that the size and coupling attributes of a class have positive impacts on its reuse-proneness via inheritance and instantiation. The cohesion of a class has a negative impact on its inheritance reuse-proneness and a positive impact on its instantiation reuse-proneness. The overall results of the empirical study show that software developers can use a number of predictors to assess the reuse-proneness of classes and possibly improve the reuse-proneness of the classes by controlling their internal quality attributes. Our results contribute to the evaluation of the quality of a class, but a comprehensive evaluation of the quality of a class should take into account many more qualities. Also, not all classes in a software system are built with reuse-proneness in mind, so our results should be applied only to those that are designed and implemented to be reusable.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1

Similar content being viewed by others

References

  • Abreu F, Carapuça R (1994) Candidate metrics for object-oriented software within a taxonomy framework. J Syst Softw 26(1):87–96

    Article  Google Scholar 

  • Aggarwal K, Singh Y, Kaur A, Malhotra R (2005) Software reuse metrics for object-oriented systems. Proceedings of the Third ACIS Int‘l Conference on Software Engineering Research, Management and Applications, USA, pp 48–55

    Google Scholar 

  • Al Dallal J (2007) A design-based cohesion metric for object-oriented classes. Int J Comput Sci Eng 1(3):195–200

    Google Scholar 

  • Al Dallal J (2009) Software similarity-based functional cohesion metric. IET Softw 3(1):46–57

    Article  Google Scholar 

  • Al Dallal J (2010) Mathematical validation of object-oriented class cohesion metrics. Int J Comput 4(2):45–52

    Google Scholar 

  • Al Dallal J (2011a) Improving the applicability of object-oriented class cohesion metrics. Inf Softw Technol 53(9):914–928

    Article  Google Scholar 

  • Al Dallal J (2011b) Measuring the discriminative power of object-oriented class cohesion metrics. IEEE Trans Softw Eng 37(6):788–804

    Article  Google Scholar 

  • Al Dallal J (2012a) The impact of accounting for special methods in the measurement of object-oriented class cohesion on refactoring and fault prediction activities. J Syst Softw 85(5):1042–1057

    Article  Google Scholar 

  • Al Dallal J (2012b) Fault prediction and the discriminative powers of connectivity-based object-oriented class cohesion metrics. Inf Softw Technol 54(4):396–416

    Article  Google Scholar 

  • Al Dallal J (2012c) Incorporating transitive relations in low-level design-based class cohesion measurement. Softw—Pract Experience. doi:10.1002/spe.2127

  • Al Dallal J, Briand L (2010) An object-oriented high-level design-based class cohesion metric. Inf Softw Technol 52(12):1346–1361

    Article  Google Scholar 

  • Al Dallal J, Briand L (2012) A Precise method-method interaction-based cohesion metric for object-oriented classes. ACM Trans Softw Eng Methodol (TOSEM) 21(2):8:1–8:34

    Article  Google Scholar 

  • Bacchelli A, Lanza M, and Robbes R (2010) Linking e-mails and source code artifacts, Proceedings of the 32nd ACM/IEEE International Conference on Software EngineeringVolume 1, ICSE 2010, Cape Town, South Africa pp. 375–384

  • Badri L, Badri M (2004) A Proposal of a new class cohesion criterion: an empirical study. J Object Technol 3(4):145–159

    Article  Google Scholar 

  • Bansiya J, Etzkorn L, Davis C, Li W (1999) A class cohesion metric for object-oriented designs. J Object-Oriented Program 11(8):47–52

    Google Scholar 

  • Barnard J (1998) A new reusability metric for object-oriented software. Softw Qual J 7(1):35–50

    Google Scholar 

  • Bieman J (1991) Deriving measures of software reuse in object oriented systems. Proceedings of the BCS-FACS Workshop on Formal Aspects of Measurement, London, pp 63–83

    Google Scholar 

  • Bieman J and Kang B (1995) Cohesion and reuse in an object-oriented system, Proceedings of the 1995 Symposium on Software reusability, Seattle, Washington, United States pp. 259–262

  • Bieman J, Kang B (1998) Measuring design-level cohesion. IEEE Trans Softw Eng 24(2):111–124

    Article  Google Scholar 

  • Bieman J, Ott L (1994) Measuring functional cohesion. IEEE Trans Softw Eng 20(8):644–657

    Article  Google Scholar 

  • Bonja C, Kidanmariam E (2006) Metrics for class cohesion and similarity between methods. Proceedings of the 44th Annual ACM Southeast Regional Conference, Melbourne, pp 91–95

    Google Scholar 

  • Briand L, Morasca S, Basili V (1996) Property-based software engineering measurement. IEEE Trans Softw Eng 22(1):68–86

    Article  Google Scholar 

  • Briand L, Devanbu P, Melo W (1997) An investigation into coupling measures for C++. Proceedings of the 19th International Conference on Software Engineering Boston, Massachusetts, pp 412–421

    Google Scholar 

  • Briand LC, Daly J, Wuest J (1998) A unified framework for cohesion measurement in object-oriented systems. Empir Softw Eng—An Int J 3(1):65–117

    Article  Google Scholar 

  • Briand LC, Daly J, Wuest J (1999a) A unified framework for coupling measurement in object-oriented systems. IEEE Trans Softw Eng 25(1):91–121

    Article  Google Scholar 

  • Briand LC, Morasca S, Basili VR (1999b) Defining and validating measures for object-based high-level design. IEEE Trans Softw Eng 25(5):722–743

    Article  Google Scholar 

  • Briand LC, Wüst J, Lounis H (2001) Replicated case studies for investigating quality factors in object-oriented designs. Empir Softw Eng 6(1):11–58

    Article  MATH  Google Scholar 

  • Chae HS, Kwon YR, Bae D (2004) Improving cohesion metrics for classes by considering dependent instance variables. IEEE Trans Softw Eng 30(11):826–832

    Article  Google Scholar 

  • Chen Z, Zhou Y, Xu B (2002) A novel approach to measuring class cohesion based on dependence analysis. Proceedings of the International Conference on Software Maintenance, Montreal, pp 377–384

    Google Scholar 

  • Chidamber SR, Kemerer CF (1991) Towards a metrics suite for Object-Oriented Design, Object-Oriented Programming Systems, Languages and Applications (OOPSLA). Spec Issue SIGPLAN Not 26(10):197–211

    Article  Google Scholar 

  • Chidamber SR, Kemerer CF (1994) A Metrics suite for object Oriented Design. IEEE Trans Softw Eng 20(6):476–493

    Article  Google Scholar 

  • Counsell S, Swift S, Crampton J (2006) The interpretation and utility of three cohesion metrics for object-oriented design. ACM Trans Softw Eng Methodol (TOSEM) 15(2):123–149

    Article  Google Scholar 

  • Emerson T (1984) A discriminant metrics for module cohesion, In Proceedings of the 7th International Conference on Software Engineering. Silver Spring, MD, pp 294–303

    Google Scholar 

  • Etzkorn L, Gholston S, Fortune J, Stein C, Utley D, Farrington P, Cox G (2004) A comparison of cohesion metrics for object-oriented systems. Inf Softw Technol 46(10):677–687

    Article  Google Scholar 

  • Fayed M and Laitinen M (1998) Transition to Object-Oriented Software Development, John Wiley & Sons, 1st edition

  • Fenton N and Pfleeger S (1997) Software Metrics A Rigorous & Practical Approach, ITP, 2nd edition

  • Fernández L, Peña R (2006) A sensitive metric of class cohesion. Int J Inf Theor Appl 13(1):82–91

    Google Scholar 

  • FreeMind (December 2011) http://freemind.sourceforge.net/, accessed

  • GanttProject (December 2011) http://sourceforge.net/projects/ganttproject/, accessed

  • Gui G, Scott PD (2009) Measuring software component reusability by coupling and cohesion metrics. J Comput 4(9):797–805

    Article  Google Scholar 

  • Henderson-sellers B (1996) Object-Oriented Metrics Measures of Complexity, Prentice-Hall

  • Hitz M, Montazeri B (1995) Measuring coupling and cohesion in object oriented systems. Proceedings of the International Symposium on Applied Corporate Computing, Mexico, pp 25–27

    Google Scholar 

  • Hosmer D and Lemeshow S (2000) Applied Logistic Regression, John Wiley and Sons

  • Illusion (December 2011) http://sourceforge.net/projects/aoi/, accessed

  • JabRef (December 2011) http://sourceforge.net/projects/jabref/, accessed

  • JHotDraw (December 2011) http://sourceforge.net/projects/jhotdraw/, accessed

  • Johnson R, Foote B (1988) Designing reusable classes. J Object-Oriented Program 1(2):22–35

    Google Scholar 

  • Karlsson E (1995) Software reuse—a holistic approach. JohnWiley & Sons, England

    Google Scholar 

  • Karunanithi S, Bieman J (1993) Candidate reuse metrics for object oriented and Ada software. Proceedings of IEEE International Software Metrics Symposium, Baltimore

    Google Scholar 

  • Krantz D, Luce R, Suppes P, Tversky A (1971) Foundations of measurement, Vol. 1, vol 1. Academic, San Diego

    Google Scholar 

  • Lakhotia A (1993) Rule-based approach to computing module cohesion. Proceedings of the 15th international conference on Software Engineering, Baltimore, pp 35–44

    Google Scholar 

  • Lavazza L, Morasca S, Taibi D, and Tosi D (2012) An empirical investigation of perceived reliability of open source java programs, Proceedings of the27th Symposium On Applied Computing, SAC’12, Italy

  • Lee Y, Chang K (2000) Reusability and maintainability metrics for object-oriented software. Proceedings of the 38th annual on Southeast regional conference, USA

    Google Scholar 

  • Lee Y, Liang B, Wu S, and Wang F (1995) Measuring the coupling and cohesion of an object-oriented program based on information flow. In Proceedings of International Conference on Software Quality, Maribor, Slovenia. pp. 81–90

  • Li W, Henry SM (1993) Object-oriented metrics that predict maintainability. J Syst Softw 23(2):111–122

    Article  Google Scholar 

  • Marcus A, Poshyvanyk D, Ferenc R (2008) Using the conceptual cohesion of classes for fault prediction in object-oriented systems. IEEE Trans Softw Eng 34(2):287–300

    Article  Google Scholar 

  • Meyers T, Binkley D (2007) An empirical study of slice-based cohesion and coupling metrics. ACM Trans Softw Eng Methodol 17(1):2–27

    Article  Google Scholar 

  • Mockus A, Fielding R, Herbsleb J (2002) Two case studies of open source software development: apache and Mozilla. ACM Trans Softw Eng Methodol 11(3):309–346

    Article  Google Scholar 

  • Morasca S (2004) On the definition and use of aggregate indices for nominal, ordinal, and other scales, 10th IEEE International Software Metrics Symposium (METRICS 2004), Chicago, IL, USA pp. 46–57

  • Morasca S (2008) Refining the axiomatic definition of internal software attributes, Proceedings of the 2nd ACM-IEEE International Symposium on Empirical Software Engineering and Measurement. Kaiserslautern, Germany, pp 188–197

    Google Scholar 

  • Morasca S (2009) A probability-based approach for measuring external attributes of software artifacts. Proceedings of the 3rd International Symposium on Empirical Software Engineering and Measurement, USA, pp 44–55

    Google Scholar 

  • Morasca S, Ruhe G (2000) A hybrid approach to analyze empirical software engineering data and its application to predict module fault-proneness in maintenance. J Syst Softw 53(3):225–237

    Article  Google Scholar 

  • Openbravo (December 2011) http://sourceforge.net/projects/openbravopos, accessed

  • Ott L, Thuss J (1993) Slice based metrics for estimating cohesion. Proceedings of the First International Software Metrics Symposium, Baltimore, pp 71–81

    Google Scholar 

  • Roberts F (1979) Measurement theory with applications to decisionmaking, utility, and the social sciences, Encyclopedia of Mathematics and its Applications, Vol. 7, Addison-Wesley

  • R-project (December 2011) http://www.r-project.org, accessed

  • Samoladas I, Bibi S, Stamelos I, Bleris GL (2003) Exploring the quality of free/open-source software: A case study on an ERP/CRM system. 9th Panhellenic Conference in Informatics, Thessaloniki

    Google Scholar 

  • Samoladas I, Gousios G, Spinellis D, Stamelos I (2008) The SQO-OSS quality model: measurement based open-source software evaluation. Open Source Dev Communities Qual 275:237–248

    Article  Google Scholar 

  • Spinellis D, Gousios G, Karakoidas V, Louridas P, Adams PJ, Samoladas I, Stamelos I (2009) Evaluating the quality of open source software. Electron Notes Theor Comput Sci 233:5–28

    Article  Google Scholar 

  • Tempero E, Biddle R (1996) Modelling the checkability of reusable code, Technical Report CS-TR-96-20. Victoria University of Wellington, New Zealand

    Google Scholar 

  • Troy D, Zweben S (1981) Measuring the quality of structured designs. J Syst Softw 2:113–120

    Article  Google Scholar 

  • Wang J, Zhou Y, Wen L, Chen Y, Lu H, Xu B (2005) DMC: a more precise cohesion measure for classes. Inf Softw Technol 47(3):167–180

    Article  Google Scholar 

  • Weyuker E (1988) Evaluating software complexity measures. IEEE Trans Softw Eng 14(9):1357–1365

    Article  MathSciNet  Google Scholar 

  • Xu B, Zhou Y (2001) Comments on ‘A cohesion measure for object-oriented classes’ by H. S. Chae, Y. R. Kwon and D. H. Bae (Softw. Pract. Exper. 2000, 30: 1405–1431). Softw—Pract Experience 31(14):1381–1388

    Article  Google Scholar 

  • Xu B, Zhou Y (2003) More comments on ‘A cohesion measure for object-oriented classes’ by H. S. Chae, Y. R. Kwon and D. H. Bae (Softw. Pract. Exper. 2000, 30: 1405–1431). Softw—Pract Experience 33(6):583–588

    Article  MATH  Google Scholar 

  • Yang X (2002) Research on Class Cohesion Measures, M.S. Thesis, Department of Computer Science and Engineering, Southeast University

  • Yourdon E, Constantine L (1979) Structured design. Prentice-Hall, Englewood Cliffs

    MATH  Google Scholar 

  • Zhou Y, Xu B, Zhao J, Yang H (2002) ICBMC: an improved cohesion measure for classes. Proc. of International Conference on Software Maintenance, Montréal, pp 44–53

    Google Scholar 

  • Zhou Y, Lu J, Lu H, Xu B (2004) A comparative study of graph theory-based class cohesion measures. ACM SIGSOFT Softw Eng Notes 29(2):13–13

    Article  Google Scholar 

Download references

Acknowledgments

The authors would like to acknowledge the support of this work by Kuwait University Research Grant WI03/11. In addition, the authors would like to thank Anas Abdin for assisting in collecting the required data.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jehad Al Dallal.

Additional information

Communicated by: Massimiliano Di Penta

Appendix A: Depth of Inheritance of Classes

Appendix A: Depth of Inheritance of Classes

Table 27 Reports the descriptive statistics of the depth of inheritance of classes in ten Java open-source systems

Rights and permissions

Reprints and permissions

About this article

Cite this article

Al Dallal, J., Morasca, S. Predicting object-oriented class reuse-proneness using internal quality attributes. Empir Software Eng 19, 775–821 (2014). https://doi.org/10.1007/s10664-012-9239-3

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10664-012-9239-3

Keywords

Navigation