Efficient automatic bug triage is an important means to guarantee the quality of open-source software. Most of the existing researches are based on the machine learning approach to study the bug triaging from the relationship between the text content of the bug reports and the relationship between developers. However, there is little attention to the correlation between bug reports and the deep learning based bug triaging method. Aiming at the problem of automatic bug triage, this paper proposes a developer recommendation method based on the graph convolutional neural network (GCN). Firstly, the bug reports network is constructed by using the cosine similarity with weights, and then the GCN network model is trained for developer recommendation under the incremental learning method. In this paper, three methods proposed in recent years are set as experimental control groups. Experiments are carried out on the large-scale open-source software project Eclipse and Mozilla datasets. The results show that the average recommended accuracy of the proposed method is about 60% and 70% higher than that of the other three methods.
一些研究表明[16,17,23,24,25,26],除缺陷报告的摘要外,缺陷报告其他属性,如产品、组件和参与人属性也对缺陷分派的准确率有重要的影响。本文使用缺陷报告的参与人、产品、组件和摘要4个属性,基于余弦相似度来衡量缺陷报告间的相似度。任意两个缺陷报告 k 和 m 间的相似度s( k,m )的计算如下
其中,n表示缺陷报告向量的维度,ki 和mi 分别为 k 和 m 的第i维分量。
针对有N个缺陷报告的数据集,我们将缺陷报告作为网络节点,令vi 表示图中的节点,V为网络的节点集,viV。由于邻接矩阵是网络图的常用存储表示,本文亦采用邻接矩阵 A 表示缺陷报告节点间的链边信息。若缺陷报告 k 和 m 之间的相似度s( k,m )大于或等于α,则Akm =1,即两个缺陷报告之间存在链边;反之,Akm =0,即 k 和 m 之间不存在链边,即
因此,根据公式(1)和(2)可以构建出缺陷报告网络G=(V,E, A ),其中,eij 表示vi 和vj 间的链边,E为网络的链边集合,eijE。
2 图卷积神经网络模型
2.1 基于半监督学习的图卷积神经网络
本文采用Defferrard等[20]和Kipf等[27]提出的半监督机制的图卷积神经网络模型(semi-supervised graph convolutional neural network,SGCN)来实现开发者的推荐。基于半监督学习的图神经网络模型的本质思想是:通过图(或网络)结构数据中部分被标记的节点训练神经网络结构模型,使网络模型预测出未标记节点的标签。针对缺陷报告网络G=(V,E, A ),节点vi 的特征向量记为 Xi,D为特征的维度。网络中节点的属性特征矩阵记为 X。
SGCN模型在损失函数
中引入图拉普拉斯正则化项
来防止过拟合,其中L0为监督损失(即被标记的节点)。通过在输入图的邻接矩阵 A 上调整函数f(⋅),使得模型能从监督损失L0中分配梯度信息,从而能学习带标签或不带标签节点的表示。
2.2 图卷积操作
根据Weisfeiler-Lehman算法[28],将图上的谱卷积定义为节点特征向量 x 和卷积核在傅里叶域上的积,图卷积定义为
其中, U 是规范化图拉普拉斯的特征向量矩阵。SGCN模型采用切比雪夫多项式Tk (x)到K阶截断的卷积核,即它只依赖于距离中心节点(K阶邻域)最大K步的邻居节点。卷积核定义如下
其中,, IN 为单位矩阵,λmax为拉普拉斯矩阵 L 的最大特征值,是切比雪夫系数的矢量。
基于卷积核(6)式,可以得到卷积如下
其中,,当K=1,即只考虑一阶邻域中的节点,此时的卷积操作关于拉普拉斯矩阵 L 是线性的。因此,在这个线性卷积公式中,进一步将λmax近似等于2,则(7)式可简化为
和两个自由滤波参数在整个图上被共享。令==,将两个参数简化为一个参数,得到
的取值为[0,2],重复这个卷积可能导致梯度爆炸或梯度消失,因此将归一化为。其中,是 A 的带自环邻居矩阵,为邻接矩阵的度矩阵()。将(9)式表达为更一般化,即在C维特征向量的节点和F个滤波器下,卷积(9)式可写为
由于获取的缺陷报告数据具有时序性,本文所有实验采用基于折叠训练与验证(folding-based training and validation)的增量学习方法[29]。首先,按缺陷报告的修复完成的关闭时间,顺序地对Eclipse和Mozilla数据集排序,并将两个数据集均匀等分为n份。第1次实验时,使用第1份数据作为训练集,并将第2份作为测试集。第2次实验时,将第2份数据加到训练集,将第3份数据作为测试集。一般来说,在第i次实验时,用前i份数据作为训练集,第i+1份数据作为测试集。增量学习法划分训练集和测试集示意图如图4所示。与Bhattacharya等[29]的划分方法类似,在增量学习方法中设置n=10,即数据被划分为10份。
本文设置了4组对比实验来验证本文提出的SGCN模型的有效性,其中第1组为考虑缺陷报告间链边权重下基于GCN模型的开发者推荐模型(记为Ga);第2、3组分别为近两年提出的缺陷自动分派的开发者推荐新方法[18,31],即Wu等[31]提出的基于开发者因素的机器学习方法(记为Gb)和Mani等[18]基于递归神经网络的深度学习方法(记为Gc);第4组为Mani等在文献[18]使用的组合BOW(Bag of Words)和多项式贝叶斯(MNB)模型的开发者推荐方法(记为Gd)。
ZHANGJ, WANGX Y, HAOD, et al. A survey on bug-report analysis [J]. Science China (Information Sciences), 2015, 58(2): 21101.
[2]
ANVIKJ, HIEWL, MURPHYG C. Who should fix this bug? [C]// Proceedings of the 28th International Conference on Software Engineering. New York: ACM, 2006: 361-370. DOI:10.1145/1134285.1134336 .
[3]
ANVIKJ. Automating bug report assignment [C]// Proceedings of the 28th International Conference on Software Engineering. New York: ACM, 2006: 937-940. DOI:10.1145/1134285.1134457 .
[4]
LIUS. Projected revenue of open source software from 2008 to 2020 [DB/OL]. [2019-02-12].
LINZ P, SHUF D, YANGY, et al. An empirical study on bug assignment automation using Chinese bug data [C]// Proceedings of the 2009 3rd International Symposium on Empirical Software Engineering and Measurement.New York: IEEE, 2009: 451-455. DOI:10.1109/ESEM.2009.5315994 .
[7]
XIEX H, ZHANGW, YANGY, et al. Dretom: Developer recommendation based on topic models for bug resolution [C]// Proceedings of the 8th International Conference on Predictive Models in Software Engineering.New York: ACM, 2012: 19-28. DOI:10.1145/2365324.2365329 .
[8]
NAGUIBH, NARAYANN, BRUEGGEB, et al. Bug report assignee recommendation using activity profiles [C]// Proceedings of the 10th Working Conference on Mining Software Repositories. New York: IEEE Press, 2013: 22-30. DOI:10.1109/MSR.2013.6623999 .
[9]
XIAX, LO D, DINGY, et al. Improving automated bug triaging with specialized topic model [J]. IEEE Transactions on Software Engineering, 2017, 43(3): 272-297.
[10]
BERTRAMD, VOIDAA, GREENBERGS, et al. Communication, collaboration, and bugs: The social nature of issue tracking in small, collocated teams [C]// Proceedings of the 2010 ACM Conference on Computer Supported Cooperative Work. New York: ACM, 2010: 291-300. DOI:10.1145/1718918.1718972 .
[11]
ZHANGW Q, NIEL M, JIANGH, et al. Developer social networks in software engineering: Construction, analysis, and applications [J]. Science China (Information Sciences), 2014, 57(12): 1-23.
[12]
BHATTACHARYAP, NEAMTIUI. Fine-grained incremental learning and multi-feature tossing graphs to improve bug triaging [C]// 2010 IEEE International Conference on Software Maintenance. New York: IEEE Press, 2010: 1-10. DOI:10.1109/ICSM.2010.5609736 .
[13]
WUW J, ZHANGW, YANGY, et al. Drex: Developer recommendation with K-nearest-neighbor search and expertise ranking [C]// 2011 18th Asia⁃Pacific Software Engineering Conference. New York: IEEE Press, 2011: 389-396. DOI:10.1109/APSEC.2011.15 .
[14]
ZHANGT, LEE B. An Automated Bug Triage Approach: A Concept Profile and Social Network Based Developer Recommendation [M]. Berlin: Springer, 2012: 505-512.
[15]
PARKJ W, LEE M W, KIMJ, et al. Cost-aware triage ranking algorithms for bug reporting systems [J]. Knowledge and Information Systems, 2016, 48(3): 679-705.
[16]
ZHANGW, WANGS, WANGQ. Ksap: An approach to bug report assignment using KNN search and heterogeneous proximity [J]. Information and Software Technology, 2016, 70:68-84. DOI:10.1016/j.infsof.2015.10.004 .
[17]
WANGS, ZHANGW, YANGY, et al. Devnet: Exploring developer collaboration in heterogeneous networks of bug repositories [C]// 2013 International Symposium on Empirical Software Engineering and Measurement. New York: IEEE Press, 2013: 193-202. DOI:10.1109/ESEM.2013.24 .
[18]
MANIS, SANKARANA, ARALIKATTER. Deeptriage: Exploring the effectiveness of deep learning for bug triaging [C]// Proceedings of the ACM India Joint International Conference on Data Science and Management of Data. New York: ACM, 2019: 171-179. DOI:10.1145/3297001.3297023 .
[19]
LEE S R, HEO M J, LEE C G, et al. Applying deep learning based automatic bug triager to industrial projects [C]// Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering. New York: ACM, 2017: 926-931. DOI:10.1145/3106237.3117776 .
[20]
DEFFERRARDM, BRESSONX, VANDERGHEYNSTP. Convolutional neural networks on graphs with fast localized spectral filtering [C]// Proceedings of the 30th International Conference on Neural Information Processing Systems. New York: Curran Associates Inc, 2016: 3844-3852. DOI:10.1109/MSP.2017.2693418 .
[21]
ZHANGZ W, CUIP, ZHUW W. Deep learning on graphs: A survey [DB/OL].[2019-04-21].
[22]
SERRANON, CIORDIAI. Bugzilla, itracker, and other bug trackers [J]. IEEE Software, 2005, 22(2): 11-13.
[23]
AHSANSN, FERZUNDJ, WOTAWAF. Automatic software bug triage system (BTS) based on latent semantic indexing and support vector machine [C]// 2009 4th International Conference on Software Engineering Advances. New York: IEEE, 2009: 216-221. DOI:10.1109/ICSEA.2009.92 .
[24]
SHOKRIPOURR, ANVIKJ, KASIRUNZ M, et al. Why so complicated?Simple term filtering and weighting for location-based bug report assignment recommendation [DB/OL].[2019-04-23].
[25]
XIAX, LO D, WANGX Y, et al. Accurate developer recommendation for bug resolution [DB/OL].[2019-03-03].
[26]
XIAX, LO D, WANGX Y, et al. Dual analysis for recommending developers to resolve bugs [J]. Journal of Software: Evolution and Process, 2015, 27(3): 195-220.
[27]
KIPFT N, WELLINGM. Semi-supervised classification with graph convolutional networks [DB/OL].[2019-05-05].
[28]
SHERVASHIDZEN, SCHWEITZERP, JAN E, et al. The Weisfeiler-Lehman method and graph isomorphism testing [J]. Journal of Machine Learning Research, 2011, 12(2011): 2539-2561.
[29]
BHATTACHARYAP, NEAMTIUI, SHELTONC R. Automated, highly-accurate, bug assignment using machine learning and tossing graphs [J]. Journal Systems Software, 2012, 85(10): 2275-2292.
[30]
WITTENI H, FRANKE, HALLM A, et al. Data Mining: Practical Machine Learning Tools and Techniques [M]. San Francisco:Morgan Kaufmann, 2012.
[31]
WUH R, LIUH Y, MAY T. Empirical study on developer factors affecting tossing path length of bug reports [J]. IET Software, 2018, 12(3): 258-270.