<link rel="stylesheet" href="styles.f3b1fba60ec7970c.css">

Artículo:
Multi-objective Integer Linear Programming Approach for Automatic Software Cognitive Complexity Reduction

Cargando...
Miniatura

Editor

Sistedes

Publicado en

Actas de las XXX Jornadas de Ingeniería del Software y Bases de Datos (JISBD 2026)

Licencia Creative Commons

Excepto donde se indique lo contrario, la licencia de este ítem se describe como CC BY-NC-ND 4.0

Resumen

Clear and concise code is necessary to ensure maintainability, so it is crucial that the software is as simple as possible to understand, to avoid bugs and, above all, vulnerabilities. One metric of software quality is cognitive complexity, which measures the relative effort a developer must expend to understand a piece of code. In this work, we will use the cognitive complexity measure defined by SonarSource --the company behind products such as SonarQube-- as a reference to measure this difficulty in understanding code at the method level. This measure considers control flow statements and their nesting level. There are many ways to enhance software without changing its functionality, with refactoring as the primary approach. One refactoring that reduces cognitive complexity is the extract method refactoring. These extraction operations can be modeled as a combinatorial optimization problem. The main difficulty is that different criteria are used to evaluate the solutions, which provides an opportunity to pose the code extraction problem as a multi-objective optimization problem. In this work, the problem of reducing cognitive complexity is modelled as a multi-objective integer linear programming problem to obtain a set of solutions that reduce the cognitive complexity of a given code fragment below a given limit. In addition, other features of the code are balanced, such as cognitive complexity itself and the number of lines between methods resulting from refactoring operations. Finally, an algorithm has been developed to solve the model and has been evaluated on a corporate software project and three popular open-source projects.

Descripción

Acerca de Novoa-Hurtado, Adriana

Citación

Novoa-Hurtado, A., Saborido, R., Chicano, F., Giménez-Medina, M.: Multi-objective Integer Linear Programming Approach for Automatic Software Cognitive Complexity Reduction. In: Cetina, C. (ed.) Actas de las XXX Jornadas de Ingeniería del Software y Bases de Datos (JISBD 2026). Sistedes (2026). https://hdl.handle.net/11705/JISBD/2026/182