计算机与现代化 ›› 2013, Vol. 1 ›› Issue (3): 12-16.doi:

• 算法分析与设计 • 上一篇    下一篇

基于概率推演的动态程序切片优先度计算方法

夏嘉斌   

  1. 上海交通大学软件学院,上海200240
  • 收稿日期:2012-11-02 修回日期:1900-01-01 出版日期:2013-04-03 发布日期:2013-04-03

Prioritizing Dynamic Program Slices Based on Probabilistic Inference

XIA Jia-bin   

  1. School of Software, Shanghai Jiao Tong University, Shanghai 200240, China
  • Received:2012-11-02 Revised:1900-01-01 Online:2013-04-03 Published:2013-04-03

摘要: 为了提高程序调试的效率,本文提出一种基于概率推演自动计算动态程序切片中每条语句的正确概率并赋予优先度的方法。首先从程序运行过程抽取其相应的动态依赖关系图;然后根据依赖关系转化成贝叶斯网络;最后在该网络上运行概率推演并统计,得到程序静态语句的正确概率。使用具有优先度的动态程序切片结果可进一步提高调试人员定位缺陷和分析故障的效率。实验表明本方法平均可将实际错误排名在切片结果的前20.2%。

关键词: 动态切片, 程序调试, 概率推演, 自动化程序分析, 错误定位

Abstract: In order to increase the productivity of the debugging process, this paper proposes a novel strategy for prioritizing dynamic program slices by automatically calculating the probability of correctness of each statement based on the dynamic slices. First, a runtime dependence graph of the observed program outcome is extracted. The next step is the transformation from the dependence network to a Bayesian network. Finally, run a probabilistic inference for the likelihood of correctness of the execution instances and estimates the corresponding correctness of the static statements. Programmers can administer a guided bug locating process using this ranking of correctness belief. The results shows that on average our tool rank the faults to 20.2% of the dynamic slices.

Key words: dynamic slicing, debugging, probabilistic inference, automated program analysis, fault localization