• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2022, Vol. 44 ›› Issue (12): 2187-2195.

• 软件工程 • 上一篇    下一篇

融合语句复杂度的软件错误定位轻量级方法

何海江   

  1. (长沙学院计算机工程与应用数学学院,湖南 长沙 410022)

  • 收稿日期:2021-11-25 修回日期:2022-04-13 接受日期:2022-12-25 出版日期:2022-12-25 发布日期:2023-01-04
  • 基金资助:
    湖南省科技计划(2015GK3071)

A lightweight software fault localization method based on statement complexity

 HE Hai-jiang   

  1. (College of Computer Engineering and Applied Mathematics,Changsha University,Changsha 410022,China)
  • Received:2021-11-25 Revised:2022-04-13 Accepted:2022-12-25 Online:2022-12-25 Published:2023-01-04

摘要: 在程序调试过程中,基于程序谱的软件错误定位(SBFL)技术能提供有效的帮助。为改善SBFL的性能,提出一种组合程序谱、代码行静态属性的软件错误定位排序学习方法,由线性排序支持向量机学习最优错误定位模型。代码行静态属性包括局部变量、类属性、逻辑运算符和方法调用等程序实体的个数。在使用C、C++和Java语言开发的22个实际故障项目上,采用跨工程的形式训练错误定位模型。实验结果表明,新方法比最优SBFL减少了37.1%的最坏策略EXAM和22.6%的平均策略EXAM。还比较了程序语句的3类轻量级特征:结构化类别、变量谱和静态属性。新方法的时间复杂度低,能实时地推荐可能出现故障的语句序列。

关键词: 软件错误定位, 程序谱, 变量谱, 程序静态属性, 排序学习, 跨工程

Abstract: In the program debugging process, software fault localization (SBFL) technology based on the program spectrum can provide effective help. In order to improve the performance of SBFL, a software fault localization method based on learning to rank is proposed, which combines program spectrum and static attributes of code statements. The optimal fault localization model is learned by the linear ranking support vector machine. The static attributes of code statements include the number of program entities such as local variables, class attributes, logical operators, and method invocations. On 22 actual fault projects developed in C, C++ and Java languages, the fault localization model was trained on the form of cross engineering. Experimental results confirm that the proposed method reduces the worst strategy EXAM by 37.1% and the average strategy EXAM by 22.6% compared with the optimal SBFL. Three types of lightweight features of program statements are also compared: structured categories, variable spectrum and static attributes. The time complexity of the proposed method is low, and it can recommend a sequence of sentences that may fail in real time.

Key words: software fault localization, program spectrum, variable spectrum, program static attri- bute, learning to rank, cross project