We use cookies to improve your experience with our site.

基于搜索的成本效益高的软件模块重构

Search-Based Cost-Effective Software Remodularization

  • 摘要: 软件模块化是一项将一个软件系统分为几个内聚和松散耦合的独立模块(程序包)的技术。然而,为了满足日益增加的新需求,软件系统不断演进,它们的模块化变得复杂并且质量逐渐降低。因此,自动优化程序包里的类的分布,即再模块化,为当下一大挑战。为了缓解此问题,我们介绍了一个将类转移到更加合适的程序包的软件模块优化方法。除了改进设计质量和保留语义一致性外,我们的方法考虑了重构的工作量,并将它作为模块优化的目标。我们调整了Deb等人的Elitist Non-dominated Sorting Genetic(NSGA-Ⅱ)算法,以找出重组的最佳序列,该序列:1)最大化结构质量,2)最大化程序包的语义内聚(由基于WordNet的语义指标评估),3)最小化重构工作量。我们通过使用开源项目,评估了我们的方法,结果显示我们的方法能得到从质量指标和开发者角度而言,内聚且有用的重构推荐序列。

     

    Abstract: Software modularization is a technique used to divide a software system into independent modules (packages) that are expected to be cohesive and loosely coupled. However, as software systems evolve over time to meet new requirements, their modularizations become complex and gradually loose their quality. Thus, it is challenging to automatically optimize the classes' distribution in packages, also known as remodularization. To alleviate this issue, we introduce a new approach to optimize software modularization by moving classes to more suitable packages. In addition to improving design quality and preserving semantic coherence, our approach takes into consideration the refactoring effort as an objective in itself while optimizing software modularization. We adapt the Elitist Non-dominated Sorting Genetic Algorithm (NSGA-Ⅱ) of Deb et al. to find the best sequence of refactorings that 1) maximize structural quality, 2) maximize semantic cohesiveness of packages (evaluated by a semantic measure based on WordNet), and 3) minimize the refactoring effort. We report the results of an evaluation of our approach using open-source projects, and we show that our proposal is able to produce a coherent and useful sequence of recommended refactorings both in terms of quality metrics and from the developer's points of view.

     

/

返回文章
返回