Abstract: Design patterns are powerful tools that provide standardized solutions to common problems in the software design process. Detecting design patterns in software systems can greatly facilitate software maintenance and code understanding, but manual detection is a complex and challenging task. In recent years, with the development of deep learning techniques, researchers have proposed automatic design pattern detection methods that utilize code features and machine learning classifiers. However, these approaches typically focus on either code semantic features or structural features, lacking the integration of both. To address this issue, in this paper, we propose a novel design pattern detection method with multi-feature fusion, DPDMF2, which effectively fuses code semantic features and software network structural features for design pattern detection. Specifically, we first represent software as a CSN (Class-level Software Network) to capture its topology, including classes, their relationships, and the types of these relationships. Concurrently, we utilize code representation learning techniques to obtain semantic features of the code, which are then used as node attribute features within the network. Finally, we utilize graph neural networks (GNNs) to fuse these two types of features, generating a vector representation that encapsulates both semantic and structural information for design pattern detection task. Experimental results on public datasets show that DPDMF2 achieves 81.7% precision and 82.1% recall, validating the overall effectiveness of our method.
External IDs:dblp:conf/cscwd/LiZZ0J25
Loading