On the correlation between testing effort and software complexity metrics

Software complexity metrics, such as code size and cyclomatic complexity, have been used in the software engineering community for predicting quality metrics such as maintainability, bug proneness and robustness. However, not many studies have addressed the relationship between complexity metrics and software testing and there is little experimental evidence to support the use of these code metrics in the estimation of test effort. We have investigated and evaluated the relationship between test effort (i.e, number of test cases and test execution time) and software complexity metrics for industrial control software used in an embedded system. We show how to measure different software complexity metrics such as number of elements, cyclomatic complexity, and information flow for a popular programming language named FBD used in the safety critical domain. In addition, we use test data and test suites created by experienced test engineers working at Bombardier Transportation Sweden AB to evaluate the correlation between several complexity measures and the testing effort. We found that there is a moderate correlation between software complexity metrics and test effort. In addition, the results show that the software size (i.e., number of elements in the FBD program) provides the highest correlation level with the number of test cases created and test execution time. Our results suggest that software size and structure metrics, while useful for identifying parts of the system that are more complicated, should not be solely used for identifying parts of the system for which test engineers might need to create more test cases. A potential explanation of this result concerns the nature of testing, since other attributes such as the level of thorough testing required and the size of the specifications can influence the creation of test cases. In addition, we used a linear regression model to estimate the test effort using the software complexity measurement results.

[1]  C. F. Kossack,et al.  Rank Correlation Methods , 1949 .

[2]  Elaine J. Weyuker,et al.  Evaluating Software Complexity Measures , 2010, IEEE Trans. Software Eng..

[3]  Dennis G. Kafura,et al.  The Use of Software Complexity Metrics in Software Maintenance , 1987, IEEE Transactions on Software Engineering.

[4]  Claude E. Shannon,et al.  Prediction and Entropy of Printed English , 1951 .

[5]  P. Lachenbruch Statistical Power Analysis for the Behavioral Sciences (2nd ed.) , 1989 .

[6]  Dolores R. Wallace,et al.  Structured Testing: A Testing Methodology Using the Cyclomatic Complexity Metric , 1996 .

[7]  William Bolton 1 – Programmable logic controllers , 2006 .

[8]  Alain Abran,et al.  Software Metrics and Software Metrology , 2010 .

[9]  Victor R. Basili,et al.  Software errors and complexity: an empirical investigation0 , 1984, CACM.

[10]  J. Brian Gray,et al.  Introduction to Linear Regression Analysis , 2002, Technometrics.

[11]  Kostas Kevrekidis,et al.  Software complexity and testing effectiveness: An empirical study , 2009, 2009 Annual Reliability and Maintainability Symposium.

[12]  M. Shepperd,et al.  A critique of cyclomatic complexity as a software metric , 1988, Softw. Eng. J..

[13]  Charles W. Butler,et al.  Design complexity measurement and testing , 1989, CACM.

[14]  Michael Tiegelkamp,et al.  IEC 61131-3: Programming Industrial Automation Systems: Concepts and Programming Languages, Requirements for Programming Systems, Decision-Making Aids , 2001 .

[15]  Jacob Cohen Statistical Power Analysis for the Behavioral Sciences , 1969, The SAGE Encyclopedia of Research Design.

[16]  Maurice H. Halstead,et al.  Elements of software science , 1977 .

[17]  Sallie M. Henry,et al.  Software Structure Metrics Based on Information Flow , 1981, IEEE Transactions on Software Engineering.

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

[19]  A. Shiryayev On Tables of Random Numbers , 1993 .

[20]  Tom Mens,et al.  Research trends in structural software complexity , 2016, ArXiv.

[21]  Carma L. McClure,et al.  A model for program complexity analysis , 1978, ICSE '78.

[22]  Mehwish Riaz,et al.  A systematic review of software maintainability prediction and metrics , 2009, ESEM 2009.

[23]  John E. Gaffney,et al.  Estimating the Number of Faults in Code , 1984, IEEE Transactions on Software Engineering.

[24]  Reidar Conradi,et al.  Empirical Methods and Studies in Software Engineering: Experiences from Esernet , 2003 .

[25]  Hareton K. N. Leung,et al.  A cost model to compare regression test strategies , 1991, Proceedings. Conference on Software Maintenance 1991.

[26]  Alexander Serebrenik,et al.  Tailoring complexity metrics for simulink models , 2016, ECSA Workshops.