| 引用本文: | 邓文涛,程璨,何鹏,陈孟瑶,李兵.基于图神经网络的多粒度软件系统交互关系预测.软件学报,2025,36(5):2043-2063 |
| |
|
| |
|
|
| 本文已被:浏览 1718次 下载 3434次 |
 码上扫一扫! |
|
|
| 基于图神经网络的多粒度软件系统交互关系预测 |
|
邓文涛1,2,3, 程璨4,3, 何鹏1,3, 陈孟瑶1,3, 李兵5
|
|
1.湖北大学 计算机与信息工程学院, 湖北 武汉 430062;2.武汉工商学院 计算机与自动化学院, 湖北 武汉 430065;3.智能感知系统与安全教育部重点实验室 (湖北大学), 湖北 武汉 430062;4.湖北大学 人工智能学院, 湖北 武汉 430062;5.武汉大学 计算机学院, 湖北 武汉 430072
|
|
| 摘要: |
| 当下, 软件系统中元素间的交互错综复杂, 涵盖了包间、类间和函数间等多种关系. 准确理解这些关系对于优化系统结构以及提高软件质量至关重要. 分析包间关系有助于揭示模块间的依赖性, 有利于开发者更好地管理和组织软件架构; 而类间关系的明晰理解则有助于构建更具扩展性和可维护性的代码库; 清晰了解函数间关系则能够迅速定位和解决程序中的逻辑错误, 提升软件的鲁棒性和可靠性. 然而, 现有的软件系统交互关系预测存在着粒度差异、特征不足和版本变化等问题. 针对这一挑战, 从软件包、类和函数这3种粒度构建相应的软件网络模型, 并提出一种结合局部和全局特征的全新方法, 通过软件网络的特征提取和链路预测方式, 来增强对软件系统的分析和预测. 该方法基于软件网络的构建和处理, 具体步骤包括利用node2vec方法学习软件网络的局部特征, 并结合拉普拉斯特征向量编码以综合表征节点的全局位置信息. 随后, 利用Graph Transformer模型进一步优化节点属性的特征向量, 最终完成软件系统的交互关系预测任务. 在3个Java开源项目上进行广泛的实验验证, 包括版本内和跨版本的交互关系预测任务. 实验结果显示, 相较于基准方法, 所提方法在版本内的预测任务中, 平均AUC和AP值分别提升8.2%和8.5%; 在跨版本预测任务中, 平均AUC和AP值分别提升3.5%和2.4%. |
| 关键词: 软件网络 交互关系预测 Graph Transformer 粒度差异 软件质量 |
| DOI:10.13328/j.cnki.jos.007207 |
| 分类号:TP311 |
| 基金项目:国家自然科学基金(62032016); 湖北省自然科学基金青年项目(2023AFB374) |
|
| Interaction Prediction of Multi-granularity Software System Based on Graph Neural Network |
|
DENG Wen-Tao1,2,3, CHENG Can4,3, HE Peng1,3, CHEN Meng-Yao1,3, LI Bing5
|
|
1.School of Computer Science and Information Engineering, Hubei University, Wuhan 430062, China;2.School of Computer Science and Automation, Wuhan Technology and Business University, Wuhan 430065, China;3.Key Laboratory of Intelligent Sensing System and Security (Hubei University), Ministry of Education, Wuhan 430062, China;4.School of Artificial Intelligence, Hubei University, Wuhan 430062, China;5.School of Computer Science, Wuhan University, Wuhan 430072, China
|
| Abstract: |
| The interactions between elements in contemporary software systems are notably intricate, encompassing relationships between packages, classes, and functions. Accurate comprehension of these relationships is pivotal for optimizing system structures and enhancing software quality. Analyzing inter-package relationships can help unveil dependencies between modules, thereby assisting developers in more effectively managing and organizing software architectures. On the other hand, a clear understanding of inter-class relationships contributes to the creation of code repositories that are more scalable and maintainable. Moreover, a clear understanding of inter-function relationships facilitates rapid identification and resolution of logical errors within programs, consequently enhancing the robustness and reliability of the software. However, current predictions of software system interaction confront challenges such as granularity disparities, inadequate features, and version changes. To address this challenge, this study constructs corresponding software network models based on the three granularities, including software packages, classes, and functions. It introduces a novel approach combining local and global features to reinforce the analysis and prediction of software systems through feature extraction and link prediction of software networks. This approach is based on the construction and handling of software networks, involving specific steps such as leveraging the node2vec method to learn local features of software networks and combining Laplacian feature vector encoding to comprehensively represent the global positional information of nodes. Subsequently, the Graph Transformer model is employed to further optimize the feature vectors of node attributes, culminating in the completion of the interaction prediction task of the software system. Extensive experimental validations are conducted on three Java open-source projects, encompassing within-version and cross-version interaction prediction tasks. The experimental results demonstrate that, compared to benchmark methods, the proposed approach achieves an average increase of 8.2% and 8.5% in AUC and AP values, respectively in within-version prediction tasks. This approach reaches an average rise of 3.5% and 2.4% in AUC and AP values, respectively, in cross-version prediction tasks. |
| Key words: software network interaction prediction Graph Transformer granularity difference software quality |
|
|
|
|