基于强化学习选择策略的路径覆盖测试数据生成算法  

Algorithm for path coverage test data generation based onreinforcement learning selection strategy

在线阅读下载全文

作  者:刘超 丁蕊 朱雨寒 Liu Chao;Ding Rui;Zhu Yuhan(School of Mathematics&Science,Mudanjiang Normal University,Mudanjiang Heilongjiang 157000,China;School of Computing&Information Technology,Mudanjiang Normal University,Mudanjiang Heilongjiang 157000,China)

机构地区:[1]牡丹江师范学院数学科学学院,黑龙江牡丹江157000 [2]牡丹江师范学院计算机与信息技术学院,黑龙江牡丹江157000

出  处:《计算机应用研究》2024年第8期2467-2473,共7页Application Research of Computers

基  金:牡丹江师范学院资助项目(MNUGP202304,kjcx2022-020mdjnu,1451TD003);黑龙江省自然科学基金资助项目(LH2023F037);黑龙江省高等教育教学改革重点委托项目(SJGZ20200175);黑龙江省高等教育教学改革项目(SJGY20220607)。

摘  要:面向路径覆盖的测试是软件测试的重要方法之一。如何快速生成高质量测试数据使其满足路径覆盖要求,一直是研究热点问题。为解决现有智能优化方法运行时间长、探索过程不稳定以及生成测试用例冗余的问题,提出一种基于强化学习思想的选择策略,用于以路径覆盖为准则的测试数据生成中。通过将可执行路径定义为智能体状态,算法每一轮迭代更新后的数据选择定义为智能体动作,并将奖励函数与状态变化关联,在状态更新过程中使用贪心策略来引导输入数据不断向未获取状态变异更新,以此不断选择能够覆盖新可执行路径的数据,从而实现对待测程序所有执行路径覆盖的目标。实验结果表明,与其他算法相比,所提策略的运行时间和迭代次数明显降低,同时覆盖率快速提高。结合理论分析可以得出结论:所提策略在实际运用中能够有效实现路径覆盖并提高测试数据生成效率。Path-coverage oriented testing is a crucial method in software testing,and the rapid generation of high-quality test data to satisfy path coverage requirements has been a persistent research challenge.To address issues such as long running times,unstable exploration processes,and the generation of redundant test cases in existing intelligent optimization methods,this paper proposed a selection strategy based on the reinforcement learning paradigm applied to test data generation with path coverage as the criterion.By defining executable paths as the state of the intelligent agent,it defined the data selection after each iteration update as the agent’s action.It associated the reward function with state changes,and employed a greedy strategy during the state update process to guide input data towards continuous variations in unexplored states.This iterative selection process aimed to continuously choose data that covered new executable paths,thereby achieving the goal of covering all execution paths of the target program.Experimental results demonstrate that compared to other algorithms,the proposed strategy significantly reduces running times and iteration counts while achieving notable improvements in coverage.Theoretical ana-lysis supports the conclusion that the proposed strategy effectively realizes path coverage and enhances the efficiency of test data generation in practical applications.

关 键 词:测试数据生成 路径覆盖 强化学习 选择策略 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象