Prioritizing Unit Testing Effort Using Software Metrics and Machine Learning Classifiers (S)

Unit testing plays a crucial role in object-oriented software quality assurance. Unfortunately, software testing is often conducted under severe pressure due to limited resources and tight time constraints. Therefore, testing efforts have to be focused, particularly on critical classes. As a consequence, testers do not usually cover all software classes. Prioritizing unit testing effort is a crucial task. We previously investigated a unit testing prioritization approach based on software information histories. We analyzed different attributes of ten open-source Java software systems tested using the JUnit framework. We used machine learning classifiers (Multivariate Logistic Regression and Naïve Bayes) to obtain, for each system, a set of classes to be tested. The obtained sets of candidate classes have been compared to the sets of classes for which JUnit test cases have been actually developed by testers. The cross system validation (CSV) technique results showed, among others, that the sets of candidate classes suggested by machine learning classifiers properly reflect the testers’ selection. In this paper, we extend our previous work by investigating more classifiers and using leave one system out validation (LOSOV) technique. This LOSOV technique uses a combination of training datasets from different systems. The obtained results indicate that: (1) the new classifiers correctly suggest classes to be tested, and (2) tested classes are particularly well predicted in the case of large-size systems. Key words— Tests Prioritization; Unit Tests; Source Code Metrics; Machine Learning Classifiers.

[1]  Joseph Robert Horgan,et al.  A study of effective regression testing in practice , 1997, Proceedings The Eighth International Symposium on Software Reliability Engineering.

[2]  Victor R. Basili,et al.  A Validation of Object-Oriented Design Metrics as Quality Indicators , 1996, IEEE Trans. Software Eng..

[3]  Man Fai Lau,et al.  Fault-based test suite prioritization for specification-based testing , 2012, Inf. Softw. Technol..

[4]  Mary Lou Soffa,et al.  TimeAware test suite prioritization , 2006, ISSTA '06.

[5]  Ahmed E. Hassan,et al.  Prioritizing the creation of unit tests in legacy software systems , 2011, Softw. Pract. Exp..

[6]  Gregory M. Kapfhammer,et al.  History-Based Test Case Prioritization with Software Version Awareness , 2013, 2013 18th International Conference on Engineering of Complex Computer Systems.

[7]  Brian Henderson-Sellers,et al.  Object-Oriented Metrics , 1995, TOOLS.

[8]  Barry W. Boehm,et al.  Software Defect Reduction Top 10 List , 2001, Computer.

[9]  Mourad Badri,et al.  Exploring Empirically the Relationship between Lack of Cohesion and Testability in Object-Oriented Systems , 2010, FGIT-ASEA.

[10]  Anas N. Al-Rabadi,et al.  A comparison of modified reconstructability analysis and Ashenhurst‐Curtis decomposition of Boolean functions , 2004 .

[11]  Luc Lamontagne,et al.  A metrics suite for JUnit test code: a multiple case study on open source software , 2014, Journal of Software Engineering Research and Development.

[12]  Raed Shatnawi,et al.  A Quantitative Investigation of the Acceptable Risk Levels of Object-Oriented Metrics in Open-Source Systems , 2010, IEEE Transactions on Software Engineering.

[13]  Luc Lamontagne,et al.  Investigating the Prioritization of Unit Testing Effort using Software Metrics , 2017, ENASE.

[14]  Gregg Rothermel,et al.  Selecting a Cost-Effective Test Case Prioritization Technique , 2004, Software Quality Journal.

[15]  Ladan Tahvildari,et al.  A Prioritization Approach for Software Test Cases Based on Bayesian Networks , 2007, FASE.

[16]  Arvinder Kaur,et al.  Empirical analysis for investigating the effect of object-oriented metrics on fault proneness: a replicated case study , 2009 .

[17]  Yuming Zhou,et al.  Empirical Analysis of Object-Oriented Design Metrics for Predicting High and Low Severity Faults , 2006, IEEE Transactions on Software Engineering.

[18]  Mourad Badri,et al.  Empirical Analysis for Investigating the Effect of Control Flow Dependencies on Testability of Classes , 2011, SEKE.

[19]  Adam A. Porter,et al.  A history-based test prioritization technique for regression testing in resource constrained environments , 2002, ICSE '02.

[20]  Mourad Badri,et al.  Empirical Analysis of Object-Oriented Design Metrics for Predicting Unit Testing Effort of Classes , 2012 .

[21]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[22]  Yuming Zhou,et al.  Predicting object-oriented software maintainability using multivariate adaptive regression splines , 2007, J. Syst. Softw..

[23]  K. K. Aggarwal,et al.  A Fuzzy Approach for Integrated Measure of Object-Oriented Software Testability , 2005 .

[24]  Sallie M. Henry,et al.  Object-oriented metrics that predict maintainability , 1993, J. Syst. Softw..

[25]  Anne M. Denton,et al.  A clustering approach to improving test case prioritization: An industrial case study , 2011, 2011 27th IEEE International Conference on Software Maintenance (ICSM).

[26]  Audris Mockus,et al.  Test coverage and post-verification defects: A multiple case study , 2009, ESEM 2009.

[27]  Gregg Rothermel,et al.  Test case prioritization: an empirical study , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[28]  Serge Demeyer,et al.  Establishing Traceability Links between Unit Test Cases and Units under Test , 2009, 2009 13th European Conference on Software Maintenance and Reengineering.

[29]  Durga Prasad Mohapatra,et al.  Prioritizing Program Elements: A Pretesting Effort to Improve Software Quality , 2012 .

[30]  Magiel Bruntink,et al.  Predicting class testability using object-oriented metrics , 2004 .

[31]  Arie van Deursen,et al.  An empirical study into class testability , 2006, J. Syst. Softw..

[32]  Jens H. Weber,et al.  Predicting maintainability with object-oriented metrics -an empirical comparison , 2003, 10th Working Conference on Reverse Engineering, 2003. WCRE 2003. Proceedings..