当前位置:网站首页>Continuous testing | making testing more free: practicing automated execution of use cases in coding
Continuous testing | making testing more free: practicing automated execution of use cases in coding
2022-06-24 12:22:00 【CODING】
The author of this article : Cheng Shengcong - CODING The product manager
Automated testing is the foundation of continuous testing
stay DevOps In the context of high frequency delivery , Teams tend to fall between speed and quality “ A choice ” Plight : To embrace demand change , Adopt a shorter lead time , Then frequent changes lead to more problems , So the development test is delayed , Finally, the test time is compressed 、 It's difficult to do adequate testing . Let's face it , How can the team improve the efficiency of test execution ? The first thing you will think of is automated testing —— Replace repetitive manual testing with automated testing , Faster execution saves test time . Besides , Because of automation, the execution time is relatively fixed , Moreover, the preset test behavior of the program brings high consistency , Let the stability and repeatability of the test reach a high standard , It can be realized very well “ Rapid reproduction of software defects ” The goal of .
If we say that in the traditional waterfall mode with relatively sufficient test time , The biggest value of automated testing for regression testing scenarios is to save manpower cost , So in agile and DevOps Time , The greater value of automated testing lies in frequent verification and fast feedback . It can be said that the foundation of continuous testing practice is automated testing , Only automation is high enough , In order to meet the needs of continuous delivery of high-frequency version .
Automated testing strategy
Automated testing has important value , But it doesn't mean that we should devote ourselves to all kinds of automated testing . The purpose of automated testing is to verify that the given logic is as expected , In a scenario where requirements change frequently , The maintenance cost of automated code is huge . therefore , We need the right strategy to guide the implementation of Automation —— Pyramid model .
The automated test pyramid was first created by Mike Cohn On 2009 In 《Succeeding with Agile: Software Development using Scrum》 It is proposed that , At that time, the three layers from top to bottom were UI、Service and Unit. Then with the implementation of agile testing practice , The cognition gradually formed in the industry is that from top to bottom, they are User interface testing (UI Tests)、 Interface integration testing (API Tests)、 unit testing (Unit Tests), Plus the manual exploratory test at the top , Further enrich the pyramid for testing ( Including automation and manual ). This triangle of narrow top and wide bottom provides a visual guide for our automation investment in each layer : The underlying unit tests are the most , Interface test center ,UI Least testing .
As the pyramid model shows , The lower level of unit testing / Interface testing is better than the upper level UI The advantages of testing are : Because it's closer to production code, it's easier to write and locate defects in the code ; because The granularity of the test object is smaller 、 Rely less , So execution is more efficient ; Because the test object is more stable, the maintenance cost is lower and so on , Of course, the advantage of testing closer to the top is , Because it's more reflective of business needs , So it's easier to see the value of testing . So in DevOps Time , Based on the balance of speed and mass , The interface integration test of the middle layer can keep relatively low maintenance cost , At the same time, it can reflect the value of business logic , It should be our focus , Especially when automation is still in its infancy .
The test pyramid originated in agile practice , Take it as a reference to continuously adjust our automation test investment , The team's test cases and execution status will gradually form a good balance .
The value of precision testing
Although it can be seen from the survey reports of the industry in recent years , As for DevOps Recognition , The investment of enterprises in automated testing continues to increase , The direct result is that there are more and more code for automated testing . But with a rapidly increasing number of automation code , Can automation achieve what we expect ?
In terms of the actual effect , The enterprise did not get the expected value due to the improvement of automation test coverage , Because automated code execution is not as much as we think “ free ”, Often for two reasons :
- Most teams think of automated code execution as CI A part of , It's just used as a regression scenario , But the time of full regression is too long, which limits the frequency of implementation ;
- There is still a technical threshold for building an assembly line and matching corresponding tools on this basis , Plus the amount of work required by the operations themselves , It also makes it difficult for everyone to perform automated tests at any time .
This leads to an increase in automation coverage , Instead, regression testing takes longer to execute , So the frequency of automated testing can only be reduced , Finally, the value of automated code is questioned . In fact, in addition to improving automation coverage , We need to change “ Each test execution covers as many cases as possible ” Idea : We shouldn't because “ Don't worry ” And make the test set redundant , But needs Optimize test coverage based on business risk , In order to achieve a higher test input-output ratio in a limited range , Achieve accurate testing .
CODING Make test execution more free
To make test execution more “ free ”,CODING Build the ability of cloud automated execution , Expect to solve the problem of automated testing “ Last mile ” problem , So as to achieve :
- Each execution has the freedom to choose the sample set flexibly ;
- Everyone has the freedom to perform tests .
Next , Let's see How to be in CODING Test management implementation “ free ” Run the test smoothly :
1. First , stay CODING Automatic code registration in automatic use case library , Make sure the automation code already exists in the code hosting , Register the existing automated code base , And set the relevant language / frame .
2. Parse the test function list of the automation code base , And establish the matching relationship between function use cases and automation functions in use case management , Get automation coverage . By matching automation code and function use cases , It can help us build an intuitive sense of the value generated by automated code , Achieve “ know ”.
3. Create test plans that are executed automatically , Circle the use cases . Selecting a suitable subset of automated tests requires business test knowledge , It takes too long to perform a fixed range of full regression tests , Or repeated mechanical implementation of smoke test can not reflect the test situation of new requirements in time , This is the reason why the expected value is still not achieved after the improvement of automatic test coverage .CODING Provides a way to circle test subsets on demand to create test plans , Precise execution of the relevant subset of automation code 、 Fast feedback results , This eliminates the worry about the long running time of automation , Maximize the value of the automated code that the team strives to produce .
4. Execute the test plan , The matching automation use cases are executed in the background and the execution results of the corresponding function use cases are updated . After the automation is completed , You can manually verify the untested or failed use cases 、 And update the use case task status .
5. Click generate test report , The system will automatically analyze and evaluate the quality according to the collected data . Test traceability makes test reports more convincing , Help the team control the risk to a low level .
边栏推荐
- 《opencv学习笔记》-- 矩阵归一化 normalize()函数
- How to calculate the bandwidth of video transmission? How much bandwidth is required to transmit 4K video?
- New progress in the construction of meituan's Flink based real-time data warehouse platform
- 集群控制管理
- Tools and methods - use code formatting tools in source insight
- 怎么申请打新债 开户是安全的吗
- Is it safe to apply for new bonds to open an account
- [206] use PHP language to generate the code of go language
- 分布式系统解决之道:目录、消息队列、事务系统及其他
- Linker --- linker
猜你喜欢

