基于流量回放和智能diff的灰度发布系统

 2022-08-15 09:08

论文总字数:28534字

摘 要

随着互联网行业的高速发展,web项目的业务日趋复杂,快速迭代的需求导致系统愈发庞大,瞬息万变的市场需求也使得版本的发布周期越来越紧凑。这些客观条件使得web产品的测试难度也随之提高。Web产品的传统测试方法中非技术、重复性的测试工作占比的测试工作量比例比较大,因而需要大量的资源来保障web产品的质量。[1] 在这种情况下,敏捷开发方法开始逐步流行于成熟。持续集成是敏捷开发得以实现的一个重要手段。而自动化测试是持续集成的关键方法。部署自动化测试可以显著提高开发效率,提升交付质量。[2]

传统自动化测试的实现是通过测试人员手动编写测试用例来实现。随着业务变化,需要花费额外的成本对测试用例进行更新维护。而且为了确保业务质量,提高测试覆盖率,需要实现大量的测试用例。为了更好地适应敏捷开发、测试的工作流程,本文实现了一种依据已发布版本的用户日志作为用户请求进行流量回放,对候选版本的接口进行自动化回归测试的系统,用于避免了人工编写用例。通过线上的真实流量对候选版本进行验证,可以有效地发现候选版本潜在的问题,帮助测试人员快速响应需求变化。

在对接口流量进行提取时,本文采取了一种基于特征进行流量提取的方法。对对象进行对比时,使用JVM的反射库设计了一套用于对象对比的工具库。通过对流量进行代理转发,获取不同版本的系统的响应结果。对系统接口中存在的噪声,采用了二级服务器进行过滤。

【关键词】 :敏捷开发;回归测试;自动化测试;流量回放;接口对比;代理

Abstract

With the rapid development of the Internet industry, the web project business is becoming increasingly complex, rapid iterative demand led to the increasingly large system, changing market demand also makes the release of the version more and more compact. These objective conditions make the web product test difficulty also increases. Web products in the traditional test methods in the non-technical, repetitive test work accounted for a relatively large proportion of the workload of the test, which requires a lot of resources to protect the quality of web products. In this case, agile development methods began to gradually become popular. Continuous integration is an important tool for agile development. Automated testing is a key method of continuous integration. Deploying automated testing can significantly improve development efficiency and improve the quality of software delivery.

Traditional automated testing is achieved through the test staff to manually write test cases to achieve. As business changes, additional costs are required to update and maintain test cases. And in order to ensure the quality of business, improve test coverage, the need to achieve a large number of test cases. In order to better adapt to the agile development and testing workflow, this paper implements a system for automating the regression test of the candidate version of the interface based on the published version of the user log as a user request for traffic playback, to avoid manual writing Example. Verifying the candidate version with real traffic on the line can effectively identify potential problems with candidate versions and help testers respond quickly to changing requirements.

In this paper, a method of traffic extraction based on feature is adopted. When comparing objects, a set of toolbars for object comparison is designed using the JVM's reflection library. Through the flow of proxy forwarding, access to different versions of the system response results. The system interface in the presence of noise, using a secondary server for filtering. Keywords: Agile Development; Continuous Integration; Automated Testing;

【Keywords】: Agile development;Regression testing; Automated testing; Traffic playback; Interface comparison; proxy

目录

第一章 绪论 1

1.1 自动化测试现状 1

1.2 目前的技术手段及其缺陷 2

1.3 本课题研究的意义 2

第二章 理论基础 3

2.1 Web开发常用技术 3

2.1.1 超文本传输协议(HTTP) 3

2.1.2 JSON 数据交换格式 4

2.2 网络代理(Web Proxy) 4

2.3 本章小结 5

第三章 基于流量回放的Web应用测试技术 6

3.1 基于流量回放的Web应用测试技术概述 6

3.2 用户日志测试用例优先级策略 6

3.3 本章小结 7

第四章 自动化Diff技术分析 8

4.1 接口Diff技术概述 8

4.2 自动化接口Diff的基础架构 8

4.3 接口Diff中的噪声去除 9

4.4本章小结 9

第五章 灰度发布系统的设计与实现 10

5.1 系统需求分析 10

5.2 系统总体设计 10

5.2.1 系统的工作流程 10

5.2.2 系统的总体结构和模块设计 11

5.3 系统实现 12

5.3.1 日志解析模块 12

5.3.2 数据约简模块 14

5.3.3.接口对比模块 17

5.3.4 代理模块 18

5.3.5 报表模块 21

5.4 系统应用 22

5.5 系统有效性验证 24

5.6 本章小结 24

第六章 总结 25

致谢 26

参考文献 27

  1. 绪论
    1. 自动化测试现状

随着互联网行业的快速发展,基于B/S架构的软件项目日趋复杂。快速迭代的需求导致软件系统愈发庞大,瞬息万变的市场也使得软件版本的发布周期越来越紧凑。这些客观条件使得Web产品的测试难度也随之提高。Web产品的传统测试方法中非技术、重复性的测试工作占总的测试工作量比例非常大,因此需要大量的人力资源来保障Web产品的质量安全可靠。在资源如此紧张的情况下,仅靠测试,很难快速确定产品的可靠性和稳定性。特别是在持续不断的迭代开发中,始终需要验证每个版本下的各个模块仍然保持原有的功能特性,因此必须要对每个版本进行足够的回归测试(Regression Test)。如果使用传统的手工测试来进行回归,就意味着每次开发一个新版本的系统,都需要测试人员进行重复、乏味、繁琐的回归测试。由于手动测试的局限性,很可能由于测试人员的疏忽,在回归测试中遗漏了一些本应被发现的错误。

在这种情况下,敏捷开发方法开始逐步流行于成熟。敏捷开发是一种应对快速变化的需求的一种软件开发方法。[5] 它更强调程序员团队与业务专家之间的紧密协作、面对面的沟通(认为比书面的文档更有效)、频繁交付新的软件版本、紧凑而自我组织型的团队、能够很好地适应需求变化的代码编写和团队组织方法,也更注重软件开发过程中人的作用。

剩余内容已隐藏,请支付后下载全文,论文总字数:28534字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;