• •    

求解测试用例自动生成问题的多因子回溯搜索优化算法

胡中波,王旭鹏   

  1. 长江大学
  • 收稿日期:2022-03-28 修回日期:2022-05-30 发布日期:2022-06-29
  • 通讯作者: 胡中波
  • 基金资助:
    国家自然科学基金资助项目

Multifactorial backtracking search optimization algorithm for solving automated test case generation problem

  • Received:2022-03-28 Revised:2022-05-30 Online:2022-06-29
  • Supported by:
    National Natural Science Foundation of China

摘要: 摘要:路径覆盖测试用例自动生成(ATCG-PC)问题是自动化软件测试领域的热点。ATCG-PC问题中群智能进化算法常用的适应度函数之间具有高度的相似性,但现有的解决ATCG-PC问题的群智能进化算法尚未考虑到这一相似性特征。受相似性特征启发,两个相似的适应度函数被看作两个任务,从而将ATCG-PC问题转化为多任务ATCG-PC问题,并提出了一种新的解决多任务ATCG-PC问题的群智能进化算法,即多因子回溯搜索优化算法(MFBSA)。该算法由多因子选择I的记忆种群功能提高了全局搜索能力,并通过选型记忆交配使得相似任务之间能够通过知识转移来提高彼此的优化效率。在6个雾计算测试程序和6个自然语言处理测试程序上对算法的性能进行了评价。与回溯搜索优化算法(BSA)、免疫遗传算法(IGA)、收敛速度控制器粒子群优化算法(PSO-CSC)、自适应粒子群优化算法(APSO)、超立方体差分进化算法(DE-H)相比,MFBSA覆盖12个测试程序上的路径所使用的测试用例分别减少了64.46%、66.64%、67.99%、74.15%和61.97%。实验结果表明,所提算法能够有效降低测试成本。

关键词: 关键词:路径覆盖测试用例自动生成, 相似性特征, 多任务优化, 多因子回溯搜索优化算法

Abstract: Abstract:Abstract: Automated test case generation for path coverage (ATCG-PC) problem is a hot topic in the field of automated software testing. The fitness functions popularly used by swarm intelligence evolutionary algorithms in ATCG-PC problem are highly similar, but existing swarm intelligence evolutionary algorithms for solving ATCG-PC problem have not fully utilize the similarity feature. Inspired by the similarity feature, the two similar fitness functions were treated as two tasks, so that ATCG-PC problem was transformed into a multitasking ATCG-PC problem. A new swarm intelligent evolutionary algorithm called multifactorial backtracking search optimization algorithm (MFBSA) was proposed to solve multitasking ATCG-PC problem. The algorithm uses the memory population function of multifactorial selection I to improve its global search ability, and enables similar tasks to improve each other's optimization efficiency through knowledge transfer by assortative memory mating. The performance of MFBSA was evaluated on six fog computing test programs and six natural language processing test programs. Compared with backtracking search optimization algorithm (BSA), immune genetic algorithm (IGA), particle swarm optimization with convergence speed controller (PSO-CSC), adaptive particle swarm optimization algorithm (APSO) and differential evolution with hypercube-based learning strategies (DE- H), the test cases used by MFBSA covering the paths on 12 test programs reduced by 64.46%, 66.64%, 67.99%, 74.15% and 61.97%, respectively. The experimental results show that the proposed algorithm can effectively reduce testing cost.

Key words: Keywords: automated test case generation for path coverage, similarity feature, multitasking optimization, multifactorial backtracking search optimization algorithm

中图分类号: