为提高基于程序切片和覆盖信息的传统错误定位技术的效率,提出一种基于程序动态切片和贝叶斯相结合的错误定位方法。针对程序执行轨迹计算动态切片,减少搜索空间;在切片后覆盖信息的基础上,利用贝叶斯公式计算相关语句的可疑度;根据语句可疑度降序排列语句,依次检查直到找出真正的错误语句。实验结果表明,该方法能够在一定程度上提高软件错误定位的效率与精度。
To improve the efficiency of traditional fault localization techniques based on the program slicing and coverage informa- tion, an approach for automatically fault localization based on the program dynamic slice and Bayesian theory was presented. Firstly, dynamic slicing upon the program execution trace was calculated, which narrowed down the search scope. Secondly, the Bayesian statistical model was applied to calculate the suspiciousness value of statements based on the coverage information. The statements were ranked in descending order by the suspiciousness value, and the real fault statement was identified according to the ranking list. The experimental results show that the approach can improve the efficiency and accuracy of fault localization to a certain extent.