Graph-Based Module Clustering Using Machine Learning Model in Object Oriented Software
Sandi Tendean, Daniel Fernando Siahaan, Anny Yuniarti · 2025
Object-based software modularization is crucial in software engineering. It facilitates scalability, maintainability, and the reduction of system complexity. Module clustering aims to achieve effective modularization through high cohesion and low coupling. Numerous techniques have been put forth, such as graph-based strategies that make use of the structural connections between classes. This study implements GC-Flow (Graph Convolutional Normalizing Flows), a hybrid method combining Graph Convolutional Networks (GCNs) and normalizing flows, to cluster software modules into optimally modularized groups. The implementation used preprocessed source code from object-oriented software. The objective is to enhance software design by clustering modules based on class relationship graphs. Several parameter configurations (PCA dimension, model architecture, dropout ratio) were tested to evaluate their impact on cluster quality. Evaluation relied on two metrics: silhouette score (cluster separation) and Modularization Quality (MQ) (cohesion/coupling). Experiments indicate suboptimal performance results: maximum silhouette scores of 0.252 (JavaCC) and 0.223 (JEdit), with MQ values near zero. These showed poorly separated clusters, high inter-cluster coupling, and weak intra-cluster cohesion. Root-cause analysis showed that functional class links are not captured by Bag of Words (BoW)-based features, which extract word frequency from code. Consequently, the model clusters classes by lexical similarities, while non-semantic feature noise diminishes the graph’s role. Therefore, using this clustering method on software modules requires methodological modifications to account for both structural and semantic differences. Future studies should adopt more precise feature extraction techniques to capture class functional contexts.