首页> 中文期刊> 《计算机学报》 >基于统计分析的弱变异测试可执行路径生成

基于统计分析的弱变异测试可执行路径生成

         

摘要

Mutation testing is a fault-based testing technique.The high cost,however,limits its widespread applications in practical testing.Papadakis et al.transformed the problem of weak mutation testing of a program into that of covering the true branches of mutant statements of another program,with the purpose of generating mutation test data by using previous methods of branch coverage.The converted program contains,however,a great number of mutant branches by using the above approach,thus having a difficulty in generating test data that cover these branches.If appropriate methods are employed to reduce the mutant branches in the converted program,and the reduced mutant branches are grouped according to the paths to which they belong,mutation test data with high quality will be generated by using previous methods of path coverage,hence improving the efficiency of weak mutation testing.Effective methods for generating feasible paths based on a program and its mutants are,however,of absence up to date.In view of this,this paper proposes an approach to generate feasible paths for weak mutation testing by considering the correlation of the true branches of mutant statements,with the purpose of killing all mutants by test data that cover all these feasible paths.To fulfill this task,the dominance relation of the true branches of mutant statements is first determined and employed to reduce the dominated true branches.Following that the non-dominated branches of mutant statements are instrumented into the program to form another program.The true branches of mutant statements that are generated by mutating the same statement are transformed into a new one based on their correlation.Then feasible sub-paths that contain these new branches and the original statement are produced based on the correlation among the original statement and the new branches.Finally, a correlation matrix is generated and reduced based on the execution of these sub-paths using statistical analysis,and one or more feasible paths that contain all these feasible sub-paths are obtained based the correlation matrix.The proposed method is applied to nine benchmarks or industrial programs,and compared with traditional algorithms.Our experimental results demon-strate that the proposed method can generate a small number of paths which cover all the mutant branches,with less time in executing the program.In addition,the sampling size involved in the proposed method has an influence on the number of feasible paths to some degree,whereas slightly impacts time in executing the program.%变异测试是一种面向缺陷的软件测试技术,然而高昂的测试代价,影响了其在实际程序测试的应用。 Papadakis 等人将某一程序的弱变异测试问题,转化为另一程序的变异语句真分支覆盖问题,以期采用已有的分支覆盖方法,生成变异测试数据。但是,上述方法使得转化后程序包含大量的变异分支,增加了分支覆盖测试数据生成的难度。如果采用合适的方法,约简转化后程序中包含的变异分支,并依所属的路径,对约简之后的变异分支分组,那么,将能够利用已有的路径覆盖测试方法,生成高质量的变异测试数据,从而提高弱变异测试的效率。但是,如何基于某一程序和变异体,生成可执行路径,至今缺乏有效的方法。鉴于此,文中通过考察变异语句真分支之间的相关性,提出了一种用于弱变异测试的可执行路径生成方法,使得覆盖这些路径的测试数据,能够杀死所有的变异体。该方法首先考察变异语句真分支之间的占优关系,约简被占优的变异分支,从而减少变异分支的数量;然后,将非被占优的变异分支插入到该程序,转化为另一被测程序,并基于转化之后的程序,考察同一语句形成的多个变异分支的相关性;通过组合相关变异分支,形成新的变异语句真分支;接着,利用被测语句与新变异语句真分支的相关性,生成包含新变异语句真分支和被测语句的可执行子路径;最后,采用统计分析,基于子路径之间的执行关系,构建并约简相关矩阵,将相关的子路径组合,生成一条或多条可执行路径。将所提方法应用于9个基准和工业程序测试中,并与传统方法进行了比较。实验结果表明,所提方法生成了为数较少的可执行路径,且运行时间短;更重要的是,这些可执行路径能够覆盖所有的变异分支。此外,所提方法涉及的样本容量,对生成的可执行路径数有一定的影响,但对程序的运行时间影响较小。

著录项

相似文献

  • 中文文献
  • 外文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号