万名校园开发者花式玩AI,亮点看这张图就够啦!
[Old Wei makes machines] issue 090: keyboard? host? Full function keyboard host!

ArrayList # sublist these four holes, you get caught accidentally

GTEST from getting started to getting started

TP-LINK 1208 router tutorial (2)
Deep parsing and implementation of redis pub/sub publish subscribe mode message queue

链接器 --- Linker

How to write controller layer code gracefully?

《opencv学习笔记》-- 离散傅里叶变换

《梦华录》要大结局了,看超前点映不如先来学学它!
随机推荐
Popular science of data annotation: ten common image annotation methods
怎样购买打新债 开户是安全的吗
Example of PHP observer mode [useful in the laravel framework]
如何优雅的写 Controller 层代码?
Nacos source code - Interface read configuration
《opencv学习笔记》-- 离散傅里叶变换
5分+的单基因泛癌纯生信思路!
Reading at night -- about microservices and containers
最新热点:使用铜死亡相关基因进行肿瘤预后分型!
Cluster control management
Is it safe to open an account for how many new bonds you can apply for
LS-DYNA新手入门经验
How is the e-commerce red envelope realized? For interview (typical high concurrency)
How to purchase new bonds is it safe to open an account
《opencv学习笔记》-- 矩阵归一化 normalize()函数
Easynvr user login is modified to share the modification process of ip+ user name restriction
Adjustment method of easynvr video platform equipment channel page display error
巧妙构思-铁死亡调节因子分型预后发6+
Single gene pan cancer + simple experiment can be published 7 points+
嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)