When do Software Complexity Metrics Mean Nothing? - When Examined out of Context

This paper places its attention on a familiar phenomena: that code metrics such as lines of code are extremely context dependent and their distribution differs from project to project. We apply visual inspection, as well as statistical reasoning and testing, to show that such metric values are so sensitive to context, that their measurement in one project offers little prediction regarding their measurement in another project. On the positive side, we show that context bias can be neutralized, at least for the majority of metrics that we considered, by what we call Log Normal Standardization (LNS). Concretely, the LNS transformation is obtained by shifting (by subtracting the mean) and scaling (by dividing by the standard deviation) of the log of a metric value. Thus, we conclude that the LNS-transformed-, are to be preferred over the plain-, values of metrics, especially in comparing modules from different projects. Conversely, the LNS-transformation suggests that the “context bias” of a software project with respect to a specific metric can be summarized with two numbers: the mean of the logarithm of the metric value, and its standard deviation.

[1]  James M. Bieman,et al.  Software Metrics: A Rigorous and Practical Approach, Third Edition , 2014 .

[2]  Letha H. Etzkorn,et al.  An Empirical Study of the Relationship of Stability Metrics and the QMOOD Quality Models Over Software Developed Using Highly Iterative or Agile Software Processes , 2007, Seventh IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2007).

[3]  Tiago L. Alves,et al.  Deriving metric thresholds from benchmark data , 2010, 2010 IEEE International Conference on Software Maintenance.

[4]  Abraham Lempel,et al.  Compression of individual sequences via variable-rate coding , 1978, IEEE Trans. Inf. Theory.

[5]  Mark Lorenz,et al.  Object-oriented software metrics - a practical guide , 1994 .

[6]  Sang Joon Kim,et al.  A Mathematical Theory of Communication , 2006 .

[7]  Joseph Gil,et al.  Are We Ready for a Safer Construction Environment? , 2009, ECOOP.

[8]  Michael W. Godfrey,et al.  Reading Beside the Lines: Indentation as a Proxy for Complexity Metric , 2008, 2008 16th IEEE International Conference on Program Comprehension.

[9]  Yi Zhang,et al.  Classifying Software Changes: Clean or Buggy? , 2008, IEEE Transactions on Software Engineering.

[10]  Ewan D. Tempero,et al.  Understanding the shape of Java software , 2006, OOPSLA '06.

[11]  Warren A. Harrison,et al.  A complexity measure based on nesting level , 1981, SIGP.

[12]  Harald C. Gall,et al.  Cross-project defect prediction: a large scale experiment on data vs. domain vs. process , 2009, ESEC/SIGSOFT FSE.

[13]  Juan Fernández-Ramil,et al.  A model to predict anti-regressive effort in Open Source Software , 2007, 2007 IEEE International Conference on Software Maintenance.

[14]  Venkata U. B. Challagulla,et al.  Empirical assessment of machine learning based software defect prediction techniques , 2005, 10th IEEE International Workshop on Object-Oriented Real-Time Dependable Systems.

[15]  Dror G. Feitelson,et al.  On the effect of code regularity on comprehension , 2014, ICPC 2014.

[16]  Michele Lanza,et al.  An extensive comparison of bug prediction approaches , 2010, 2010 7th IEEE Working Conference on Mining Software Repositories (MSR 2010).

[17]  Deepak Goyal,et al.  A hierarchical model for object-oriented design quality assessment , 2015 .

[18]  Peter Deutsch,et al.  GZIP file format specification version 4.3 , 1996, RFC.

[19]  Radu Marinescu,et al.  Detection strategies: metrics-based rules for detecting design flaws , 2004, 20th IEEE International Conference on Software Maintenance, 2004. Proceedings..

[20]  Audris Mockus,et al.  How Does Context Affect the Distribution of Software Maintainability Metrics? , 2013, 2013 IEEE International Conference on Software Maintenance.

[21]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[22]  Sunghun Kim,et al.  Reducing Features to Improve Code Change-Based Bug Prediction , 2013, IEEE Transactions on Software Engineering.

[23]  Witold Pedrycz,et al.  A comparative analysis of the efficiency of change metrics and static code attributes for defect prediction , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[24]  Mark C. Paulk,et al.  Capability Maturity Model for Software , 2001 .

[25]  Andreas Zeller,et al.  Mining metrics to predict component failures , 2006, ICSE.

[26]  Charles A. Sutton,et al.  Mining source code repositories at massive scale using language modeling , 2013, 2013 10th Working Conference on Mining Software Repositories (MSR).

[27]  Miguel Goulão,et al.  Toward the Design Quality Evaluation of Object-Oriented Software Systems , 1995 .

[28]  Juan Fernández-Ramil,et al.  Exploring the relationship between cumulative change and complexity in an open source system , 2005, Ninth European Conference on Software Maintenance and Reengineering.

[29]  Nicolas Anquetil,et al.  Software metrics to predict the health of a project?: An assessment in a major IT company , 2015, IWST.

[30]  Donald E. Eastlake,et al.  US Secure Hash Algorithm 1 (SHA1) , 2001, RFC.

[31]  Paul Piwowarski,et al.  A nesting level complexity measure , 1982, SIGP.

[32]  Osamu Mizuno,et al.  An extension of fault-prone filtering using precise training and a dynamic threshold , 2008, MSR '08.

[33]  Andreas Zeller,et al.  When do changes induce fixes? , 2005, ACM SIGSOFT Softw. Eng. Notes.

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

[35]  Kevin P. Grant,et al.  Project management maturity: an assessment of project management capabilities among and between selected industries , 2006, IEEE Transactions on Engineering Management.