- 7
- 0
- 约6.17千字
- 约 12页
- 2018-09-11 发布于福建
- 举报
旅行商问题求解程序蜕变测试研究
旅行商问题求解程序蜕变测试研究
摘要:随着计算机硬件运算性能的不断提升和分布式算法的应用,通过计算机进行求解复杂的数学问题变得可能。近些年,大数据、智能算法的兴起,计算机求解复杂的数学问题的速度和效果越来越成熟,相关的算法也成为一些软件的核心部分,测试实现这些算法的复杂程序的实现是否正确成为一个难点,也是当前的研究热点。以旅行商问题为例,构建了问题模型的蜕变关系,研究了蜕变测试的逻辑和实现,并通过变异分析测试蜕变关系的有效性,最后分析了不同蜕变关系检错的效能。
关键词:旅行商问题;黑盒测试;蜕变测试;变异算子
中图分类号 TP391 文献标识码 A 文章编号:1009-3044(2017)32-0080-03
Research on the Application of Metamorphic Testing to Tsp Solver Program
LIU Yan-ping
(PLA 91404 Unit, Qinhuangdao 066000, China)
Abstract: With the continuous improvement of computer performance and the application of distributed algorithm, complex mathematical problems solved by computer is feasible. In recent years, for the spring up of big data and intelligent algorithm, the speed and effect solving complex mathematical problems automatically are more satisfied, and related algorithms have become a core part of the software, to test such software correct or not is a difficulty, so how to test these software which integrate some complex algorithms also is research hotspots. Taking the traveling salesman problem as an example, this paper constructs the model transformation, makes a study on the implementation of metamorphic testing, and the effectiveness of metamorphic relation has been tested through mutation testing. Finally, capability of detecting faults with metamorphic relations are tested and analyzed.
Key words:TSP; metamorphic testing; mutation testing
旅行商问题(Travelling salesman problem, TSP)是指这样一个问题:一个旅行商推销员要去给定的若干城市去推销产品,每个城市只去一次,城市名称和城市之间的距离是已知量,推销员的行走路线和行走距离是未知量,现需要求解未知量的最小值,即求解旅行商推销员从某座城市出发,访问每一座城市一次并回到起始城市的最短距离。旅行商问题是一个典型的组合优化的完全NP问题,求解最短路径的算法复杂度为O([n!]),随着顶点的增加,计算量爆炸式增长。旅行商问题经数学抽象建模再具体应用到入线路设计、物流配送路线规划、交通运输的建模方面,了众多的解法被研究和应用,例如动态规划法和分支界限法等传统方法,还有遗传算法、模拟退火算法等智能算法。在对基于某种算法的旅行商问题求解程序执行基于黑盒测试的功能测试时,由于枚举法等算法的计算量太大,人工无法手动求得期望解,不能对算法的解算结果进行评估,属于不可测程序。
为了解决这类测试判定的问题,Chen等提出了蜕变测试( Metamorphic Testing,MT) 方法。这种测试方法的思路是,通过一般方法生成一组测试用例,然后研究问题模型,构造一种关系,在原来测试用例的基础上生成一组新的用例,用例之间的关系确定了程序输出之间的理论关系,通过验证程序输出组之间的实际关系和理论关系来判断程序是否正确,这种关系
原创力文档

文档评论(0)