Page 105 - 《软件学报》2021年第9期
P. 105

软件学报 ISSN 1000-9825, CODEN RUXUEW                                        E-mail: jos@iscas.ac.cn
         Journal of Software,2021,32(9):2729−2743 [doi: 10.13328/j.cnki.jos.006075]   http://www.jos.org.cn
         ©中国科学院软件研究所版权所有.                                                          Tel: +86-10-62562563


                                                          ∗
         基于日志挖掘的微服务测试集缩减技术

         陈立哲,   吴   际,   杨海燕,   张   奎


         (北京航空航天大学  计算机学院,北京  100191)
         通讯作者:  吴际, E-mail: wuji@buaa.edu.cn

         摘   要:  微服务系统每轮迭代过程中都需要进行回归测试,大量重复测试会造成资源浪费,可通过减少测试用例
         集的规模来降低成本,以提高测试效率.现有测试用例集缩减技术主要依赖系统规约和架构描述作为输入,对于具有
         服务自治、调用关系不确定等特点的微服务系统实用性受限.并且,现有测试用例集缩减技术很少考虑使用场景,测
         试用例集很难反映用户关切.提出了一种基于 API 网关层日志挖掘的测试用例集缩减技术,从 API 网关层日志中挖
         掘出能够反映服务使用场景的频繁调用路径,建立频繁路径与测试用例的关联关系,进而构建搜索图,并基于启发式
         搜索生成测试用例缩减集.描述了该技术的完整过程,并基于一个集成办公微服务系统进行了实验.实验结果表明:
         该技术能够缩减测试用例规模 40%以上,且缺陷发现能力降幅不超过 10%.
         关键词:  微服务;软件测试;测试用例集缩减;日志挖掘;API 网关层
         中图法分类号: TP311

         中文引用格式:  陈立哲,吴际,杨海燕,张奎.基于日志挖掘的微服务测试集缩减技术.软件学报,2021,32(9):2729−2743.  http://
         www.jos.org.cn/1000-9825/6075.htm
         英文引用格式: Chen LZ, Wu J, Yang HY, Zhang K. Microservice test suite minimization technology based on logs mining. Ruan
         Jian Xue Bao/Journal of Software, 2021,32(9):2729−2743 (in Chinese). http://www.jos.org.cn/1000-9825/6075.htm
         Microservice Test Suite Minimization Technology Based on Logs Mining

         CHEN Li-Zhe,  WU Ji,   YANG Hai-Yan,   ZHANG Kui
         (School of Computer Science and Engineering, Beihang University, Beijing 100191, China)

         Abstract:    In each iteration of microservice system, regression testing should be executed. A large number of repeat testing will cause
         waste of resources. Therefore, it is necessary to minimize the test suite to reduce costs and to improve testing efficiency. Current test suite
         minimization technologies mainly rely on system specification and architecture description as input, which is limited to the practicability
         of microservice  system with the characteristics  of  service autonomy and  uncertain call  relationship. Moreover, current test  suite
         minimization technologies rarely take the usage scenarios into consideration, and the test suite is difficult to reflect user’s concerns. This
         study proposes a test suite minimization technology based on API gateway access logs mining. This technology mines frequent paths from
         API gateway access logs which reflects the dynamic operation of microservice system. The relationship between frequent paths and test
         cases is established to construct search graph. Then, origin test suite is minimized with heuristic search of the graph. This paper explains
         the whole process of the technology. The experiments based on an integrated OA microservice system show that the scale of the test suite
         is reduced by more than 40%, and its defect detection ability is reduced by no more than 10%.
         Key words:    microservice; software testing; test suite minimization; logs mining; API gateway layer

                                                              [1]
             单块架构(monolithic)由于模块化问题而难以管理、扩展和维护 ,很难有效应对 Web 应用系统复杂化问题.
         很多大型互联网企业像 Netflix,Amazon 和 Spotify 等,采用了微服务架构来重构它们的业务系统.

            ∗  基金项目:  国防科技创新特权
              Foundation item: Privilege Projects of National Defense Science and Technology Innovation
              收稿时间: 2020-01-10;  修改时间: 2020-02-18, 2020-03-28, 2020-04-26;  采用时间: 2020-05-07
   100   101   102   103   104   105   106   107   108   109   110