Measuring thePsychological Complexity ofSoftware Maintenance TaskswiththeHalstead andMcCabeMetrics

Three software complexity measures (Halstead's E,McCabe's v(G), andthelength asmeasured bynumber ofstatements) werecom- pared toprogrammer performance ontwosoftware maintenance tasks. Inanexperiment onunderstanding, length andv(G)correlated withthe percent ofstatements correctly recalled. Inanexperiment onmodifica- tion, mostsignificant correlations wereobtained withmetrics computed onmodified rather thanunmodified code.Allthree metrics correlated withboththeaccuracy ofthemodification andthetimetocompletion. Relationships inbothexperiments occurred primarily inunstructured rather thanstructured code, andincodewithnocomments. Themet- rics werealso mostpredictive ofperformance forless experienced pro- grammers. Thus, these metrics appear toassess psychological complexity primarily whereprogramming practices donotprovide assistance in understanding thecode. IndexTerms- Commenting, complexity metrics, documentation, Halstead's E,humanfactors insoftware engineering, McCabe's v(G), mnemonic variable names, modemprogramming practices, modifica- tions, software science, structured programming.