Font Size: a A A

Block-level Metrics Extraction And Defect Prediction

Posted on:2019-05-22Degree:MasterType:Thesis
Country:ChinaCandidate:T PanFull Text:PDF
GTID:2428330545477962Subject:Computer technology
Abstract/Summary:PDF Full Text Request
Software defect is an error in a software system that can raise system exceptions and crashes.During software development,software defects are difficult to avoid for a variety of reasons.Previous studies showed that bug fixes usually consume 80%of the total project cost during project development.At the same time,previous studies also found that if defects could be found earlier,the cost of repairs would be enormously reduced.Software defect prediction aims to use metrics effectively,which is extracted from the features of code to predict whether the code region contains defects,guaranteeing software quality,saving labor costs and improving software development efficiency.In current software defect prediction,the researchers paid attention to extracting features from code regions and constructing defect prediction model based on file and module level.The results show that the defect prediction model has higher accuracy at these levels.Although the code regions of a file(module)may contain very long lines of code,it is possible to locate a specific file(module)precisely,developers needs to spend a significant amout of time to examine all lines of a file(module)in order to locate a particular bug.Therefore,the researchers tried to extract fine-grained metrics at method level,and proposed method-level defect prediction model and achieved good results.However,it is also observed that there are the hundreds of lines of codes in a method,affecting the efficiency of defects locating.In order to reduce the workload of defect repair and improve the practicality of defect prediction,this paper proposes a metric extraction and defect prediction method that is more fine-grained than the existing studies.Our work is mainly in the following four aspects:(1)giving 12 metric definitions and calculation rules on the basic block level which includes 6 basic metrics which are already defined and 6 CFG metrics,then implementing a metric extraction and defect annotation tool based on basic block level;(2)Extracting basic block metrics and defect data from 9 open source projects with totally 36 versions to form the experimental data set,and making a correlation analysis of these metrics;(3)Using three classification techniques including random forest,logistic regression and Adaboost to construct defect prediction models and using the AUC and CE indicators to evaluate the models.The results of experiment show that:(1)There is no redundant between the CFG metrics and the basic metrics,which has practical significance.(2)The number of transfer variables in CFG metrics and the depth level are strongly related to defects,and basic block metrics can help improve the performance of defect prediction models.(3)In the within-version scenario,when using only the basic metrics,the model built by random forest achieves 0.638 for AUC and 0.106 for CE.When combined with CFG metrics,the prediction performance is significantly improved,0.736 for AUC and 0.283 for CE.Similarly,there are significant improvements in the cross-version scenario.(4)When compared with the static bug finders PMD,the performance of the block-level defect prediction model has been significantly improved.In summary,the CFG metrics contribute to defect prediction,and make the prediction model significantly improved.This paper proposes the definition of basic block metrics,and gives basic block metrics calculating rules.We believe our researches will improve the ability of defect prediction and hence aid pracitioners in developing high quality software systems.
Keywords/Search Tags:basic block, software metric, defect prediction, software maintenance
PDF Full Text Request
Related items