Font Size: a A A

Research On Software Defect Prediction Method Based On Cost Sensitive Learning

Posted on:2022-12-26Degree:MasterType:Thesis
Country:ChinaCandidate:S H LiuFull Text:PDF
GTID:2518306761959879Subject:Automation Technology
Abstract/Summary:PDF Full Text Request
With the in-depth popularization of application software,the complexity and diversity of software are also increasing,followed by the increase of software defects,which will increase the cost of software testing and maintenance,and reduce the user's sense of experience,resulting in the reduction of the number of users and the damage to the company's reputation,or even catastrophic harm.Software defect prediction technology can identify defective software modules in the early stage of software development,help developers repair bugs in time,and improve software quality.In software defect prediction,class imbalance often occurs,that is,the number of samples in defect category is generally much smaller than that in defect free category.At the same time,the loss caused by predicting the defective module as flawless is much greater than that of predicting the flawless module as defective.The cost sensitive learning is to give different misclassification costs to different misclassification situations.Using cost sensitive learning in the defect prediction model can make the software defect prediction model pay more attention to the misclassification of defective modules,so as to improve the classification ability of the prediction model.Based on this,I have read a large number of domestic and foreign literature on software defect prediction and cost sensitive learning.Combined with professional knowledge such as machine learning,I elaborate and analyze the related concepts of software defect prediction and cost sensitive learning,and put forward two software defect prediction methods based on cost sensitive learning:(1)Defect prediction method of cart decision tree based on cost sensitive learning.Firstly,in order to solve the category imbalance,this paper sets different cost sensitive factors in the cost function for the above two different misclassification cases.Secondly,10 groups of cost sensitive factors that perform well in the test set are trained through experiments ? and ?,That is,10 groups of cart decision tree models with excellent performance in the test set are selected and integrated through weighted voting.Finally,this algorithm is compared with some traditional machine learning algorithms to prove the effectiveness of this algorithm.(2)CNN software defect prediction method based on cost sensitive learning.The traditional handmade features can not effectively capture the semantic and structural information of the program,while the deep learning architecture can effectively capture the highly complex nonlinear features.For this reason,this paper proposes a CNN software defect prediction method based on cost sensitive learning.Firstly,the program code is parsed into abstract syntax tree nodes,and each abstract syntax tree node is transformed into string vector,which is transformed into numerical vector through mapping relationship,and the digital vector is input into convolutional neural network to extract the semantic and grammatical features of the code.Secondly,the features obtained through CNN are combined with traditional features to obtain richer feature representation of bug source code.Thirdly,the cost sensitive CNN model is constructed,and the multi head attention mechanism is introduced to make the convolutional neural network selectively receive and process information;At the same time,by adding weight to the loss function,the weight of loss is greater when the model judges the defective samples incorrectly.Finally,the data set is input into the cost sensitive CNN model,and the effectiveness of the algorithm is proved by comparing with the traditional LR model,DBN model,DBN +model and dp-cnn model.
Keywords/Search Tags:Software defect prediction, Cost sensitive learning, Decision tree, Convolutional neural network, Transformer mechanism
PDF Full Text Request
Related items