Source-linked AI summary

TripleBound: Triplet-Guided Heterogeneous Graph Learning for Microservice Decomposition

Mineth Weerasinghe, Himindu Kularathne, Methmini Madhushika, Danuka Lakshan, Nisansa de Silva, Adeesha Wijayasiri, Srinath Perera

arXiv:2609.11212v1cs.SE

TL;DR

Microservice decomposition from monoliths must reconcile structural dependencies with semantic relationships, which existing approaches often treat separately. TripleBound jointly learns both through a heterogeneous graph model and weakly supervised triplet constraints, achieving the best composite score on three of four benchmarks under the selected weighting while remaining metric- and dataset-dependent.

  • Problem

    Monolith-to-microservices migration requires identifying service boundaries and granularity, while existing methods often rely on structural or semantic signals separately.

  • Method

    TripleBound injects triplet constraints from parser-inferred service groups into a heterogeneous graph model's shared latent space and jointly optimizes structural and grouping objectives.

  • Results

    TripleBound achieves the highest composite score on AcmeAir, DayTrader, and JPetStore under the selected weighting, while CHGNN performs better on PlantsByWebSphere.

  • Takeaways & Limitations

    The results support TripleBound as a promising, application-dependent configuration rather than a uniformly superior decomposition method.

  • Takeaways & Limitations

    The evaluation does not isolate individual loss components or report statistical significance, limiting claims about component-specific superiority and small mean differences.

Abstract

from arXiv · show

Cloud computing and DevOps have made microservices a common architecture for scalable, maintainable software systems. However, migrating monoliths to microservices remains challenging due to tight coupling and unclear service boundaries. Existing decomposition approaches typically rely on either structural dependencies or semantic similarity signals, but rarely integrate both within a unified representation learning objective. This paper proposes TripleBound, a hybrid framework for automated monolith-to-microservices decomposition that augments a heterogeneous graph neural network with weakly supervised triplet constraints derived from parser-inferred service groups based on package structure, naming conventions, and code location. TripleBound injects triplet-based constraints directly into the shared structural latent space, enabling both signals to be jointly optimized during representation learning. Structural dependencies are captured using CHGNN, which models the monolith as a heterogeneous graph with program nodes, resource nodes, CALL edges, and CRUD edges. Semantic relationships are incorporated through triplet constraints generated from parser-inferred service groups. Evaluation on AcmeAir, DayTrader, PlantsByWebSphere, and JPetStore shows that TripleBound achieves the highest composite decomposition score under the selected weighting on AcmeAir, DayTrader, and JPetStore compared to CHGNN and MonoEmbed, while CHGNN remains stronger on PlantsByWebSphere. Per-metric analysis reveals trade-offs: gains in structural modularity and inter-partition coupling are accompanied by higher entity distribution imbalance on some datasets. Alternative composite weightings preserve TripleBound's first-place ranking on AcmeAir and DayTrader but not on JPetStore, showing that the aggregate ranking is metric-dependent.

I. INTRODUCTION

TripleBound addresses the limits of single-signal decomposition by jointly learning structural dependencies and source-level organizational relationships. It evaluates this hybrid framework against structural and semantic baselines on four open-source Java monoliths using multiple decomposition metrics and a composite score.

  • Motivation: Single-signal approaches can miss important software characteristics because structural methods may overlook semantics while semantic methods may overlook dependencies.
  • Evaluation: The evaluation covers AcmeAir, DayTrader, PlantsByWebSphere, and JPetStore, spanning differences in application size, framework, dependency structure, and source-code organization.
  • Contribution: TripleBound jointly integrates heterogeneous graph-based structural learning and weakly supervised triplet constraints within one representation-learning process.The triplet constraints are injected directly into the structural embedding space rather than combined with an independently trained representation.
  • Evaluation: TripleBound is compared with structural and semantic baselines using Structural Modularity, Interface Number, Inter-Partition Communication, Non-Extreme Distribution, and a composite score.
  • Motivation: Hybrid approaches motivate TripleBound because combining structural and semantic signals is reported to yield more coherent service boundaries than either signal alone.

