面向类集成测试序列生成的强化学习研究
作者:
作者单位:

作者简介:

通讯作者:

张艳梅,E-mail:ymzhang@cumt.edu.cn;姜淑娟,E-mail:shjjiang@cumt.edu.cn

中图分类号:

TP311

基金项目:

国家自然科学基金(61673384, 71774159, 62162004, 51874292); 广西可信软件重点实验室开放课题(kx201608); 广西自然科学基金重点项目(2018GXNSFDA138003)


Generation Method of Class Integration Test Order Based on Reinforcement Learning
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    集成测试是软件测试过程中不可缺少的步骤, 针对在集成测试中如何对系统中的类合理排序的问题, 国内外研究者提出了多种生成类集成测试序列的方法, 然而他们大多没有将测试桩复杂度作为评估测试代价的指标. 针对该问题, 提出面向类集成测试序列生成的强化学习研究方法, 以总体测试桩复杂度为评价测试代价的指标, 生成测试代价尽可能低的类集成测试序列. 首先, 定义强化学习任务, 根据任务设定算法的追求目标; 其次, 进行程序的静态分析, 根据分析得到的结果计算测试桩复杂度; 然后, 将测试桩复杂度的计算融入奖励函数的设计中, 为选择下一步动作提供信息和依据; 最后, 通过奖励函数反馈值函数, 通过值函数的设定保证累计奖励最大化. 当智能体完成规定训练次数, 系统会选择获得最大累计奖励值的类集成测试序列进行输出, 即为我们追求的测试代价尽可能低的结果. 实验结果表明, 与现有方法相比, 在以总体测试桩复杂度为评价指标时, 提出的方法结果更优.

    Abstract:

    Integration testing is an indispensable step in the software testing process. In response to the problem of how to rationally sort the classes in the system in integration testing, researchers worldwide have proposed a variety of methods to generate class integration test orders. However, most of them didn’t take the stubbing complexity as the indicator, which is an important factor in evaluating the test cost. In order to solve this problem, this study proposes a method of generating a class integration test order based on reinforcement learning, using the overall stubbing complexity as the indicator to evaluate the test cost, and generating a class integration test order with the stubbing complexity as low as possible. First, the reinforcement learning task is defined, and the pursuit goal of the algorithm is set according to the task. Second, the static analysis of the program is performed and the stubbing complexity is calculated according to the results of the analysis. Then, the calculation of the stubbing complexity is integrated into the design of the reward function to provide information and basis for choosing the next action. Finally, the value function is fed back through the reward function, and the value function is set to ensure that the cumulative reward is maximized. When the agent completes the specified number of training times, the system will select the class integration test order that obtains the largest cumulative reward value for output, which costs the lowest stubbing complexity pursued. The experimental results show that the results obtained by this method are better than those obtained by other existing methods in terms of the overall stubbing complexity as the evaluation indicator.

    参考文献
    相似文献
    引证文献
引用本文

丁艳茹,张艳梅,姜淑娟,袁冠,王荣存,钱俊彦.面向类集成测试序列生成的强化学习研究.软件学报,2022,33(5):1674-1698

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2021-08-10
  • 最后修改日期:2021-10-09
  • 录用日期:
  • 在线发布日期: 2022-01-28
  • 出版日期: 2022-05-06
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号