arrow
Return

Automatizing Software Cognitive Complexity Reduction

delete2022-01-01
delete7
delete
OA
AI
R
Rubén Saborido *
J
Javier Ferrer
F
Francisco Chicano
E
Enrique Alba
DOI:10.1109/ACCESS.2022.3144743delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Software plays a central role in our life nowadays. We use it almost anywhere, at any time, and for everything: to browse the Internet, to check our emails, and even to access critical services such as health monitoring and banking. Hence, its reliability and general quality is critical. As software increases in complexity, developers spend more time fixing bugs or making code work rather than designing or writing new code. Thus, improving software understandability and maintainability would translate into an economic relief over the total cost of a project. Different cognitive complexity measures have been proposed to quantify the understandability of a piece of code and, therefore, its maintainability. However, the cognitive complexity metric provided by SonarSource and integrated in SonarCloud and SonarQube is quickly spreading in the software industry due to the popularity of these well-known static code tools for evaluating software quality. Despite SonarQube suggests to keep method's cognitive complexity no greater than 15, reducing method's complexity is challenging for a human programmer and there are no approaches to assist developers on this task. We model the cognitive complexity reduction of a method as an optimization problem where the search space contains all sequences of Extract Method refactoring opportunities. We then propose a novel approach that searches for feasible code extractions allowing developers to apply them, all in an automated way. This will allow software developers to make informed decisions while reducing the complexity of their code. We evaluated our approach over 10 open-source software projects and was able to fix 78% of the 1,050 existing cognitive complexity issues reported by SonarQube. We finally discuss the limitations of the proposed approach and provide interesting findings and guidelines for developers.
Keywords:
Complexity theory
Software
Codes
Measurement
Optimization
Open source software
Java
Software quality
software maintenance
optimization
cognitive complexity

Journal

IEEE Access cover
IEEE Access
IF:
3.6
Papers:
9.8W
Citations:
29.4W

Organization

U
universidad de malaga
Scholars:
1.2W
Papers: 9.2K
Citations: 6
Cited Papers

Cited Papers

The Daidzein Metabolite, 6,7,4'-Trihydroxyisoflavone, Is a Novel Inhibitor of PKCα in Suppressing Solar UV-Induced Matrix Metalloproteinase 1
err2014-11-19
err0
errOAAI
errTae-Gyu Lim; Jong-Eun Kim; Sung-Young Lee; Jun Park; Myung Yeom; Hanyong Chen; Ann Bode; Zigang Dong; Ki Lee
errShare
errSave
A Suite of Object Oriented Cognitive Complexity Metrics
err2018-01-01
err35
errOAAI
errMisra, Sanjay; Adewumi, Adewole; Fernandez-Sanz, Luis; Damasevicius, Robertas
errShare
errSave
Controlled partial embedding of carbon nanotubes within flexible transparent layers
err2007-12-13
err0
PREAI
errElijah B Sansom; Derek Rinderknecht; Morteza Gharib
errShare
errSave
errShare
errSave
researcher View more