Multi-objective Integer Linear Programming approach for Automatic Software Cognitive Complexity Reduction
- URL: http://arxiv.org/abs/2601.21565v1
- Date: Thu, 29 Jan 2026 11:28:54 GMT
- Title: Multi-objective Integer Linear Programming approach for Automatic Software Cognitive Complexity Reduction
- Authors: Adriana Novoa-Hurtado, Rubén Saborido, Francisco Chicano, Manuel Giménez-Medina,
- Abstract summary: We propose a multi-objective linear programming model to obtain a set of solutions that reduce the cognitive complexity of a given piece of code.<n>Several algorithms have been developed to validate the model.<n>These algorithms have been integrated into a tool that enables the parameterised resolution of the problem of reducing software cognitive complexity.
- Score: 1.6799377888527687
- License: http://creativecommons.org/licenses/by-nc-sa/4.0/
- Abstract: 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. There are many ways to enhance software without changing its functionality, considering the extract method refactoring the primary process to reduce the effort required for code comprehension. The cognitive complexity measure employed in this work is the one defined by SonarSource, which is a company that develops well-known applications for static code analysis. This extraction problem can be modeled as a combinatorial optimization problem. The main difficulty arises from the existence of different criteria for evaluating the solutions obtained, requiring the formulation of the code extraction problem as a multi-objective optimization problem using alternative methods. We propose a multi-objective integer linear programming model to obtain a set of solutions that reduce the cognitive complexity of a given piece of code, such as balancing the number of lines of code and its cognitive complexity. In addition, several algorithms have been developed to validate the model. These algorithms have been integrated into a tool that enables the parameterised resolution of the problem of reducing software cognitive complexity.
Related papers
- Scaling Code-Assisted Chain-of-Thoughts and Instructions for Model Reasoning [65.20602712957725]
Caco is a novel framework that automates the synthesis of high-quality, verifiable, and diverse instruction-CoT reasoning data.<n>Our work establishes a paradigm for building self-sustaining, trustworthy reasoning systems without human intervention.
arXiv Detail & Related papers (2025-10-05T07:59:24Z) - Single-loop Algorithms for Stochastic Non-convex Optimization with Weakly-Convex Constraints [49.76332265680669]
This paper examines a crucial subset of problems where both the objective and constraint functions are weakly convex.<n>Existing methods often face limitations, including slow convergence rates or reliance on double-loop designs.<n>We introduce a novel single-loop penalty-based algorithm to overcome these challenges.
arXiv Detail & Related papers (2025-04-21T17:15:48Z) - EXALT: EXplainable ALgorithmic Tools for Optimization Problems [2.1184929769291294]
This project proposes a novel approach to developing explainable algorithms by starting with optimization problems.<n>The developed software library enriches basic algorithms with human-understandable explanations through four key methodologies.
arXiv Detail & Related papers (2025-02-28T10:28:20Z) - Autoformulation of Mathematical Optimization Models Using LLMs [50.030647274271516]
This paper approaches the problem of $textitautoformulation$: the automated creation of solver-ready optimization models from natural language problem descriptions.<n>We identify three core challenges of autoformulation: $textit(1)$ the vast, problem-dependent hypothesis space, and $textit(2)$ efficient and diverse exploration of this space under uncertainty.<n>We present a novel method leveraging $textitLarge Language Models$ with $textitMonte-Carlo Tree Search$, exploiting the hierarchical nature of optimization modeling to generate and systematically explore possible formulations
arXiv Detail & Related papers (2024-11-03T20:41:38Z) - Automatizing Software Cognitive Complexity Reduction through Integer
Linear Programming [1.1970409518725493]
Recently, we modeled software cognitive complexity reduction as an optimization problem and we proposed an approach to assist developers on this task.
This approach enumerates sequences of code extraction operations until a stopping criterion is met. As a result, it returns the minimal sequence of code extraction operations that is able to reduce the cognitive complexity of a code to the given threshold.
arXiv Detail & Related papers (2024-02-08T10:53:00Z) - When Do Program-of-Thoughts Work for Reasoning? [51.2699797837818]
We propose complexity-impacted reasoning score (CIRS) to measure correlation between code and reasoning abilities.
Specifically, we use the abstract syntax tree to encode the structural information and calculate logical complexity.
Code will be integrated into the EasyInstruct framework at https://github.com/zjunlp/EasyInstruct.
arXiv Detail & Related papers (2023-08-29T17:22:39Z) - Learning a Generic Value-Selection Heuristic Inside a Constraint
Programming Solver [2.8425837800129696]
We introduce a generic learning procedure that can be used to obtain a value-selection inside a constraint programming solver.
This has been achieved thanks to the combination of a deep Q-learning algorithm, a tailored reward signal, and a heterogeneous graph neural network architecture.
arXiv Detail & Related papers (2023-01-05T05:13:48Z) - Efficient lifting of symmetry breaking constraints for complex
combinatorial problems [9.156939957189502]
This work extends the learning framework and implementation of a model-based approach for Answer Set Programming.
In particular, we incorporate a new conflict analysis algorithm in the Inductive Logic Programming system ILASP.
arXiv Detail & Related papers (2022-05-14T20:42:13Z) - Encoding trade-offs and design toolkits in quantum algorithms for
discrete optimization: coloring, routing, scheduling, and other problems [0.0]
We present an intuitive method for synthesizing and analyzing discrete (i.e., integer-based) optimization problems.
This method is expressed using a discrete quantum intermediate representation (DQIR) that is encoding-independent.
Second, we perform numerical studies comparing several runtime encodings.
Third, we design low-depth graph-derived partial mixers (GDPMs) up to 16-level quantum variables.
arXiv Detail & Related papers (2022-03-28T01:01:12Z) - Learning Proximal Operators to Discover Multiple Optima [66.98045013486794]
We present an end-to-end method to learn the proximal operator across non-family problems.
We show that for weakly-ized objectives and under mild conditions, the method converges globally.
arXiv Detail & Related papers (2022-01-28T05:53:28Z) - Adaptive Discretization in Online Reinforcement Learning [9.560980936110234]
Two major questions in designing discretization-based algorithms are how to create the discretization and when to refine it.
We provide a unified theoretical analysis of tree-based hierarchical partitioning methods for online reinforcement learning.
Our algorithms are easily adapted to operating constraints, and our theory provides explicit bounds across each of the three facets.
arXiv Detail & Related papers (2021-10-29T15:06:15Z) - Adaptive Sampling for Best Policy Identification in Markov Decision
Processes [79.4957965474334]
We investigate the problem of best-policy identification in discounted Markov Decision (MDPs) when the learner has access to a generative model.
The advantages of state-of-the-art algorithms are discussed and illustrated.
arXiv Detail & Related papers (2020-09-28T15:22:24Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.