节点文献

回归测试中测试用例优先级技术的改进与实现

The Improvement and Implementation of Test Case Prioritization in Regression Testing

【作者】 吴堃

【导师】 赵志宏;

【作者基本信息】 南京大学 , 计算机科学与技术, 2012, 硕士

【摘要】 软件的系统规模和复杂性都随着软件技术的不断发展而增加,这也导致了软件中错误或缺陷的增多。软件测试作为软件质量保证的关键部分,在软件开发中占据着重要的地位。回归测试是一种重要的软件测试方法,用以确保软件的修改不会影响已经存在的功能和行为。回归测试通常要求重新执行全部的测试用例,代价十分昂贵。因此,降低回归测试的开销,提高回归测试的效率是十分必要和有意义的。由此,测试用例优先级技术被提出,用以优化回归测试。测试用例优先级技术将根据一些准则重新排列测试用例被执行的顺序,优先级高的测试用例将被优先执行,以满足某些目标,如提高测试用例集的错误检测速率。基于相似性的测试用例优先级技术是目前被广泛研究的一种测试用例优先级技术。其基本思想是,度量测试用例执行剖面的相似性,并据此重新排列测试用例,使得排列过程尽可能最大化测试用例的多样性。这类技术有三个要点:是哪些测试用例的特征将被用来进行评估,二是采用哪种相异性方程进行评估,三是最大化测试用例多样性的策略。之前的研究多选取代码覆盖信息作为测试用例的特征加以度量,忽视了程序元素的相对执行次数对错误检测能力的贡献。本篇论文考虑了这个因素,从三方面对现有的基于相似性的测试用例优先级技术进行了改进,提出了基于程序元素相对执行次数的测试用例优先级技术。新技术根据执行剖面中程序元素的执行次数,将元素排序,排序后的元素作为测试用例的特征加以度量。为体现有序性,采用编辑距离作为相异性方程。同时,新技术使用最远距离优先算法作为最大化测试用例多样性的策略。本文共进行了三组实验研究,用来比较新技术与其它基于相似性的测试用例优先级技术以及传统的基于覆盖的测试用例优先级技术的优劣。通过实验分析,可以得出如下结论:基于程序元素相对执行次数的测试用例优先级技术与其它基于相似性的测试用例优先级技术相比,可以更显著地提高测试用例集的错误检测速率,并且更快地检测出循环中的错误。同时,新技术与传统的基于覆盖的测试用例优先级技术互为补充,是一种很有效的测试用例优先级技术。最后,本文实现了支持测试用例优先级技术的eclipse插件—TCP插件。TCP插件在前人实现的基础上,结合了本文提出的新技术,并且能够针对业界大规模程序及测试用例集工作,用来支持测试人员优化回归测试的过程。

【Abstract】 With the development of software technology, the size and complexity of the software systems increase gradually, which leads to the increment of faults and defects. Therefore, software testing becomes more and more important in order for quality assurance. Regression testing is one of the most important methods for software testing. It aims to assure that the modification of the software systems do not influence the correctness of the original functions. Naturally, regression testing asks for retesting all of the test cases, which is impractical and the cost is huge. Therefore, decreasing the cost of the regression testing and increasing the efficiency of it is necessary and meaningful. Many techniques have been proposed to solve this problem partially, one of which is test case prioritization. Test case prioritization rearranges test cases according to some criteria, so that test cases with a higher priority are executed earlier in order to meet some goals, for example, to increase the rate of fault detection.Similarity-based test case prioritization is one of the most widely-used methods in these days. The basic idea is that: rearranging test cases in such a manner as to maximize diversity of test cases with respect to the similarity measure of the features of test cases. The three main points of the similarity-based test case prioritization is that: the information of test cases that need to be evaluated, the method how this evaluation should be done and the strategy for maximizing test cases. Previous studies used the code coverage information as the feature of test cases, and ignored the contributions of the relative execution counts of program elements. In this paper, we consider this factor and propose a new technique called "test case prioritization utilizing relative execution counts of program elements", which improves the current similarity-based test case prioritization techniques from the following three points. For the new technique, we characterize each execution profile as the sorted sequence of its elements, where the sorting key is the number of times each element executed, and use edit distance as the dissimilarity metric in order to emphasize the ordering within each execution profile. At the same time, we use farthest-first algorithm as the strategy to maximize test cases. In this paper, we conduct three experiments for comparing the efficiency between the new technique and other test case prioritization techniques, including other similarity-based test case prioritization techniques and the traditional coverage-based test case prioritization techniques. The empirical study shows that: our new technique can significantly increase the rate of fault detection and detect the bugs in loops more quickly than other techniques. Meanwhile, our new technique is complementary with the coverage-based test case prioritization techniques.Finally, we implement an eclipse plug-in called TCP plug-in, to support test case prioritization techniques. The TCP plug-in is implemented on the basis of the previous implementation and has a significant improvement. The improved TCP plug-in integrates the new proposed technique and can be used to support the industry projects and huge test suites.

  • 【网络出版投稿人】 南京大学
  • 【网络出版年期】2012年 10期
  • 【分类号】TP311.53
  • 【被引频次】8
  • 【下载频次】287
节点文献中: 

本文链接的文献网络图示:

本文的引文网络