国家自然科学基金(62102136, 61902114, 61977021); 湖北省重点研发项目(2021BAA184, 2021BAA188); 湖北省科技创新计划(2019ACA144, 2020AEA008)
软件系统是一个复杂的人工制品, 类之间的交互关系对软件质量有着潜在影响, 如软件缺陷的级联传播效应就是一个典型. 如何准确预测软件系统中类之间合理关系, 优化设计结构是软件质量保障的一个开放问题. 从软件网络观的视角, 综合考虑软件系统中类与类之间关系(外部图), 以及每个类内部方法之间关系(内部图), 将软件系统抽象成一个图中图结构的软件网络, 并在此基础上提出一种基于图中图卷积神经网络的类交互关系预测方法. 首先对每个类内部图进行卷积得到类节点的初始特征, 再通过外部图的卷积更新类节点的表征向量, 最后通过计算类节点对的评估值进行交互预测. 根据在6个Java开源项目上的实验结果显示, 图中图结构有助于提高软件系统结构的表征能力, 且所提方法与常规网络嵌入方法相比, AUC值和AP值的平均增长率超过5.5%. 与此同时, 和两种同行方法相比, AUC值和AP值的平均增长率分别在9.36%和5.22%以上.
As a software system is a complex artifact, the interaction between classes exerts a potential impact on software quality, with the cascading propagation effect of software defects as a typical case. How to accurately predict the reasonable relationship between classes in the software system and optimize the design structure is still an open problem in software quality assurance. From the perspective of software network, this study comprehensively considers the interactions between classes in a software system (class external graph, CEG), and those between internal methods of each class (class internal graph, CIG). The software system is abstracted into a software network with a graph of graphs structure. As a result, a class interaction prediction method based on the graph of graphs convolutional network is proposed. Firstly, the initial characteristics of class nodes are obtained through the convolution of each CIG. Then the representation vector of class nodes is updated through the convolution of CEG, and finally, the evaluation values between class nodes are calculated for interaction prediction. The experimental results on six Java open source projects show that the graph of graphs structure is helpful to improve the representation of software system structure. The average growth rates of the area under the curve (AUC) and average precision (AP) of the proposed method are more than 5.5% compared with those of the conventional network embedding methods. In addition, the average growth rates of AUC and AP are more than 9.36% and 5.22%, respectively compared with those of the two peer methods.