III. TRIPLEBOUND APPROACH

TripleBound combines a heterogeneous graph representation of program and resource interactions with parser-inferred service groups. It learns a shared embedding space and clusters the resulting representations into microservices.

  • Framework Overview: TripleBound constructs a heterogeneous graph with program and resource nodes connected by CALL and CRUD edges, then infers service groups from package structure, naming conventions, and code location.
  • Framework Overview: Type-specific transformations map node and edge features into a common representation space before edge-aware graph autoencoder processing.
  • Framework Overview: Triplets from parser-inferred groups are applied to the same encoder, encouraging related components to remain close and components from different groups to separate.
  • Framework Overview: K-means partitions the learned embeddings, with the number of clusters set to the number of inferred service groups.

C. Structural Representation Learning

TripleBound learns structural node embeddings from a typed heterogeneous graph and augments them with weak semantic supervision. Parser-inferred groups provide the basis for triplets that organize the shared latent space.

  • Structural Representation Learning: CHGNN represents the monolith as an edge-aware heterogeneous graph and learns low-dimensional node embeddings from node attributes and typed edge relationships.
  • Structural Representation Learning: Stacked graph neural network layers aggregate neighboring information while preserving structural connectivity and edge semantics.
  • Structural Representation Learning: A decoder reconstructs node attributes and typed edge features so the embeddings preserve dependencies such as method invocations and data-access patterns.
  • Semantic Triplet Construction: Parser-inferred service groups use package structure, naming conventions, and code location as weak supervision for constructing triplets.
  • Semantic Triplet Construction: Each triplet contains an anchor and positive from one inferred group plus a negative sampled from another, with random negatives used instead of hard-negative mining.
  • Semantic Triplet Construction: Triplet constraints are applied to the shared latent embeddings rather than training a separate semantic embedding model.

E. Hybrid Training Objective

TripleBound jointly optimizes structural reconstruction, semantic triplet supervision, clustering consistency, and communication-aware objectives. Its hybrid training uses parser-inferred triplets and a differentiable proxy for reducing inter-service communication.

  • E. Hybrid Training Objective: TripleBound combines node and edge reconstruction with hybrid triplet-guided loss, clustering consistency, and communication-aware regularization in one embedding space.
  • Joint Loss Formulation: The hybrid loss combines triplet-local distance regularization with a semantic margin loss that brings same-group nodes closer than nodes from different groups.
  • Joint Loss Formulation: The hybrid-balance weighting emphasizes triplet-local distance earlier and semantic triplet supervision later during training.
  • Joint Loss Formulation: The final objective weights node reconstruction, edge reconstruction, clustering, hybrid triplet, and inter-cluster communication losses.
  • Joint Loss Formulation: The inter-cluster communication loss uses soft cluster assignments as a differentiable proxy that encourages dependency-connected nodes to share a cluster.
  • Joint Loss Formulation: The original CHGNN structure loss was removed after causing unstable optimization and large gradients in the hybrid setting.

A. Experimental Setup

The evaluation uses four open-source monolithic Java systems selected to vary in size, framework, dependency structure, and source-code organization.

  • A. Experimental Setup: Four open-source monolithic Java systems—AcmeAir, DayTrader, PlantsByWebSphere, and JPetStore—serve as evaluation subjects.They represent airline reservation, transaction-processing, online nursery, and commerce applications, respectively.
  • A. Experimental Setup: The benchmarks provide variation in application size, framework, dependency structure, and source-code organization.DayTrader is comparatively larger, while AcmeAir, PlantsByWebSphere, and JPetStore represent distinct application domains and technology contexts.
  • A. Experimental Setup: Parser-inferred service groups are used for triplet generation, and the final cluster count is set to the number of inferred groups.Table II defines ICU as Inter-Class Usage and distinguishes inferred groups from final clusters.

C. Evaluation Metrics

