Font Size: a A A

Research On Design Pattern Detection Based On Graph Matching And Graph Neural Network

Posted on:2022-04-22Degree:MasterType:Thesis
Country:ChinaCandidate:W C LiuFull Text:PDF
GTID:2518306542962829Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Design patterns are concise and effective solutions for recurring software design problems.They are high-level abstract forms of software design.The detection of design patterns provides important fundamental work for program understanding,design recovery and system reconfiguration.In recent years,it has been a research hot spot for many scholars in the field of software design.However,due to the high abstraction of design patterns,the existing design pattern detection methods still have some limitations.For example,the detection efficiency is low,the accuracy is poor and the applicability is weak.In order to solve these problems,this thesis proposes two detection methods.Firstly,a design pattern detection method based on graph neighborhood matching is proposed.This method firstly models the software system as a complex network diagram,then use the characteristics of complex network to analyze network to obtain the important node set in the graph,and then take the important node as the starting node,through traversing the neighbor nodes to achieve the matching with the pattern graph,complete the task of design pattern detection.Finally,comparative experiments are carried out on four open-source projects.The experimental results show that compared with other detection methods,the precision and recall of this method have been improved to a certain extent,and it has better design pattern detection efficiency.Secondly,a design pattern detection method based on graph neural network is proposed.This method expands the code granularity from class-level to micro-structure in the process of node feature extraction,and then uses the score-based method to mark samples.The node features and named features of the samples are used to generate feature vectors,which are combined with the network structure of the nodes to be input into the model for training,generate role prediction results with unknown labels.The experiment of this method covers three types of design patterns,namely Creative,Behavior and Structural.Compared with the traditional machine learning algorithm,the detection effect has been better improved,which proves that this method can not only realize the detection of multiple patterns,but also has higher accuracy.In this thesis,the research is carried out under the background of reverse software engineering.In the research process,knowledge of complex networks,graph neural networks and other fields are applied,and it shows good results in the detection of design patterns.Through the detection of design patterns in the source code,it is of great significance for future software refactoring and maintenance.
Keywords/Search Tags:Design pattern, Network analysis, Graph matching, Graph neural network
PDF Full Text Request
Related items