计算机工程与应用 ›› 2020, Vol. 56 ›› Issue (22): 66-73.DOI: 10.3778/j.issn.1002-8331.2001-0152

• 理论与研发 • 上一篇    下一篇

基于遗传算法的函数级别软件错误定位

黄晴雁,牟永敏,崔展齐,张志华   

  1. 1.北京信息科技大学 计算机学院,北京 100101
    2.北京信息科技大学 网络文化与数字传播北京市重点实验室,北京 100101
  • 出版日期:2020-11-15 发布日期:2020-11-13

Function-Level Software Fault Location Based on Genetic Algorithm

HUANG Qingyan, MU Yongmin, CUI Zhanqi, ZHANG Zhihua   

  1. 1.Computer College, Beijing Information Science and Technology University, Beijing 100101, China
    2.Beijing Key Laboratory of Internet Culture and Digital Dissemination Research, Beijing Information Science and Technology University, Beijing 100101, China
  • Online:2020-11-15 Published:2020-11-13

摘要:

针对软件开发过程中的错误定位问题,提出一种以函数调用路径和遗传算法为基础的软件错误定位方法FGAFL。将软件测试中的错误定位问题转化为组合优化问题,结合函数调用路径对错误定位的影响构建适应度函数。通过遗传算法在候选种群中迭代搜索具有较高可疑度的候选错误分布,得到最优解。根据最优解对程序中的函数按可疑度进行排序,依次检查函数并定位错误的具体位置。实验表明,FGAFL方法可以有效降低运算量并缩减代码审查的范围,提高错误定位的精度和效率。

关键词: 错误定位, 函数调用路径, 遗传算法, 适应度函数

Abstract:

For fault location in software development based on function call path and genetic algorithm, this paper proposes a software fault location method called FGAFL. Firstly, the proposed method transforms fault location into combinatorial optimization in software testing, and constructs fitness function based on the influence of function call path. Then, to obtain the optimal solution, the method searches the candidate fault distribution with high suspicious degree in the candidate population iteratively by genetic algorithm. Finally, according to the optimal solution, the functions in the program are sorted according to the suspicious degree, while the proposed method checks the functions in that order and locate the faults. Experimental results show that FGAFL can reduce the amount of computation and the scope of code review effectively, so as to improve the accuracy and efficiency of fault location.

Key words: fault location, function call path, genetic algorithm, fitness function