The evaluation measures decomposition quality through structural modularity, interface complexity, inter-partition communication, and benchmark characteristics summarized in comparison tables.

  • C. Evaluation Metrics: Structural Modularity (SM) balances within-partition cohesiveness against coupling between partitions; higher values indicate better modular decomposition.SM reflects whether collaborating classes remain together while dependencies across service boundaries are reduced.
  • C. Evaluation Metrics: Table II summarizes benchmark characteristics, while Table III compares decomposition quality across datasets.The tables provide the experimental context and cross-method metric results.
  • C. Evaluation Metrics: Interface Number (IFN) measures the average number of interfaces exposed by each microservice; lower values indicate simpler, less fragmented services.Interfaces are externally accessible entry points for service communication.

3) Inter-partition Communication (ICP) [29]:

Inter-Partition Communication (ICP) measures runtime interaction across service boundaries, while the composite evaluation aggregates normalized metrics using direction-specific weights.

  • 3) Inter-partition Communication (ICP) [29]: Inter-Partition Communication (ICP) measures the proportion of runtime calls crossing partition boundaries; lower values indicate better service separation.High ICP can increase latency and reduce service autonomy, whereas minimizing it supports looser coupling and independent deployment.
  • 3) Inter-partition Communication (ICP) [29]: Non-Extreme Distribution (NED) evaluates service-size balance, with lower values indicating more evenly distributed microservice sizes.A service is non-extreme when it satisfies 5 ≤|mi| ≤20.
  • 5) Composite Score: The composite score standardizes each metric across methods on the same benchmark and applies positive or negative weights according to whether metrics should increase or decrease.SM receives a positive weight, while IFN, ICP, and NED receive negative weights.
  • 5) Composite Score: The selected weight vector is W = {wSM, wIF N, wICP , wNED} = {3, −1, −1, −1}, giving SM greater influence in the aggregate score.This weighting makes composite results sensitive to SM improvements and requires interpretation alongside individual metrics.

V. RESULTS

TripleBound achieves the highest composite score on AcmeAir, DayTrader, and JPetStore, whereas CHGNN leads on PlantsByWebSphere, with metric-level trade-offs across systems.

  • A. RQ1: Comparison with Structural and Semantic Baselines: TripleBound achieves the best overall composite score on AcmeAir, DayTrader, and JPetStore, while CHGNN performs best on PlantsByWebSphere.The aggregate ranking is nuanced because SM is triple-weighted and gains in SM or ICP can coincide with regressions in NED or IFN.
  • A. RQ1: Comparison with Structural and Semantic Baselines: DayTrader’s highest composite score is 0.7708, with best SM of 0.14 and lowest ICP of 0.48, but IFN and NED regress relative to baselines.TripleBound’s SM gain over CHGNN is 0.14 vs. 0.13, and statistical significance testing is absent.
  • A. RQ1: Comparison with Structural and Semantic Baselines: AcmeAir’s highest composite score is 0.8284, supported by best SM of 0.23, lowest IFN of 2.36, and lowest ICP of 0.28, alongside higher NED of 0.71.The result indicates a trade-off between cohesion and coupling improvements and entity distribution balance.
  • A. RQ1: Comparison with Structural and Semantic Baselines: JPetStore’s highest composite score is 0.2455, while CHGNN has the best NED and MonoEmbed has the lowest IFN and ICP.TripleBound slightly improves IFN and SM over CHGNN, whereas MonoEmbed’s lower SM and higher NED reduce its aggregate score.
  • A. RQ1: Comparison with Structural and Semantic Baselines: PlantsByWebSphere favors CHGNN with a composite score of 0.5188, outperforming TripleBound on SM, IFN, ICP, and NED.The result identifies an application-specific weakness, but the evaluation cannot determine which modified component causes it.

1) Robustness to Alternative Composite Weights:

