电子学报 ›› 2021, Vol. 49 ›› Issue (2): 216-224.DOI: 10.12263/DZXB.20200607

• 学术论文 • 上一篇    下一篇

基于编译优化的软件缺陷预测研究

陈勇, 徐超, 何炎祥, 沈凡凡   

  1. 1. 南京审计大学信息工程学院, 江苏南京 211815;
    2. 武汉大学计算机学院, 湖北武汉 430072
  • 收稿日期:2020-06-22 修回日期:2020-08-27 出版日期:2021-02-25
    • 通讯作者:
    • 徐超
    • 作者简介:
    • 陈勇 男,1986年出生,湖南娄底人.博士、高级工程师,研究方向为软件可靠性、编译优化、大数据审计、嵌入式系统优化.E-mail:chenyong@nau.edu.cn
    • 基金资助:
    • 国家自然科学基金 (No.71972102,No.61640220,No.61902189); 教育部人文社会科学研究规划基金 (No.19YJAZH100); 南京审计大学青年教师科研培育项目 (No.19QNPY018); 江苏省自然科学基金 (No.BK20180821)

The Research of Compilation Optimization on Software Defect Prediction

CHEN Yong, XU Chao, HE Yan-xiang, SHEN Fan-fan   

  1. 1. School of Information Engineering, Nanjing Audit University, Nanjing, Jiangsu 211815, China;
    2. School of Computer Science, Wuhan University, Wuhan, Hubei 430072, China
  • Received:2020-06-22 Revised:2020-08-27 Online:2021-02-25 Published:2021-02-25

摘要: 软件缺陷预测有助于提高软件质量,合理配置软件测试资源,目前已经有不少基于软件度量指标的缺陷预测模型.然而,现有的软件度量指标主要集中在源代码的结构信息上,程序语义信息考虑较少.编译优化是对程序语义进行深入分析的结果,直观地认为它应该在一定程度上能够反映程序的语义信息,有助于软件缺陷预测.因此,为分析编译优化度量指标对软件缺陷预测的影响,本文首先基于当前编译器中广泛使用的优化选项,设计了9种编译优化度量指标.结合源代码结构层面的度量指标,构建了5种软件缺陷预测度量模型.利用weka中提供的13种常用的分类器,对比分析了添加不同优化度量指标的模型效果,对编译优化度量与软件缺陷预测之间的关系进行了评价,同时与DP-CNN(Defect Prediction via Convolutional Neural Network)模型进行了对比.实验结果表明:编译优化度量指标对软件缺陷预测的召回率有显著影响;在代码复杂度度量指标的基础上增加编译优化度量指标,可以提升所有软件缺陷预测模型的性能,平均提升幅度约为5%;基于代码大小的优化度量和基于性能的优化度量具有各自的特点,两者相结合可以在软件缺陷预测中获得更好的性能.

 

关键词: 编译优化, 软件度量, 软件缺陷预测

Abstract: Software defect prediction helps improve software quality and allocate software test resources reasonably.Many defect prediction models based on software metrics have been proposed.However,the existing software metrics are mainly focused on structure information of source code,and the semantic information is lacking.Compilation optimization is the result of deep analysis of program semantics,and intuitively we believe that it should reflect the semantic information of the program in some ways to help defect prediction.Based on the optimization options widely used in the current compiler,this paper extracts 9 compilation optimization metrics,and proposes five types of metrics models that designed by different metrics sets.The relationship between compilation optimization metrics and software defect predictions was evaluated by 13 commonly used classifiers in weka,and also compared with DP-CNN.Experimental results show:Compilation optimization metrics have a significant impact on the recall rate of software defect prediction;Static code metrics combined with compilation optimization metrics can improve the performance of software defect prediction in all classifiers,which can improve the performance of prediction by about 5%;Code size based optimization metrics and performance based optimization metrics have their characteristics,combined both of them can get better performance in software defect prediction.

 

Key words: compilation optimization, software metrics, software defect prediction

中图分类号: