计算机科学 ›› 2025, Vol. 52 ›› Issue (6): 58-65.doi: 10.11896/jsjkx.240700115

• 计算机软件 • 上一篇    下一篇

融合深度强化学习和图卷积神经网络的类集成测试序列生成方法

王晨源, 张艳梅, 袁冠   

  1. 中国矿业大学计算机科学与技术学院 江苏 徐州 221116
    中国矿业大学矿山数字化教育部工程研究中心 江苏 徐州 221116
  • 收稿日期:2024-07-17 修回日期:2024-09-04 出版日期:2025-06-15 发布日期:2025-06-11
  • 通讯作者: 张艳梅(ymzhang@cumt.edu.cn)
  • 作者简介:(chenyuan_wang@cumt.edu.cn)
  • 基金资助:
    徐州市科技计划项目(KC22047);徐州市重点研发计划(社会发展)项目(KC23296);国家级大学生创新创业训练计划项目(202010290060Z)

Class Integration Test Order Generation Approach Fused with Deep Reinforcement Learning andGraph Convolutional Neural Network

WANG Chenyuan, ZHANG Yanmei, YUAN Guan   

  1. School of Computer Science and Technology,China University of Mining and Technology,Xuzhou,Jiangsu 221116,China
    Mine Digitization Engineering Research Center of the Ministry of Education,China University of Mining and Technology,Xuzhou,Jiangsu 221116,China
  • Received:2024-07-17 Revised:2024-09-04 Online:2025-06-15 Published:2025-06-11
  • About author:WANG Chenyuan,born in 2001.His main research interests include intelligent software engineering and so on.
    ZHANG Yanmei,born in 1982,Ph.D,associate professor,is a member of CCF(No.27031M).Her main research interests include intelligent software engineering and machine learning.
  • Supported by:
    Xuzhou Science and Technology Project(KC22047),Xuzhou Key R&D Program(KC23296) and National College Students' Innovation and Entrepreneurship Training Program(202010290060Z).

摘要: 类集成测试确保软件系统中多个类之间正常交互和协作,合理的类集成测试序列可以降低测试成本。为了降低程序中类集成测试序列的测试成本,国内外研究人员提出了多种类集成测试序列生成方法,但已有的方法生成的类集成测试序列的测试成本过高。针对上述问题,提出一种融合深度强化学习和图卷积神经网络的类集成测试序列生成方法。该方法首先将图卷积神经网络作为深度强化学习中的神经网络部分,并对智能体的网络结构和环境状态等方面进行改进,使环境和智能体可以基于图结构的数据进行交互;然后通过设计强化学习中的动作空间和奖励函数等基本要素,完成类集成测试序列的生成场景;最终实现智能体在不断地学习和尝试中得到最佳的类集成测试序列。实验结果表明,在以总体测试桩复杂度作为度量指标时,该方法能够在一定程度上降低生成类集成测试序列所需的测试桩代价。

关键词: 类集成测试序列, 深度强化学习, 图卷积神经网络, 测试桩, 测试桩复杂度

Abstract: Class integration testing ensures normal interaction and collaboration between multiple classes in the software system and a reasonable class integration test order can reduce testing costs.Therefore,in order to reduce the testing cost of class integration test orders in programs,domestic and foreign researchers have proposed a variety of methods for generating class integration test orders.However,the testing cost of class integration test orders generated by existing methods is too high.To solve this problem,a class integration test order generation approach combining deep reinforcement learning and graph convolutional neural network is proposed.This approach first uses graph convolutional network as the neural network part of deep reinforcement learning,and improves the network structure of the agent and environmental status,so that the environment and the agent can interact based on graph-structured data,and then through design the basic elements such as action space and reward function in reinforcement learning,and complete the generation scenario of the class integration test order.Ultimately,the agent can obtain the best class integration test order through continuous learning and trying.Experimental results show that when the overall stubbing complexity is used as the evaluation metric,this approach can reduce the stubbing cost required to generate class integration test order to a certain extent.

Key words: Class integration test order, Deep reinforcement learning, Graph convolutional neural network, Test stubs, Stubbing complexity

中图分类号: 

  • TP311
[1]BERNARD H.Fundamentals of Software Testing[M].JohnWiley and Sons Inc,2024.
[2]KUNG D,GAO J,PEI H,et al.A Test Strategy for Object-oriented Programs[C]//Proceedings of Computer Software and Applications Conference.1995:239-244.
[3]JIANG S J,ZHANG M,ZHANG Y M,et al.An IntegrationTest Order Strategy to Consider Control Coupling[J].IEEE Transactions on Software Engineering,2019,47(7):1350-1367.
[4]BRIAND L C,FENG J,LABICHE Y.Using Genetic Algorithms and Coupling Measures to Devise Optimal Integration Test Orders[C]//Proceedings of the International Conference on Software Engineering and Knowledge Engineering.2002:43-50.
[5]ZHANG Y M,JIANG S J,CHEN R Y,et al.Class Integration Testing Order Determination Method Based on Particle Swarm Optimization Algorithm[J].Chinese Journal of Computers,2018,41(4):931-945.
[6]CABRAL R D V,POZO A,VERGILIO S R.A Pareto Ant Colony Algorithm Applied to the Class Integration and Test Order Problem[C]//Proceedings of the IFIP WG 6.1 International Conference on Testing Software and Systems.2010:16-29.
[7]GAO Y Z,NIE Y M.Survey of Multi-agent Deep ReinforcementLearning Based on Value Function Factorization[J].Computer Science,2024,51(S1):34-42.
[8]CZIBULA G,CZIBULA I G,MARIAN Z.An Effective Ap-proach for Determining the Class Integration Test Order Using Reinforcement Learning[J].Applied Soft Computing,2018,65(6):517-530.
[9]DING Y R,ZHANG Y M,JIANG S J,et al.Research on Generation Method of Class Integration Test Order Based on Reinforcement Learning[J].Journal of Software,2022,33(5):1674-1698.
[10]DING Y R,ZHANG Y M,YUAN G,et al.Integration Test Order Generation Based on Reinforcement Learning Considering Class Importance[J].The Journal of Systems and Software,2023,205:111823.
[11]ZHANG Y H,ZHANG Y M,ZHANG Z C,et al.GenerationMethod of Class Integration Test Order Based on Deep Reinforcement Learning[J].Acta Electronica Sinica,2023,51(2):455-466.
[12]LI Y,ZHANG Y M,DING Y R,et al.A Class Integration Test Order Generation Approach Based on Sarsa Algorithm[J].Automated Software Engineering.2024,31(7):1-33.
[13]WANG Y,CHEN Z B,WU Z R,et al.Review of Reinforcement Learning for Combinatorial Optimization Problem[J].Journal of Frontiers of Computer Science and Technology,2022,16(2):261-279.
[14]ZHANG Y M,JIANG S J,ZHANG M,et al.Survey of ClassTest Order Generation Techniques for Integration Test[J].Chinese Journal of Computers,2018,41(3):670-694.
[15]WANG Y,YU H,ZHU Z L.A Class Integration Test Order Method Based on the Node Importance of Software[J].Journal of Computer Research and Development,2016,53(3):517-530.
[16]KLEINBERG J.Authoritative Sources in a Hyperlinked Environment[J].ACM,1999,46(5):604-632.
[17]KIPF T N,WELLING M.Semi-Supervised Classification withGraph Convolutional Networks[C]//Proceedings of the 5th International Conference on Learning Representations.2017:1-14.
[18]ZHANG M,JIANG S,ZHANG Y,et al.A Multi-level Feedback Approach for the Class Integration and Test Order Problem[J].The Journal of Systems and Software,2017,133(1):54-67.
[19]HASSELT H V,GUEZ A,SILVER D.Deep ReinforcementLearning with Double Q-learning[C]//Proceedings of the 30th AAAI Conference on Artificial Intelligence.2016:2094-2100.
[20]CHAUL T,QUAN J,ANTONOGLOU I,et al.Prioritized Experience Replay[C]//Proceedings of the 4th International Conference on Learning Representations.2016:1-21.
[21]LE TRAON Y,JERON T,JEZEQUEL J M,et al.Efficient Object-oriented Integration and Regression Testing[J].IEEE Transactions on Reliability,2000,49(1):12-25.
[22]TAI K C,DANIELS F J.Test Order for Inter-class Integration Testing of Object-Oriented Software[C]//Proceedings of the 21st Annual International Computer Software and Applications Conference.1997:602-607.
[23]BRIAND L C,LABICHE Y,WANG Y.An Investigation ofGraph-based Class Integration Test Order Strategies [J].IEEE Transactions on Software Engineering,2003,29(7):594-607.
[24]WANG Z S,LI B X,WANG L L,et al.Using Coupling Measure Technique and Random Iterative Algorithm for Inter-Class Integration Test Order Problem[C]//Proceedings of the 34th Annual IEEE Computer Software and Applications Conference Workshops.2010:329-334.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!