Opti Code Pro: A Heuristic Search-based Approach to Code Refactoring
- URL: http://arxiv.org/abs/2305.07594v1
- Date: Fri, 12 May 2023 16:39:38 GMT
- Title: Opti Code Pro: A Heuristic Search-based Approach to Code Refactoring
- Abstract summary: 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.
- Score: 0.0
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: This paper presents an approach that evaluates best-first search methods to
code refactoring. The motivation for code refactoring 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 heuristic search-based techniques on an approximation of the
full code refactoring problem, to guide the refactoring process toward
solutions that have high cohesion and low coupling. We evaluated our approach
by providing demonstrative examples of the effectiveness of this approach on
random state problems and created a tool to implement the algorithm on Java
projects.
Related papers
- Multi-objective Integer Linear Programming approach for Automatic Software Cognitive Complexity Reduction [1.6799377888527687]
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.
arXiv Detail & Related papers (2026-01-29T11:28:54Z) - Learner-Tailored Program Repair: A Solution Generator with Iterative Edit-Driven Retrieval Enhancement [33.04212496723856]
We propose a framework to enhance program repair while offering the bug descriptions for the buggy code.<n>In the first stage, we utilize a solution retrieval framework to construct a solution retrieval database.<n>In the second stage, we propose a solution-guided program repair method, which fixes the code and provides explanations.
arXiv Detail & Related papers (2026-01-13T13:31:11Z) - Let's Revise Step-by-Step: A Unified Local Search Framework for Code Generation with LLMs [16.818072348542923]
We propose a unified local search framework which effectively performs step-by-step code revision.<n>Specifically, ReLoc explores a series of local revisions through four key algorithmic components.<n>We develop a specialized revision reward model that evaluates code quality based on revision distance to produce fine-grained preferences.
arXiv Detail & Related papers (2025-08-10T17:11:56Z) - Refactoring Codebases through Library Design [21.039476331720312]
We investigate code agents' capacity to code in ways that support growth and reusability.<n>We present both a benchmark and a method for generating reusable libraries.<n>We compare Librarian to state-of-the-art library generation methods, and study it on real-world code bases.
arXiv Detail & Related papers (2025-05-26T07:26:33Z) - Preference Optimization for Combinatorial Optimization Problems [54.87466279363487]
Reinforcement Learning (RL) has emerged as a powerful tool for neural optimization, enabling models learns that solve complex problems without requiring expert knowledge.<n>Despite significant progress, existing RL approaches face challenges such as diminishing reward signals and inefficient exploration in vast action spaces.<n>We propose Preference Optimization, a novel method that transforms quantitative reward signals into qualitative preference signals via statistical comparison modeling.
arXiv Detail & Related papers (2025-05-13T16:47:00Z) - Automated Refactoring of Non-Idiomatic Python Code: A Differentiated Replication with LLMs [54.309127753635366]
We present the results of a replication study in which we investigate GPT-4 effectiveness in recommending and suggesting idiomatic actions.
Our findings underscore the potential of LLMs to achieve tasks where, in the past, implementing recommenders based on complex code analyses was required.
arXiv Detail & Related papers (2025-01-28T15:41:54Z) - Generating refactored code accurately using reinforcement learning [3.179831861897336]
We propose a novel reinforcement learning-based approach for fine-tuning and aligning code language models to perform automated, intelligent extract method on Java source code.
Our approach fine-tunes sequence-to-sequence generative models and aligns them using the Proximal Policy Optimization (PPO) algorithm.
Our experiments demonstrate that our approach significantly enhances the performance of large language models in code.
arXiv Detail & Related papers (2024-12-23T23:09:48Z) - CodeDPO: Aligning Code Models with Self Generated and Verified Source Code [52.70310361822519]
We propose CodeDPO, a framework that integrates preference learning into code generation to improve two key code preference factors: code correctness and efficiency.
CodeDPO employs a novel dataset construction method, utilizing a self-generation-and-validation mechanism that simultaneously generates and evaluates code and test cases.
arXiv Detail & Related papers (2024-10-08T01:36:15Z) - RethinkMCTS: Refining Erroneous Thoughts in Monte Carlo Tree Search for Code Generation [71.88883580383039]
We propose RethinkMCTS, a framework that explores and refines the reasoning process for code generation.<n>Specifically, we employ MCTS to search for thoughts before code generation and integrate MCTS with a refinement mechanism called rethink.<n>We demonstrate that RethinkMCTS outperforms previous search-based and feedback-enhanced code generation baselines.
arXiv Detail & Related papers (2024-09-15T02:07:28Z) - DOCE: Finding the Sweet Spot for Execution-Based Code Generation [69.5305729627198]
We propose a comprehensive framework that includes candidate generation, $n$-best reranking, minimum Bayes risk (MBR) decoding, and self-ging as the core components.
Our findings highlight the importance of execution-based methods and the difference gap between execution-based and execution-free methods.
arXiv Detail & Related papers (2024-08-25T07:10:36Z) - In Search of Metrics to Guide Developer-Based Refactoring Recommendations [13.063733696956678]
Motivation is a well-established approach to improving source code quality without compromising its external behavior.
We propose an empirical study into the metrics that study the developer's willingness to apply operations.
We will quantify the value of product and process metrics in grasping developers' motivations to perform.
arXiv Detail & Related papers (2024-07-25T16:32:35Z) - Iterative or Innovative? A Problem-Oriented Perspective for Code Optimization [81.88668100203913]
Large language models (LLMs) have demonstrated strong capabilities in solving a wide range of programming tasks.
In this paper, we explore code optimization with a focus on performance enhancement, specifically aiming to optimize code for minimal execution time.
arXiv Detail & Related papers (2024-06-17T16:10:10Z) - A Survey of Deep Learning Based Software Refactoring [5.716522445049744]
Dozens of deep learning-based approaches have been proposed forfactoring software.
There is a lack of comprehensive reviews on such works as well as a taxonomy for deep learning-based approaches.
Most of the deep learning techniques have been used for the detection of code smells and the recommendation of solutions.
arXiv Detail & Related papers (2024-04-30T03:07:11Z) - 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) - Analyzing and Enhancing the Backward-Pass Convergence of Unrolled
Optimization [50.38518771642365]
The integration of constrained optimization models as components in deep networks has led to promising advances on many specialized learning tasks.
A central challenge in this setting is backpropagation through the solution of an optimization problem, which often lacks a closed form.
This paper provides theoretical insights into the backward pass of unrolled optimization, showing that it is equivalent to the solution of a linear system by a particular iterative method.
A system called Folded Optimization is proposed to construct more efficient backpropagation rules from unrolled solver implementations.
arXiv Detail & Related papers (2023-12-28T23:15:18Z) - Plan, Verify and Switch: Integrated Reasoning with Diverse X-of-Thoughts [65.15322403136238]
We propose XoT, an integrated problem solving framework by prompting LLMs with diverse reasoning thoughts.
For each question, XoT always begins with selecting the most suitable method then executes each method iteratively.
Within each iteration, XoT actively checks the validity of the generated answer and incorporates the feedback from external executors.
arXiv Detail & Related papers (2023-10-23T07:02:20Z) - RefSearch: A Search Engine for Refactoring [1.5519338281670214]
RefSearch enables users to search for cases through a user-friendly query language.
System collects instances using two detectors and provides a web interface for querying and browsing the cases.
arXiv Detail & Related papers (2023-08-28T03:04:47Z) - Branch & Learn for Recursively and Iteratively Solvable Problems in
Predict+Optimize [9.772500430303285]
This paper proposes Branch & Learn, a framework for Predict+ to tackle optimization problems containing parameters that are unknown at the time of solving.
Our framework applies also to iterative algorithms by viewing them as a degenerate form of recursion.
arXiv Detail & Related papers (2022-05-01T08:41:30Z) - End-to-End Constrained Optimization Learning: A Survey [69.22203885491534]
It focuses on surveying the work on integrating solvers and optimization methods with machine learning architectures.
These approaches hold the promise to develop new hybrid machine learning and optimization methods to predict fast, approximate, structural, solutions to problems and to enable logical inference.
arXiv Detail & Related papers (2021-03-30T14:19:30Z)
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.