计算机应用 ›› 2015, Vol. 35 ›› Issue (3): 882-885.DOI: 10.11772/j.issn.1001-9081.2015.03.882

• 行业与领域应用 • 上一篇    下一篇

失效上下文统计分析的软件故障定位方法

王克朝1,2, 王甜甜2, 任向民1, 贾宗福1   

  1. 1. 哈尔滨学院 软件学院, 哈尔滨 150086;
    2. 哈尔滨工业大学 计算机科学与技术学院, 哈尔滨 150001
  • 收稿日期:2014-09-28 修回日期:2014-11-14 出版日期:2015-03-10 发布日期:2015-03-13
  • 通讯作者: 王克朝
  • 作者简介:王克朝(1980-),男,河南南阳人,讲师,博士研究生,主要研究方向:软件错误定位;王甜甜(1980-),女,辽宁丹东人,副教授,博士,主要研究方向:软件自动化调试、计算机辅助教学;任向民(1972-),男,黑龙江齐齐哈尔人,教授,博士,主要研究方向:软件工程、隐私数据保护;贾宗福(1963-),男,黑龙江哈尔滨人,教授,主要研究方向:软件工程、计算机教育
  • 基金资助:

    哈尔滨学院青年基金资助项目(HUYF2014-007);黑龙江省高教学会"十二五"重点规划课题(HGJXHA1110950);黑龙江省教育科学规划青年专项课题(GJD1214038);国家自然科学基金资助项目(61202092);高等学校博士学科点专项科研基金资助项目(20112302120052);哈尔滨科技创新人才研究专项资金资助项目(RC2013QN010001,2014RFQXJ062);黑龙江省普通高校青年学术骨干项目;黑龙江省自然科学基金资助项目(F201127)

Software fault localization approach by statistical analysis of failure context

WANG Kechao1,2, WANG Tiantian2, REN Xiangmin1, JIA Zongfu1   

  1. 1. School of Software, Harbin University, Harbin Heilongjiang 150086, China;
    2. School of Computer Science and Technology, Harbin Institute of Technology, Harbin Heilongjiang 150001, China
  • Received:2014-09-28 Revised:2014-11-14 Online:2015-03-10 Published:2015-03-13

摘要:

针对程序切片方法不提供语句的可疑程度描述,而覆盖分析方法不能充分分析程序元素间的相互影响等问题,提出上下文统计分析的软件故障定位方法。首先,将源程序转换为抽象语法树和程序依赖图;接下来,插桩程序,收集运行时信息;然后,根据失效点,执行按需的反向动态切片,确定失效产生的上下文;最后,对于反向动态切片中的节点,统计计算可疑度,输出带可疑度排序的动态程序切片。该方法不但描述了失效产生的上下文,还计算上下文中各个语句的可疑度。实验结果表明,所提方法与单一的覆盖分析方法相比,平均Expense降低了1.3%,与单一的切片方法相比,平均Expense降低了5.6%,所提方法可以有效辅助开发人员定位与修正软件缺陷。

关键词: 软件调试, 故障定位, 动态切片, 覆盖分析, 失效上下文

Abstract:

The program slicing approach does not describe the suspiciousness of statements, while the coverage analysis based fault localization approach does not analyze the relationship between statements. To solve these problems, a software fault localization approach by statistical analysis of failure context was proposed. Firstly, source code was transformed to an abstract syntax tree and program dependence graphs. Then, instrumentation was performed based on the abstract syntax tree to collect execution information. Next, starting from the failure point, dynamic program slicing based on requirement was conducted in order to get the context of failure. Finally, suspiciousness of nodes in the reverse dynamic program slice was computed, and a dynamic program slice with suspiciousness ranking was output. The proposed approach could not only describe the failure context, but also gave the suspiciousness of the statements. The experimental results show that it has an average 1.3% and 5.6% expense decrease compared with the coverage based analysis approach and the slicing approach respectively, so that it can facilitate the localization and fixing of bugs.

Key words: software debugging, fault localization, dynamic slicing, coverage analysis, failure context

中图分类号: