Skip to main content
Log in

An in-depth investigation into the relationships between structural metrics and unit testability in object-oriented systems

  • Research Paper
  • Progress of Projects Supported by NSFC
  • Published:
Science China Information Sciences Aims and scope Submit manuscript

Abstract

There is a common belief that structural properties of classes are important factors to determine their unit testability. However, few empirical studies have been conducted to examine the actual impact of structural properties of classes. In this paper, we employ multiple linear regression (MLR) and partial least square regression (PLSR) to investigate the relationships between the metrics measuring structural properties and unit testability of a class. The investigated structural metrics cover five property dimensions, including size, cohesion, coupling, inheritance, and complexity. Our results from open-source software systems show that: (1) most structural metrics are statistically related to unit testability in an expected direction, among which size, complexity, and coupling metrics are the most important predictors; that (2) multivariate regression models based on structural metrics cannot accurately predict unit testability of classes, although they are better able to rank unit testability of classes; that (3) the transition from MLR to PLSR could significantly improve the ability to rank unit testability of classes but cannot improve the ability to predict the unit testing effort of classes.

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.

Similar content being viewed by others

References

  1. Bruntink M, Deursen A. An empirical study into class testability. J Syst Software, 2006, 79: 1219–1232

    Article  Google Scholar 

  2. Binder R V. Design for testability in object-oriented systems. Commun ACM, 1994, 37: 87–101

    Article  Google Scholar 

  3. Baudry B, Traon Y. Measuring design testability of a UML class diagram. Inf Software Technol, 2005, 47: 859–879

    Article  Google Scholar 

  4. Jungmayr S. Improving testability of object-oriented systems. PhD dissertation. der FernUniversität in Hagen, 2003

  5. Jungmayr S. Testability measurement and software dependencies. In: Proceedings of the 12th International Workshop on Software Measurement, Magdeburg, 2002. 179–202

  6. Bruntink M, Deursen A. Predicting class testability using object-oriented metrics. In: Proceedings of the 4th IEEE International Workshop on Source Code Analysis and Manipulation, Chicago, 2004. 136–145

  7. Singh Y, Saha A. A metric-based approach to assess class testability. In: Proceedings of the 9th International Conference Agile Processes in Software Engineering and Extreme Programming, Limerick, 2008. 224–225

  8. Badri L, Badri M, Toure F. Exploring empirically the relationship between lack of cohesion and testability in objectoriented systems. In: Proceedings of International Conference on Advances in Software Engineering, Jeju Island, 2010. 78–92

  9. Badri L, Badri M, Toure F. An empirical analysis of lack of cohesion metrics for predicting testability of classes. Int J Softw Eng Appl, 2011, 2: 69–85

    Google Scholar 

  10. Mouchawrab S, Briand L C, Labiche Y. A measurement framework for object-oriented software testability. J Syst Software, 2005, 47: 979–997

    Google Scholar 

  11. ISO. International Standard ISO/IEC 9126, Information Technology-Software Product Evaluation: Quality Characteristics and Guidelines for Their Use, 1991

  12. Wang H W. Partial Least Square Regression: Method and Applications (in Chinese). Beijing: National Defense Industry Press, 1999

    Google Scholar 

  13. Briand L C, Wüst J, Daly J W, et al. Exploring the relationships between design measures and software quality in object-oriented systems. J Syst Software, 2000, 51: 245–273

    Article  Google Scholar 

  14. Basili V R, Briand L C, Melo W L. A validation of object-oriented design metrics as quality indicators. IEEE Trans Softw Eng, 1996, 22: 751–761

    Article  Google Scholar 

  15. Chidamber S R, Darcy D P, Kemerer C F. Managerial use of metrics for object-oriented software: an exploratory analysis. IEEE Trans Softw Eng, 1998, 24: 629–639

    Article  Google Scholar 

  16. Zhou Y, Leung H, Xu B. Examining the potentially confounding effect of class size on the associations between object-oriented metrics and change-proneness. IEEE Trans Softw Eng, 2009, 35: 607–623

    Article  Google Scholar 

  17. Subramanyan R, Krisnan M S. Empirical analysis of CK metrics for object-oriented design complexity: Implications for software defects. IEEE Trans Softw Eng, 2003, 29: 297–310

    Article  Google Scholar 

  18. Gyimóthy T, Ference R, Siket L. Empirical validation of object-oriented metrics on open source software for fault prediction. IEEE Trans Softw Eng, 2005, 31: 897–910

    Article  Google Scholar 

  19. Koru A G, Tian J. Comparing high-change modules and modules with the highest measurement values in two large-scale open-source products. IEEE Trans Softw Eng, 2005, 31: 625–642

    Article  Google Scholar 

  20. Aman H, Yamasaki K, Yamada H, et al. A proposal of class cohesion metrics using sizes of cohesive parts. In: Welzer T, Yamamoto S, Rozman I, eds. Knowledge-based Software Engineering. Amsterdam: IOS Press, 2002. 102–107

    Google Scholar 

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

    Article  Google Scholar 

  22. Bansiya J, Etzkorn L, Davis C, et al. A class cohesion metric for object-oriented designs. J Object-Oriented Program, 1999, 11: 47–52

    Google Scholar 

  23. Miller B K, Hsia P, Kung D C. Object-oriented architecture measures. In: Proceedings of the 32nd Annual Hawaii International Conference on System Sciences, Hawaii, 1999. 1–18

  24. Benlarbi S, Melo W L. Polymorphism measures for early risk prediction. In: Proceedings of the 21st International Conference on Software Engineering, Los Angeles, 1999. 334–344

  25. Bansiya J, Davis C, Etzkorn L. An entropy-based complexity measure for object-oriented designs. Theory Pract Object Syst, 1999, 5: 111–118

    Article  Google Scholar 

  26. Badri L, Badri M. A proposal of a new class cohesion criterion: An empirical study. J Object Technol, 2004, 3: 145–159

    Article  Google Scholar 

  27. Belsley D, Kuh E, Welsch R. Regression Diagnostics: Identifying Influential Data and Sources of Collinearity. New York: John Wiley and Sons Inc., 1980

    Book  MATH  Google Scholar 

  28. Wold H. Soft modeling: the basic design and some extensions. In: Systems Under Indirect Observation, Vols. I and II. Amsterdam: North-Holland, 1982. 1–54

    Google Scholar 

  29. Wold S, Sjöström M, Eriksson L. PLSR-regression: a basic tool of chemometrics. Chemometrics Intell Lab Syst, 2001, 58: 109–130

    Article  Google Scholar 

  30. Chong I G, Jun C H. Performance of some variable selection methods when multicollinearity is present. Chemometrics Intell Lab Syst, 2005, 78: 103–112

    Article  Google Scholar 

  31. Wold S, Antti H, Lindgren F, et al. Orthogonal signal correction of near-infrared spectra. Chemometrics Intell Lab Syst, 1998, 44: 175–185

    Article  Google Scholar 

  32. Yu H, MacGregor J F. Post processing methods (PLS-CCA): simple alternatives to preprocessing methods (OSC-PLS). Chemometrics Intell Lab Syst, 2004, 73: 199–205

    Article  Google Scholar 

  33. Williams E J. The comparison of regression variables. J R Stat Soc Ser B-Stat Methodol, 1959, 21: 396–399

    MATH  Google Scholar 

  34. Steiger J H. Tests for comparing elements of a correlation matrix. Psychol Bull, 1980, 87: 245–251

    Article  Google Scholar 

  35. Mittas N, Angelis L. Comparing cost prediction models by resampling techniques. J Syst Softw, 2008, 81: 616–632

    Article  Google Scholar 

  36. Lucia A D, Pompella E, Stefanucci S. Assessing effort estimation models for corrective maintenance through empirical studies. Inf Softw Technol, 2005, 47: 3–15

    Article  Google Scholar 

  37. Khoshgoftaar T M, Liu Y, Seliya N. A multiobjective module-order model for software quality enhancement. IEEE Trans Evol Comput, 2004, 8: 593–608

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to BaoWen Xu.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Zhou, Y., Leung, H., Song, Q. et al. An in-depth investigation into the relationships between structural metrics and unit testability in object-oriented systems. Sci. China Inf. Sci. 55, 2800–2815 (2012). https://doi.org/10.1007/s11432-012-4745-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11432-012-4745-x

Keywords

Navigation