| In the life of software,the relationship between classes is constantly changing,and unreasonable class relationship design will seriously reduce the quality of the software and increase the cost of system maintenance.In addition,defects in the software will form a cascading propagation effect along with the relationship between the classes,causing the entire system to be affected.Therefore,in the software development process,how to timely and accurately predict the reasonable relationship between classes has become an urgent problem in the software engineering field.In a software project,the relationship between classes can be modeled as a software network,nodes represent classes,and edges represent the relationship between two classes.In the networks of software,the existing research on the relationship prediction between classes mainly uses complex network theory and social network analysis.With the continuous development of deep learning,neural networks have changed the situation of artificially extracting features to obtain information,while graph neural networks has also been applied to automatically process graph data,which provides a new perspective for the prediction of inter-class relationships.Therefore,this article attempts to use graph neural network to learn node features in the software network to realize the prediction of the relationship between classes in the software.The specific work is as follows:(1)We construct a link prediction model based on the graph autoencoder to realize the relationship prediction between classes.Through the analysis of the source code,a software network of class granularity is constructed,and the low-dimensional embedding vector of the class node is obtained by network embedding learning,which is used as the input of the encoder,and the coding feature of the class node is used as the input of the decoder.Finally,for each node pair decode the evaluation value.The experimental results on five practical Java open source projects show that compared with other methods,the AUC and AP values of this method have increased by 5.6% and 5.5% on average,indicating that the graph convolutional neural network method has better relationship predictions between classes effect.(2)A graph of graph neural network model is proposed to further predict the relationship between classes.The software system structure is multi-granularity.The various relationships between classes are embodied as class external diagrams,and the relationships between the internal methods and attributes of the class are also a kind of network structure,which is represented by the class internal diagram,that is,the diagram in the diagram.structure.First,the class internal graph method and attribute node convolution are used to obtain the initial characteristics of the class node,and then the feature vector of the class node is obtained through the class external graph convolution,and finally the evaluation value of the edge between the nodes is calculated.Experimental results on six practical Java open source projects show that the AUC and AP values of the proposed graph model and other comparison methods have increased by 22.1% and 20.7% on average,verifying the effectiveness of the proposed method.The research results can be used to guide the design of reasonable inter-class relationships in the software development process,provide reference for software engineers,and improve the quality of software. |