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.
翻译:摘要:本文提出了一种评估最佳优先搜索方法用于代码重构的方法。代码重构的动机是在不改变现有程序功能的前提下,改进其设计、结构或实现。为解决耦合与内聚这一特定问题,我们建议在完整代码重构问题的近似上采用基于启发式搜索的技术,以引导重构过程朝向高内聚、低耦合的解决方案。我们通过提供随机状态问题的示例来评估该方法的有效性,并开发了一个工具,将算法应用于Java项目。