当前位置:网站首页>How can continuous integration (CI) / continuous delivery (CD) revolutionize automated testing
How can continuous integration (CI) / continuous delivery (CD) revolutionize automated testing
2022-04-23 04:50:00 【Software test network】
- Inconsistent execution of test cases .
- Manual setting of test environment .
- Boring and slow .
- The test result format is inconsistent .
Automated testing and continuous integration (CI) And continuous delivery (CD) The introduction of , Improve and improve the quality and rhythm of software release by developers . This article will delve into continuous integration (CI)/ Continuous delivery (CD) The Conduit , Learn how to use automated testing to significantly improve the quality and speed of software release . Besides , We'll also look at some that can be used to create continuous integration (CI)/ Continuous delivery (CD) The most popular and practical tool of pipeline .
Continuous integration (CI)/ Continuous delivery (CD) The Conduit
To release software , Some business needs must be met . In some cases , These business requirements include a set of fast system tests and a set of user interfaces (UI) test , Other versions may require more involved requirements . No matter how complex , These business requirements can be conceptualized as a set of serial and parallel steps . In continuous integration (CI)/ Continuous delivery (CD) In terms of , Each step is called a stage , The set of ordered stages is called a pipeline . Here is an example pipe :
The specific stages in the pipeline will vary according to the business needs of the project , But all the pipes will be in the trigger ( For example, submit ) Execute when activated . Once the execution of the pipeline begins , Each phase will be executed one by one ; When a phase is successfully completed , Carry out the next phase .
When a set of parallel phases is reached , For example, the user acceptance test in the above example 、 Capacity test and staging phase , All phases are performed simultaneously . When all parallel phases are successfully completed , The pipeline will continue to run . for example , Before user acceptance test 、 Before the capacity test and staging are successfully completed , The deployment phase will not begin .
Continuous integration (CI)/ Continuous delivery (CD) All stages of the pipeline do not necessarily have to be automated , In some cases , Introduce automated test cases into continuous integration (CI)/ Continuous delivery (CD) Piping can be difficult . for example :
- Unclear business requirements and specifications —— in the majority of cases , The difficulty in defining automated tests stems from the business requirements of the project ( Definition CI/ CD The Conduit ) And the specification of the software under test is lack of clarity . In continuous integration (CI)/ Continuous delivery (CD) Before creating a phase in the pipeline , You have to know what needs to be tested and why .
- The user interface (UI) test —— Due to its visibility and volatility , The user interface (UI) Testing can be difficult to automate . You can use the user interface (UI) Testing framework to overcome this problem , for example Selenium.
- Inconsistent reports —— Many continuous integrations (CI)/ Continuous delivery (CD) The pipeline tool includes a test summary , Displays the number of tests that have been executed and successfully completed in a phase . This summary requires automated testing to generate consistent and well-known reports . This requirement can be met by using automated testing tools with well-known report formats , for example JUnit( Or any xUnit frame ) and Cucumber.
Although there may be situations that require manual testing , But when all the tests ( Include UI test ) When both are automated , Continuous integration (CI)/ Continuous delivery (CD) The biggest advantage of pipeline .
Continuous integration (CI)/ Continuous delivery (CD) Automated testing in pipelines
In continuous integration (CI)/ Continuous delivery (CD) The main advantage of using automated testing in pipelines is , For a series of tests ( Including units 、 Integrate 、 System 、 Performance and acceptance tests ) Test individual submissions , Then it can be deployed to the production system without deployment , Without any human interaction . for example , Even in large projects , It is also possible for an engineer to make a submission , This will automatically lead to the deployment of functionality into production in minutes or hours .
On the contrary , Automated pipelines ensure that failed tests prohibit the deployment of functionality to production . for example , If developers add new features , And the unit or integration test fails , The execution of the pipeline will stop immediately , And it will not be deployed . then , Developers will be notified of test failures , And it can trace the error that triggers the submission of pipeline execution failure .
In addition to the benefits for deployment and release , Automated testing also brings many benefits to the quality of the code itself :
- Record their expected behavior .
- Reduce the number of regressions .
- Decouple into smaller 、 More independent components .
- Reduce test execution time .
- Stakeholders participate in the generation of test specifications ( Acceptance testing ).
Despite continuous integration (CI)/ Continuous delivery (CD) All tests in the pipeline may not be automated , But to get the most out of the pipeline , Efforts should be made to maximize the number of automation phases , And realize the complete automation of pipeline when possible .
Popular continuous integration (CI)/ Continuous delivery (CD) Tools
There are many tools and frameworks available to create automated continuous integration (CI)/ Continuous delivery (CD) The Conduit . The following example is not comprehensive , Represents only what can be used to facilitate continuous integration (CI)/ Continuous delivery (CD) A small number of excellent tools for pipelines . Generally speaking , These tools can be divided into two categories : Native and third-party tools .
1. Native tools
Native tools are continuous integration that integrates directly into the repository (CI)/ Continuous delivery (CD) Tools . For these tools , Created a configuration file coexisting with the source code , When submitted , The repository uses the configuration file and executes the defined phase .
The two most popular native tools currently available are :
(1)GitHub Actions—— Direct and GitHub Repository integrated automated workflow tools . It can be done by GitHub Repository's .github/workflows/ Create another new markup language in the directory (YAML) Workflow files to build new pipelines , stay GitHub Operation dictionary is called workflow .
(2)GitLab CI/CD—— And GitHub Actions similar ,GitLab CI/CD Direct and GitLab Repository Integration , Allow developers to pass through GitLab Create... In the root directory of the repository .gitlab-ci.yml File to create a new workflow .
When native tools are available , It's best to use it , Because it provides the highest level of integration with the repository and the source code managed by the repository . for example , If its code is stored in GitHub or GitLab Repository , Should be used separately by default GitHub Actions and GitLab CI/CD, Unless there is an urgent need to use third-party tools .
2. Third party tools
Third party tools are continuous integration that resides outside the repository (CI)/ Continuous delivery (CD) Tools . For many of these tools , A program can be used in the repository to notify third-party tools when submitting . These tools then examine the code from the repository and execute the configured pipeline . The two most popular third-party tools currently available are :
(1)Jenkins—— This is an open source automation server , Allow developers to automatically build 、 Test and deploy their projects .Jenkins Usually used as an independent service , Deployed by the development team . The pipe can pass directly through Jenkins UI To configure , You can also create in the source code repository Jenkins File to configure .
(2)CircleCI—— This is the GitHub、GitHub Enterprise、Bitbucket Integrated managed automation services .CircleCI The advantage is that the team doesn't have to deploy and maintain CircleCI example , But through circleci.com visit CircleCI. However , Its advantage in convenience lies in its narrow repository support and lack of flexibility .
Although using native tools should be the default option , But in some cases, third-party tools may be a better choice , for example :
- Native tools cannot provide the required functionality .
- Third party tools allow you to leverage more computing power ( That is, native tools may only allow the use of single machine resources or repository related resources to execute pipelines ).
- Need a separate option , So that continuous integration can be directly managed (CI)/ Continuous delivery (CD) The Conduit ( Want to manage continuous integration within a firewall or corporate subnet (CI)/ Continuous delivery (CD) The server ).
Conclusion
Test automation and will continue to integrate (CI)/ Continuous delivery (CD) The introduction of software development has irreversibly changed the creation of 、 How to test and release software . Despite continuous integration (CI)/ Continuous delivery (CD) The field is still developing and making progress , But you must understand continuous integration (CI)/ Continuous delivery (CD) Basic knowledge of automated testing in , And choose tools that save more time and improve quality .
Original title :Continuous Test Automation Using CI/CD: How CI/CD Has Revolutionized Automated Testing, author :Justin Albano
版权声明
本文为[Software test network]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230449432251.html
边栏推荐
- Opencv + clion face recognition + face model training
- /etc/bash_ completion. D directory function (the user logs in and executes the script under the directory immediately)
- 持续集成(CI)/持续交付(CD)如何彻底改变自动化测试
- Graduation project
- Innovation training (IX) integration
- Leetcode - > 1 sum of two numbers
- JS determines whether the numeric string contains characters
- Pixel 5 5g unlocking tutorial (including unlocking BL, installing edxposed and root)
- Solve valueerror: argument must be a deny tensor: 0 - got shape [198602], but wanted [198602, 16]
- Spell it! Two A-level universities and six B-level universities have abolished master's degree programs in software engineering!
猜你喜欢
Customize the navigation bar at the top of wechat applet (adaptive wechat capsule button, flex layout)
Small volume Schottky diode compatible with nsr20f30nxt5g
What is a data island? Why is there still a data island in 2022?
Eight misunderstandings that should be avoided in data visualization
Learning Android II from scratch - activity
New terminal play method: script guidance independent of technology stack
COM in wine (2) -- basic code analysis
Druid -- JDBC tool class case
Pixel mobile phone brick rescue tutorial
【数据库】MySQL单表查询
随机推荐
Sword finger offer: the path with a certain value in the binary tree (backtracking)
[paper reading] [3D object detection] voxel transformer for 3D object detection
Case of using stream load to write data to Doris
Detailed explanation of the differences between TCP and UDP
Field injection is not recommended using @ Autowired
MySQL -- execution process and principle of a statement
Teach you how to build the ruoyi system by Tencent cloud
C list field sorting contains numbers and characters
【数据库】MySQL单表查询
敏捷实践 | 提高小组可预测性的敏捷指标
PHP+MySQL 制作留言板
/etc/bash_ completion. D directory function (the user logs in and executes the script under the directory immediately)
Unity3d practical skills - theoretical knowledge base (I)
解决ValueError: Argument must be a dense tensor: 0 - got shape [198602], but wanted [198602, 16].
Getprop property
Wine (COM) - basic concept
Pixel mobile phone brick rescue tutorial
C language: Advanced pointer
Shanghai Hangxin technology sharing 𞓜 overview of safety characteristics of acm32 MCU
leetcode002--将有符号整数的数字部分反转