TripleBound’s aggregate ranking is partly robust to alternative metric weights, while sensitivity experiments identify α = 0.7 and 100 epochs as a stable configuration.

  • Robustness to Alternative Composite Weights: TripleBound remains first on AcmeAir and DayTrader across the tested composite weightings, while CHGNN remains first on PlantsByWebSphere.The ranking is stable across these datasets under both alternative weight vectors.
  • Robustness to Alternative Composite Weights: TripleBound’s first-place result on JPetStore depends on assigning Structural Modularity a threefold weight.CHGNN ranks first when the SM weight is reduced to either twofold or equal magnitude.
  • Robustness to Alternative Composite Weights: The aggregate evidence supports a weighting-robust TripleBound advantage on two systems rather than a weighting-independent advantage on three.Raw metrics remain necessary when decomposition priorities differ.
  • Sensitivity to Training Parameters: α = 0.7 provides a stable trade-off across datasets, avoiding sharp performance drops observed at some lower values.The α sensitivity analysis varies α from 0.1 to 0.9 with training fixed at 100 epochs and averages results across 30 runs.
  • Sensitivity to Training Parameters: 100 epochs provides the best overall balance, whereas higher epoch counts tend to degrade performance.The final evaluation therefore uses α = 0.7 and 100 training epochs.

VI. DISCUSSION

TripleBound’s effects vary by application and metric: it can improve cohesion and coupling while worsening balance or interface simplicity. The discussion therefore emphasizes dataset-specific trade-offs, evaluation limitations, and the need to interpret composite rankings alongside raw metrics.

  • Structural vs. Semantic Signal Strength: On AcmeAir, TripleBound achieves the strongest SM, IFN, and ICP values but raises NED from CHGNN’s 0.00 to 0.71.The result favors cohesion and lower communication at the cost of less balanced service sizes.
  • Structural vs. Semantic Signal Strength: On DayTrader, TripleBound improves structural modularity and inter-partition communication but has a larger interface surface than MonoEmbed and worse balance than CHGNN.The contribution of individual loss components cannot be inferred from this complete-configuration comparison.
  • Structural vs. Semantic Signal Strength: On JPetStore, TripleBound’s selected-weight composite-score lead is not robust: MonoEmbed has lower ICP, CHGNN better balance, and reduced SM weighting ranks CHGNN first.The preferred method therefore depends on metric priorities.
  • Failure Mode Analysis: PlantsByWebSphere: TripleBound is outperformed by CHGNN across all four metrics on PlantsByWebSphere, but the available evidence establishes the failure case rather than its cause.Possible explanations include sufficient structural information or conflict between triplet cues and structural connectivity, neither directly tested.
  • Threats to Validity: The evaluation covers four relatively small benchmark monoliths, which may not capture the complexity and diversity of large industrial systems.Broader evaluation across additional systems, methods, and metrics would strengthen external validity.
  • Threats to Validity: Triplet labels derived from package structure, naming, and code location may partially reflect pre-existing module organization rather than independently discovered semantic relationships.This makes it difficult to separate semantic learning from boundary leakage.
  • Threats to Validity: The study lacks component ablations, so it cannot isolate the effects of triplet supervision, communication regularization, loss weighting, or structure-loss removal.An incremental evaluation is needed to attribute changes in SM or ICP to individual modifications.
  • Threats to Validity: Composite weighting gives SM greater influence and can favor cohesion and coupling while degrading service-size balance.TripleBound’s JPetStore ranking changes when the SM weight is reduced, so composite scores should be read with raw metrics.

VIII. CONCLUSION

TripleBound combines heterogeneous graph-based structural learning with weakly supervised triplet constraints injected directly into a shared latent space. Across four benchmarks, it leads on three under selected weighting, but results remain metric- and application-dependent.

  • Triplet constraints from parser-inferred service groups are injected directly into the shared latent space to jointly optimize structural and grouping objectives.
  • TripleBound achieves the highest composite score on AcmeAir, DayTrader, and JPetStore under the selected weighting, while CHGNN performs better on PlantsByWebSphere.The ranking remains stable under two alternative weightings on AcmeAir and DayTrader, but not on JPetStore.
  • The results are metric-selective: modularity and coupling improvements may coincide with reduced entity distribution balance.
  • The evaluation supports TripleBound as a promising, application-dependent configuration rather than establishing uniform or component-specific superiority.The current evaluation does not isolate individual loss components or quantify statistical significance.
  • Future work targets runtime and domain-level signals, adaptive weighting, improved clustering, feedback-based refinement, and migration-support capabilities.
Loading 2609.11212v1…