Skip to main content
QUICK REVIEW

[论文解读] Graph Neural Network to Dilute Outliers for Refactoring Monolith Application

Utkarsh Desai, Sambaran Bandyopadhyay|arXiv (Cornell University)|Feb 7, 2021
Software System Performance and Reliability被引用 4
一句话总结

本文提出 CO-GCN,一种新颖的图神经网络框架,通过整合节点聚类、异常检测与异常稀释,将单体应用重构为微服务。通过将代码建模为属性图并利用多目标学习,CO-GCN 提升了聚类质量,并以 60% 的人类评估重叠度识别出高影响重构候选,其在定量指标与定性相关性方面均优于当前最先进方法。

ABSTRACT

Microservices are becoming the defacto design choice for software architecture. It involves partitioning the software components into finer modules such that the development can happen independently. It also provides natural benefits when deployed on the cloud since resources can be allocated dynamically to necessary components based on demand. Therefore, enterprises as part of their journey to cloud, are increasingly looking to refactor their monolith application into one or more candidate microservices; wherein each service contains a group of software entities (e.g., classes) that are responsible for a common functionality. Graphs are a natural choice to represent a software system. Each software entity can be represented as nodes and its dependencies with other entities as links. Therefore, this problem of refactoring can be viewed as a graph based clustering task. In this work, we propose a novel method to adapt the recent advancements in graph neural networks in the context of code to better understand the software and apply them in the clustering task. In that process, we also identify the outliers in the graph which can be directly mapped to top refactor candidates in the software. Our solution is able to improve state-of-the-art performance compared to works from both software engineering and existing graph representation based techniques.

研究动机与目标

  • 为通过将软件结构建模为图来解决将单体应用分解为微服务的挑战。
  • 识别并优先处理具有过多跨功能依赖关系的异常类——这些类是重构的优先候选。
  • 将聚类、异常检测与异常稀释统一为一个端到端的图神经网络框架,以提升微服务分解效果。
  • 在聚类质量与检测到的重构候选的相关性方面,超越现有的基于图的方法与软件工程技术。

提出的方法

  • 该方法通过静态程序分析将单体代码转换为属性图,其中节点表示类,边表示依赖关系。
  • 提出两类异常:结构异常(在功能边界之间高度连接)与属性异常(具有异常调用模式)。
  • CO-GCN 采用多目标损失函数,结合图重构、聚类与异常感知目标,联合优化节点表示、聚类分配与异常得分。
  • 该框架使用图卷积网络(GCN)学习节点嵌入,并通过聚类头将节点分配给微服务候选。
  • 异常得分用于在消息传递过程中稀释异常节点的影响,降低其对聚类形成造成的干扰。
  • 模型通过总损失端到端训练,该损失平衡了结构重构、属性重构、聚类与异常感知目标。

实验结果

研究问题

  • RQ1图神经网络能否被有效适配以同时执行单体重构的聚类与异常检测?
  • RQ2引入异常感知与稀释机制后,与标准 GNN 相比,微服务聚类质量是否得到提升?
  • RQ3检测到的异常与人类专家对高优先级重构候选的判断在多大程度上一致?
  • RQ4所提出框架的性能对超参数(如节点嵌入维度与损失权重)的敏感程度如何?

主要发现

  • CO-GCN 在四个公开的单体应用上达到最先进性能,在模块化与结构模块化方面优于现有基于图与软件工程的方法。
  • 在人类评估中,框架检测到的异常与专家识别的前五名重构候选的平均重叠度达 60%,显著优于 GCN(45%)与 DGI(55%)。
  • 消融研究显示,聚类目标与异常感知训练组件均对聚类质量有显著贡献,尽管其影响程度因应用与指标而异。
  • 敏感性分析表明,更大的节点嵌入维度(如 64)通常能提升结构模块化,但模块化分数在不同嵌入维度下保持相对稳定。
  • 移除异常信息后,某一应用(PBW)的模块化有所提升,但结构模块化下降,表明聚类凝聚性与结构保真度之间存在权衡。
  • 将异常检测与稀释整合到训练目标中,使聚类结果更具一致性与功能一致性,经专家定性反馈验证。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。