Automatizing Software Cognitive Complexity Reduction through Integer
Linear Programming
- URL: http://arxiv.org/abs/2402.05559v1
- Date: Thu, 8 Feb 2024 10:53:00 GMT
- Title: Automatizing Software Cognitive Complexity Reduction through Integer
Linear Programming
- Authors: Rub\'en Saborido and Javier Ferrer and Francisco Chicano
- Abstract summary: 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.
- Score: 1.1970409518725493
- License: http://creativecommons.org/licenses/by-nc-sa/4.0/
- Abstract: Reducing the cognitive complexity of a piece of code to a given threshold is
not trivial. 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 refactoring
operations until a stopping criterion is met. As a result, it returns the
minimal sequence of code extraction refactoring operations that is able to
reduce the cognitive complexity of a code to the given threshold. However,
exhaustive enumeration algorithms fail to scale with the code size. The number
of refactoring plans can grow exponentially with the number of lines of code.
In this paper, instead of enumerating sequences of code extraction refactoring
operations, we model the cognitive complexity reduction as an Integer Linear
Programming problem. This opens the door to the use of efficient solvers to
find optimal solutions in large programs.
Related papers
- Code Repair with LLMs gives an Exploration-Exploitation Tradeoff [16.80314690163063]
Iteratively improving and repairing source code with large language models (LLMs) has emerged as a popular way of generating programs that would be too complex to construct in one shot.
We show here that refinement exposes an explore-exploit tradeoff: exploit by refining the program that passes the most test cases, or explore by refining a lesser considered program.
arXiv Detail & Related papers (2024-05-26T04:00:30Z) - Recursive Visual Programming [53.76415744371285]
We propose Recursive Visual Programming (RVP), which simplifies generated routines, provides more efficient problem solving, and can manage more complex data structures.
We show RVP's efficacy through extensive experiments on benchmarks including VSR, COVR, GQA, and NextQA.
arXiv Detail & Related papers (2023-12-04T17:27:24Z) - 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) - Opti Code Pro: A Heuristic Search-based Approach to Code Refactoring [0.0]
The motivation for code could be to improve the design, structure, or implementation of an existing program without changing its functionality.
To solve a very specific problem of coupling and cohesion, we propose using search-based techniques on an approximation of the full code problem.
arXiv Detail & Related papers (2023-05-12T16:39:38Z) - Optimization-based Block Coordinate Gradient Coding for Mitigating
Partial Stragglers in Distributed Learning [58.91954425047425]
This paper aims to design a new gradient coding scheme for mitigating partial stragglers in distributed learning.
We propose a gradient coordinate coding scheme with L coding parameters representing L possibly different diversities for the L coordinates, which generates most gradient coding schemes.
arXiv Detail & Related papers (2022-06-06T09:25:40Z) - Discovering Non-monotonic Autoregressive Orderings with Variational
Inference [67.27561153666211]
We develop an unsupervised parallelizable learner that discovers high-quality generation orders purely from training data.
We implement the encoder as a Transformer with non-causal attention that outputs permutations in one forward pass.
Empirical results in language modeling tasks demonstrate that our method is context-aware and discovers orderings that are competitive with or even better than fixed orders.
arXiv Detail & Related papers (2021-10-27T16:08:09Z) - Dynamic programming by polymorphic semiring algebraic shortcut fusion [1.9405875431318445]
Dynamic programming (DP) is an algorithmic design paradigm for the efficient, exact solution of intractable, problems.
This paper presents a rigorous algebraic formalism for systematically deriving DP algorithms, based on semiring.
arXiv Detail & Related papers (2021-07-05T00:51:02Z) - Towards Optimally Efficient Tree Search with Deep Learning [76.64632985696237]
This paper investigates the classical integer least-squares problem which estimates signals integer from linear models.
The problem is NP-hard and often arises in diverse applications such as signal processing, bioinformatics, communications and machine learning.
We propose a general hyper-accelerated tree search (HATS) algorithm by employing a deep neural network to estimate the optimal estimation for the underlying simplified memory-bounded A* algorithm.
arXiv Detail & Related papers (2021-01-07T08:00:02Z) - Strong Generalization and Efficiency in Neural Programs [69.18742158883869]
We study the problem of learning efficient algorithms that strongly generalize in the framework of neural program induction.
By carefully designing the input / output interfaces of the neural model and through imitation, we are able to learn models that produce correct results for arbitrary input sizes.
arXiv Detail & Related papers (2020-07-07T17:03:02Z)
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.