摘要
类测试序列的确定是类集成测试中一个难以解决的关键问题.合理的类集成测试序列可以降低构造测试桩的总体复杂度,降低测试代价.提出一种基于粒子群优化算法的类集成测试序列确定方法.首先,对所有类进行排列组合生成所有可能的类测试序列,并将每个类测试序列看成一个粒子并映射到一维空间,用空间中的每一个位置代表一个类集成测试序列;然后,根据适应度函数计算每个粒子的速度和位置,再通过粒子群优化算法选择粒子的最优位置和最优适应度,得到最优粒子;最后,根据映射关系,将选择的最优粒子映射为其对应的类测试序列,则该测试序列即为所求得的最优类测试序列.实验结果表明,采用该文方法求得的类测试序列花费更小的测试代价,该文方法更有效.
Class integration testing is an important part in object-oriented software testing,and it is a key and difficult problem to determine the class integration test order of class cluster in integration testing.Reasonable class integration test order can reduce the overall complexity of test stub,and reduce test cost.A class integration test order determination method based on particle swarm optimization algorithm is proposed.First,all possible classes test orders are generated through permutation and combination,and each class test order is taken as a particle and is mapped to one dimensional space,and then each position in dimensional space represents a integration test order;Then,we calculate the velocity and position of each particle according to fitness function,and then choose the optimal position and the optimal fitness of the particles by particle swarm optimization algorithm,and obtain the optimal particle;Finally,according to the mapping relationship,we get the test order that the optimal particle is corresponding to,which is the optimal test order.The optimal test order makes the minimum overall complexity of test stub and the minimum test cost.The experimental results show that the proposed approach takes a lower test stub cost for solving the class test order problem,which is more effective.
作者
张艳梅
姜淑娟
陈若玉
王兴亚
张妙
ZHANG Yan-Mei;JIANG Shu-Juan;CHEN Ruo-Yu;WANG Xing-Ya;ZHANG Miao(School of Computer Science and Technology,China University of Mining and Technology,Xuzhou,Jiangsu 221116;Guangxi Key Laboratory of Trusted Software,Guilin,Guangxi 541004)
出处
《计算机学报》
EI
CSCD
北大核心
2018年第4期931-945,共15页
Chinese Journal of Computers
基金
国家自然科学基金(61502497
61673384)
广西可信软件重点实验室研究课题(kx201609)
中国博士后科学基金项目(2015M581887)
徐州市科技计划项目(KC15SM051)资助
关键词
测试序列
面向对象
集成测试
粒子群优化算法
一维空间
test order
object-oriented
integration testing
particle swarm optimization algorithm
one-dimensional space