Doorgaan naar hoofdnavigatie Doorgaan naar zoeken Ga verder naar hoofdinhoud

What does control flow really look like? Eyeballing the cyclomatic complexity metric

  • J.J. Vinju
  • , M.W. Godfrey

Onderzoeksoutput: Hoofdstuk in Boek/Rapport/CongresprocedureConferentiebijdrageAcademicpeer review

3 Downloads (Pure)

Samenvatting

Assessing the understandability of source code remains an elusive yet highly desirable goal for software developers and their managers. While many metrics have been suggested and investigated empirically, the McCabe cyclomatic complexity metric (CC) -- which is based on control flow complexity -- seems to hold enduring fascination within both industry and the research community despite its known limitations. In this work, we introduce the ideas of Control Flow Patterns (CFPs) and Compressed Control Flow Patterns (CCFPs), which eliminate some repetitive structure from control flow graphs in order to emphasize high-entropy graphs. We examine eight well-known open source Java systems by grouping the CFPs of the methods into equivalence classes, and exploring the results. We observed several surprising outcomes: first, the number of unique CFPs is relatively low, second, CC often does not accurately re-flect the intricacies of Java control flow, and third, methods with high CC often have very low entropy, suggesting that they may be relatively easy to understand. These findings challenge the widely-held belief that there is a clear-cut causal relationship between CC and understandability, and suggest that CC and similar measures need to be reconsidered as metrics for code understandability.
Originele taal-2Engels
TitelProceedings of the 12th International Working Conference on Source Code Analysis and Manipulation (SCAM'12), September 23-24, 2012, Riva del Garda, Italy
Plaats van productieBrussels
UitgeverijIEEE Computer Society
Pagina's154-163
ISBN van geprinte versie978-1-4673-2398-7
DOI's
StatusGepubliceerd - 2012
Extern gepubliceerdJa
Evenementconference; 12th International Working Conference on Source Code Analysis and Manipulation; 2012-09-23; 2012-09-24 -
Duur: 23 sep. 201224 sep. 2012

Congres

Congresconference; 12th International Working Conference on Source Code Analysis and Manipulation; 2012-09-23; 2012-09-24
Periode23/09/1224/09/12
Ander12th International Working Conference on Source Code Analysis and Manipulation

Vingerafdruk

Duik in de onderzoeksthema's van 'What does control flow really look like? Eyeballing the cyclomatic complexity metric'. Samen vormen ze een unieke vingerafdruk.

Citeer dit