Measuring the Psychological Complexity of Software Maintenance Tasks with the Halstead and McCabe Metrics

Three software complexity measures (Halstead's E, McCabe's u(G), and the length as measured by number of statements) were compared to programmer performance on two software maintenance tasks. In an experiment on understanding, length and u(G) correlated with the percent of statements correctly recalled. In an experiment on modification, most significant correlations were obtained with metrics computed on modified rather than unmodified code. All three metrics correlated with both the accuracy of the modification and the time to completion. Relationships in both experiments occurred primarily in unstructured rather than structured code, and in code with no comments. The metrics were also most predictive of performance for less experienced programmers. Thus, these metrics appear to assess psychological complexity primarily where programming practices do not provide assistance in understanding the code.

[1]  M. H. Halstead,et al.  Natural laws controlling algorithm structure? , 1972, SIGP.

[2]  Ben Shneiderman,et al.  Measuring Computer Program Quality and Comprehension , 1977, Int. J. Man Mach. Stud..

[3]  M. H. Halstead,et al.  Using the Methodology of Natural Science to Understand Software , 1975 .

[4]  M. H. Halstead An experimental determination of the "purity" of a trivial algorithm , 1973, PERV.

[5]  S. B. Sheppard,et al.  Testing Influences on Human Understanding of Software , 1977 .

[6]  Tom Love,et al.  A Review and Evaluation of Software Science , 1978, CSUR.

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

[8]  James L. Elshoff,et al.  Measuring commercial PL/I programs using Halstead's criteria , 1976, SIGP.

[9]  Sylvia B Sheppard,et al.  A Preliminary Experiment to Test Influences on Human Understanding of Software. , 1977 .

[10]  Ronald David Gordon A measure of mental effort related to program clarity. , 1977 .

[11]  Maurice H. Halstead,et al.  A Software Physics Analysis of Akiyama's Debugging Data , 1975 .

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

[13]  E. E. Grant,et al.  Exploratory experimental studies comparing online and offline programming performance , 1968, CACM.

[14]  Edsger W. Dijkstra,et al.  Notes on structured programming , 1970 .

[15]  R. Kirk Experimental Design: Procedures for the Behavioral Sciences , 1970 .

[16]  Karl J. Ottenstein A Program to Count Operators and Operands for ANSI—FORTRAN Modules , 1976 .

[17]  Shmuel Winograd,et al.  Complexity Of Computations , 1978, ACM Annual Conference.

[18]  Earl Chrysler,et al.  Some basic determinants of computer programming productivity , 1978, CACM.

[19]  James M. Sakoda Structured programming in Fortran , 1974, SSOC.

[20]  Maurice H. Halstead,et al.  An experiment comparing Fortran programming times with the software physics hypothesis , 1899, AFIPS '76.

[21]  Linda M. Ottenstein,et al.  Predicting the Number of Bugs Expected in a Program Module , 1976 .