Early Career Developers’ Perceptions of Code Understandability. A Study of Complexity Metrics

12 Pages Posted: 31 Jul 2024

See all articles by Matteo Esposito

Matteo Esposito

University of Rome Tor Vergata

Andrea Janes

Free University of Bozen-Bolzano

Terhi Kilamo

Tampere University

Valentina Lenarduzzi

University of Oulu

Abstract

CONTEXT. Code understandability is fundamental. Developers need to understand the code they are modifying clearly. A low understandability can increase the amount of coding effort, and misinterpreting code impacts the entire development process. Ideally, developers should write clear and understandable code with the least effort.OBECTIVES. Our work investigates whether the McCabe Cyclomatic Complexity or the Cognitive Complexity can be a good predictor for the developers' perceived code understandability to understand which of the two complexities can be used as criteria to evaluate if a piece of code is understandable.METHODS. We designed and conducted an empirical study among 216 early career developers with professional experience ranging from one to four years. We asked them to manually inspect and rate the understandability of 12 Java classes that exhibit different levels of Cyclomatic and Cognitive Complexity.RESULTS. Our findings showed that while the old-fashioned McCabe Cyclomatic Complexity and the most recent Cognitive Complexity are modest predictors for code understandability when considering the complexity perceived by early-career developers, they are not for problem severity.CONCLUSION. Based on our results, early-career developers should not be left alone when performing code-reviewing tasks due to their scarce experience. Moreover, low complexity measures indicate good understandability, but having either CoC or CyC high makes understandability unpredictable. Nevertheless, there is no evidence that CyC or CoC are indicators of early-career perceived severity.Future research efforts will focus on expanding the population to experienced developers to confront whether seniority influences the predictive power of the chosen metrics.

Keywords: Cyclomatic Complexity, Cognitive Complexity, empirical study, Early-Career, Developers, Code Undestendability, Severity

Suggested Citation

Esposito, Matteo and Janes, Andrea and Kilamo, Terhi and Lenarduzzi, Valentina, Early Career Developers’ Perceptions of Code Understandability. A Study of Complexity Metrics. Available at SSRN: https://ssrn.com/abstract=4911949

Matteo Esposito (Contact Author)

University of Rome Tor Vergata ( email )

Via di Tor Vergata
Rome, 00133
Italy

Andrea Janes

Free University of Bozen-Bolzano ( email )

Bozen-Bolzano, 39100
Italy

Terhi Kilamo

Tampere University ( email )

Tampere, FIN-33101
Finland

Valentina Lenarduzzi

University of Oulu ( email )

Do you have a job opening that you would like to promote on SSRN?

Paper statistics

Downloads
16
Abstract Views
63
PlumX Metrics