尽管回归测试是一种重要的软件测试方法,但是,如何选择测试目标,并充分利用已有的测试数据,目前尚缺乏有效的方法.文中基于路径相关性,研究求解回归测试数据生成问题的新方法,以高效地进化生成可用于回归测试的测试数据集.该方法根据路径与节点的相关矩阵,首先进行目标路径排序,并基于路径相关性,建立新的覆盖影响路径的回归测试数据生成问题的数学模型;其次,结合遗传算法对上述模型求解时,利用穿越已有目标路径的测试数据,编码后取代进化种群的部分个体.将所提方法应用于多个基准和工业程序的测试,并与其他回归测试数据生成方法比较,最后实验结果表明,所提方法能够有效提高生成测试数据的效率.
Regression testing is an important method of software testing.However,there has been no effective method of choosing test objects and making full use of existing test data.This paper,focusing on the problem of generating test data for regression testing,proposes a new effective evolutionary generation approach of test data based on path correlation for regression testing.In our method,firstly,the target paths are sorted according to the correlation matrix between paths and nodes,and a novel mathematical model is built for generating regression test data that cover affected paths based on the matrix.Then,when solving the above model using genetic algorithms,test data that have traversed the existing target paths are coded and employed to replace a part of individuals of the current population.Finally,the proposed method was applied to several benchmarks and industrial programs,and compared with other test data generation methods for regression testing.Our experimental results showed that our method can effectively improve the efficiency of test data generation.