基于自适应交叉的多目标软件重构推荐方法

  • 打印
  • 收藏
收藏成功


打开文本图片集

中图分类号:TP311.5 文献标识码:A DOI:10.7535/hbkd.2026yx02009

Abstract:To addressthe problem of excessive randomness introduced by the mechanical exchange of gene fragments in traditionalcrossoveroperators,whichleads tothegenerationofinvalidrefactoringoperations,thispaperproposedarefactoring recommendation methodcaled RefCrossbased on anadaptive crossver operator.Firstly,the submitted Java projects were parsed using sourcecode analysis tols to construct acode structure modelto extractcode metrics.Thenthe fitnessfunction wasdesigned andthefitnessvalue was calculatedbasedontheextractedcode metricsto guidetheoptimizationdirectionof the crosoveroperator.Finally,the parent clasification mechanism based on feature matching wasconstructed,and thecrossover strategywasformulated.Bycombining withcommongeneretention,adaptiveselectionofdiferentialgenes,andtheelitegene reinforcement strategy,theofspringrefactoringsequences thatbalanced high-qualityfeatureinheritanceand diversityinthe solution space was generated,thereby reducing the probabilityof generating ineffective refactoring operations.The results showthat RefCross outperforms existing methods in precision,recall,andF1 score metrics on six open-source projects, achieving an average F1 score of 77.82% ,representing a baseline improvement of 9.1O percentage points. This method efectivelyenhances the efectivenessandacuracyof refactoring recommendations,providing strong support forautomated refactoring decisions.

KeyWords:software engineering;multi-objectiveoptimization;crossover operator;refactoring recommendation;parent classification

代码重构在软件开发中至关重要,能够改善程序结构、提升代码的可维护性,已被广泛应用于软件工程领域[1]。(剩余12998字)

monitor