节点文献

基于程序执行的错误定位方法

【作者】 田志雨

【导师】 张宏;

【作者基本信息】 南京理工大学 , 计算机应用技术, 2012, 硕士

【摘要】 软件调试是软件开发和维护中最为耗时耗力的部分,而其中的错误定位是最为重要且最为困难的。传统的错误定位方法往往是采用手工定位的方法(比如借助于调试工具设置断点),但是这类方法缺点是可能出错的语句的搜索空间巨大,且往往耗费大量的精力和时间。因此目前在错误定位方面的主要研究内容是自动化错误定位,这类方法主要的手段是借助于设计良好的测试用例集,通过对测试结果和程序特征的自动化分析,计算出可能出错语句的集合。基于程序行为特征的自动化错误定位方法一般根据覆盖信息计算出程序语句的可疑度,然后按照可疑度由高到低的顺序逐条检查程序的可疑语句。为了提高定位错误的效率,本文对现有的基于程序行为特征的方法进行改进。首先,通过对目前的自动化错误定位方法的研究对比,给出了几种基于程序执行的错误定位方法:基于测试用例对语句可疑度的贡献随着测试用例数目的增加而降低(简记为贡献率的降低)的思想给出了方法Heuristic1,基于程序执行补集的概念给出Heuristic2和Heuristic3,基于贡献率的降低的思想和Tarantula的思想给出了Heuristic4。其次,给出了一个具有可视化界面的通用的自动化错误定位架构的实现流程,其中的可视化是为了方便调试人员查看可疑的语句。最后,为了验证方法的有效性,本文根据前面给出的流程实现了一个自动化的错误定位工具Visualdebug,采用测试数据集Siemens Suite作为研究对象,将本文提出的方法和现有的几种方法进行比较。实验结果表明,较之于同类思想的方法,Heuristic1方法的效率略有提高,而Heuristic2、Heuristic3和Heuristic4方法表现出60%左右程序只需要检查20%左右的代码。由此可见本文提出的方法在错误定位的效率方面有所提高,即只需要检查更少的语句就能够定位出程序中的错误。

【Abstract】 It is estimated that debugging consumes most time of software development and maintenance. Fault localization is the most important and difficult in debugging. In traditional methods the programmers often set breakpoints and check if the run-time states are right, but the drawback is that the programmers have a very large set of statements to check, and it is time-consuming. So the automated fault localization is proposed, these methods use well designed test cases, and then analyze the test result and program features to get the statements that are suspicious. Always the methods based on program spectra make use of the coverage information to get the suspicious statements, and then the programmer check the statements in the descending order of statement’s suspicious.In order to improve the efficiency of methods base on program spectra, we make improvement to the existing methods and propose some new methods.Firstly, by comparing with the existing automatic fault localization methods, we propose some new methods based on program spectra. We propose Heuristic1 based on the thought that the contribution of one test case to a statement’s suspicious should be decrease when the test case number increases. Thinking of the execution complement we propose Heuristic2 and Heuristic3. Based on the idea of Tarantula and contribution, we propose Heuristic4.Secondly, we proposed a general architecture for automated fault localization, in which the visualization component was used to help the developers to check the suspicious statements.Finally, we implemented a debugging tool Visualdebug to evaluate the efficiency of the approaches proposed in this paper by comparing with other methods.Compared with the existing methods having the same idea, the experimental results show that Heuristic1 is slightly better, other methods proposed in this paper only need to check 20 percent of the total executed statements in 60 percent of the Siemens suite. So the methods proposed in this paper can reduce the number of statements that need to be examined to find the faulty statement, and thus improve the effect of fault localization.

  • 【分类号】TP311.52
  • 【被引频次】2
  • 【下载频次】130
节点文献中: