Most of us are familiar with the idea of testing. We test the water temperature before stepping into the shower, for example.

As a creative writer, I always evaluate my writing before it's submitted to any publications. This strategy follows stages: high order changes to plot and characters after the first draft, medium order alterations to pacing and structure for second and third drafts, low order edits to sentence structure and grammar before the final product. Depending on the priorities of the current stage, I test different aspects of the story to see how they hold up and update it as I discover gaps.

Download Now: Free HTML & CSS Hacks

DevOps teams take a similar approach to testing products. However, they shift their testing "left" and try to evaluate individual components as soon as they are written versus waiting for the first iteration of a software — the first draft in our story metaphor. They also test the product during the individual stages of the DevOps pipeline to confirm the software is ready to move to the next phase.

No matter the method, testing is a critical aspect of any software development strategy, and it is especially important to the DevOps model for keeping delivery quality high while maintaining momentum. Let’s review DevOps testing strategies and tools that support these approaches in the following sections.

DevOps测试策略

以下类别是您将要在DevOps测试策略中重点关注的主要领域。当然,您的团队可能会有独特的用例,这些用例比这里涵盖的范围更为集中,这是完全鼓励的。在DevOps模型中,要测试过多的比错过问题的风险要好得多。

DevOps Unit Testing

DevOps unit testing

Image Source

Unit testing inspects individual components of the application to confirm the code they're built on works as expected. Testing engineers or tools will create test cases for the functions, procedures, or methods to either pass or fail. The results are recorded, and the development team then works to update any failing components to pass the next test.

The main advantage of unit testing is that the scope is limited to allow for granular inspection of each piece of the software. Problems are identified earlier, and fixes are implemented before the components are built and compiled. The development team can now integrate the modules with fewer issues to slow the build phase.

It's also simpler to debug when the scope is limited to individual components since there's a limited source of errors for engineers to evaluate versus a fully merged application — speeding the time to bug resolution.

DevOps单元测试的类型:

  • White Box Testing:创建测试用例的员工知道软件的内部结构并根据设计规范进行评估。bob电竞官方下载也称为结构测试。
  • Black Box Testing: The employee does not know the internal structure or code of the application and evaluates against expected outcomes. Also known as functional testing.
  • 灰色盒子测试: The employee writing the test cases is partially aware of the structure and code as they evaluate for defects. This method combines black box and white box testing methods.

单位测试是通过以最简单的状态检查代码来检查左测试方法的中心实践。它还产生更多的弹性代码,以支持应用程序的安全性。接下来,我们将审查安全测试策略。

DevOps Security Testing

DevOps security testing

Image Source

DevOps securityis essential. A DevOps team is responsible not only for the security of their own pipeline but more importantly the security of the applications they are delivering to their customers. Whether those customers are internal employees or external users, the risks of deploying untested products are the same.

DevOps security testing is the systematic review of the application's code, structure, and operating environment to identify any weaknesses so that the team can mitigate them. These evaluations are done from individual code modules (think unit testing from the last section) all the way up to the fully integrated application and its surrounding infrastructure. Threats are determined, vulnerabilities are assessed, and patches are implemented to shore up defenses.

Types of DevOps Security Tests:

  • Vulnerability Scanning:扫描应用程序的端口,网络和周围基础架构,以确定未经授权访问或网络攻击的潜在机会
  • 渗透测试:评估扫描和其他测试用例确定的漏洞,以确定哪些漏洞是误报,哪些是真正的利用
  • Ethical Hacking: Authorized hacks of the application to attempt to gain unauthorized access from outside the organization or steal sensitive information to highlight any backdoors into the system
  • Risk Assessment:根据先前测试的结果,对应用程序中的风险进行全面审查和分类
  • Security Audits:Routine audits应用程序的虚拟和物理防御与其他测试的数据以及任何成功的攻击相结合,以获得DevOps团队的安全姿势的整体视图

Creating an application that is resilient toDDoSand other problems that cause downtime or outages is also a concern of DevOps security testing, which is informed by the results of DevOps performance tests.

DevOps性能测试

DevOps性能测试

Image Source

When an application is under development, initially it will only be accessible to the members of your DevOps team. However, it will typically be deployed to a much larger user base, so DevOps teams can confirm that the application's internal and external infrastructure will be able to accommodate this demand through DevOps performance testing. No team wants its web application to crash from something as benign as too much traffic.

预期的用户数量,对资源的需求,流量量(如果公开访问)以及其他相关基准将在计划阶段bob体育苹果系统下载安装确定,以便DevOps团队可以构建以满足这些标准。绩效测试是团队如何通过根据速度,可扩展性和稳定性的要求来确认应用程序准备生产和部署的应用程序。

Types of Performance Tests:

  • Load测试: Simulations of normal and peak usage of the built application to determine if it meets requirements for load times and consistently responds to requests
  • Stress Testing: Demos of application usage specifically to determine the "breakpoint" when the application's servers stop responding and to identify any other scenarios that overload the system
  • 容量测试:如果应用程序可以模拟测量公顷ndle massive amounts of data input or output while still performing additional functions and serving other users' requests
  • Capacity Testing:Evaluations to determine if an expected demand increase in the future will be supported by existing infrastructure and what will need to be added if not
  • Recovery Testing: Simulated outages to measure if and how the application recovers from downtime and the length of time required to return to a normal state of operations

Performance tests will be conducted before deployment and routinely once the application is live to confirm that it performs as expected. After this checkpoint, a DevOps team will want to set a regular testing cadence to confirm performance metrics aren't decreasing as the application's database grows. DevOps automated testing can help maintain this schedule and deliver findings faster.

DevOps Automated Testing

DevOps automated testing

Image Source

Automationis central to a productive DevOps model, and it applies equally to DevOps testing. The previous testing strategies we examined (unit testing, security testing, performance testing) can all be automated to varying degrees.

DevOps automated testing is less of a specific practice and more of a general strategy for how to approach testing in the DevOps model. Automation simplifies testing by providing scale to otherwise manual processes such as running repeated tests to see if an application’s servers fail to respond at any point.

While a human could perform this test, you'll have better returns by making your team members responsible for the overall testing strategy versus executing the individual test cases.DevOps工具是自动化的主要组成部分。我们将介绍可以帮助您简化下一节讨论的每个DEVOPS测试策略的工具。

Now that we know the different test strategies for our DevOps pipeline, let's examine tools that will help you optimize your testing methodology. We've identified three of the top tools tailored to meet your evaluation needs for each testing category.

Unit Testing Tools

Note:单元测试工具是针对特定语言量身定制的,因此我们选择了三种涵盖流行编码语言并在标题中召集其浓度的工具。

1.摩卡- JavaScript

价格: Free

摩卡JavaScript test case

摩卡is an open-source JavaScript test framework built in Node.js and supported in browsers. The tool performs tests asynchronously so that you can execute additional scripts and tasks while it runs in the background. Mocha will also provide comprehensive reporting on which tests passed and which failed so that you can narrow debugging down to individual test cases.

2.Typemock— C++ and .NET

价格: Free

Typemock C++ commands

Typemock is a unit testing framework tailored to support legacy code. The framework is supported on Windows and Linux for C# as well as Microsoft Visual Studio for .NET. It offers many features, including code coverage reports to identify areas not covered by existing test cases, suggestions for new test cases, instant review of newly written code to highlight lack of coverage to support test-driven development, and additional insights into the security of your code.

3.EMMA- 爪哇

价格: Free

EMMA code coverage report

EMMA is a unit testing framework for Java applications. Its focus is on recording the level of code covered by tests and highlighting gaps where more test cases are needed. The framework is designed to evaluate files quickly, and it is an open-source tool that is easy to install and integrate for quick deployment and feedback.

Security Testing Tools

4.ZED攻击代理

价格: Free

ZED攻击代理desktop application

Image Source

ZED攻击代理(ZAP)是一种开源渗透测试工具,用于识别Web应用程序中的漏洞。它提供自动化和被动的扫描功能以及手动识别软件防御中差距的工具。bob电竞官方下载ZAP与Windows,MacOS,Linux和Unix兼容。ZAP还提供了其他测试功能,例如代理服务器来拦截请求和蛮力攻击模拟。

5.SonarQube

价格: Free

SonarQube security report

Sonarqube是一个开源质量保证平台,旨在分析应用程序的安全问题和漏洞的代码。它还确定了错误和性能问题,以使您对代码的健康有整体的看法。此外,Sonarqube强制执行代码标准和最佳实践,以确保您的文件通过动态或静态分析进行清洁和可管理。

6.Nmap

价格: Free

Nmap Zenmap view

NMAP是一种开源工具,旨在快速扫描大型网络。NMAP使用RAW IP数据包来确定有关网络的数十个特征,包括可用主机,这些主机上的可用服务以及正在使用的防火墙。它在所有主要操作系统上都得到了支持,并提供了其他工具,以更多地了解扫描结果,例如NDIFF比较当前和以前的发现以识别模式。

性能测试工具

7.Apache Jmeter

价格: Free

Apache Jmeterlogging

Apache Jmeteris open-source software built for load testing applications and measuring performance. The tool runs tests across standard web protocols (e.g. HTTPS, FTP, TCP) and can simulate heavy loads across environments, including individual servers, groups of servers, networks, or objects. Additional features include a full-featured test IDE and dynamic reports.

DevOps testing tools

8.k6

价格: Free

k6 test results

k6 is a load, performance, and reliability testing tool that is available in either cloud or open-source deployments. It focuses on automating tests with performance goals to determine pass or fail and accepts test cases written in JavaScript to make onboarding easier versus learning an entirely new scripting language. k6 offers more than 20 integrations, including plugins with other DevOps tools such as GitHub and Jenkins.

9.捕食者

价格: Free

捕食者home page

Image Source

捕食者is a load testing tool that allows you to perform unlimited tests across an unlimited number of application instances. It integrates with Kubernetes, DC/OS, and Docker, and the tool provides real-time reporting on the results of tests. Additionally, it offers built-in capabilities for storing test data in Cassandra, Postgres, MySQL, MSSQL, and SQLITE formats.

自动化测试工具

10。testproject

价格: Free

TestProject仪表板

Image Source

testprojectis a test automation framework that evaluates applications in web and mobile environments. It supports Android and iOS testing as well as all major web browsers, and test cases can be written in its SDK tool or recorded in the browser. All cases can be shared with other team members. Finally, TestProject offers multiple add-ons and integrations with other open-source automation frameworks like Selenium and Appium.

11.

价格: Free

硒IDE

硒is an open-source automation tool for testing web applications across different web browser environments (i.e. Chrome, Mozilla Firefox, Internet Explorer) and different devices (e.g. smartphone, laptop, desktop, etc.). It also has a built-in scripting language to allow for easier automation of test cases and is one of the most popular test automation tools available. Selenium supports parallel test execution so that other tests run against the application concurrently, which saves time.

12.Leapwork

价格:免费试用带有付费计划

Leapwork team report

LEAPWORK是一个自动化平台,致力于通过无需脚本编写的视觉仪表板使非编码器可以访问测试自动化。该工具允许用户通过流程图构建测试,然后自动化它们以大规模评估应用程序。Leapwork可以针对完整的技术堆栈进行测试,包括Web应用程序,本地机器,虚拟机,甚至传统大型机。

Implementing DevOps Testing in Your Pipeline

To return to my creative writing example, my strategy for evaluating my writing did not come into place overnight. I learned by trial and error combined with a healthy amount of research and mentoring along the way.

In other words, I kepttestingand refining my strategy based on new data and input from stakeholders. We recommend the same method for your DevOps testing practices. Whether you already have testing strategies in place or are starting to create these, adopt the iterative process of DevOps and focus on continual improvements. DevOps is a journey, not a destination, and this applies to DevOps testing as much as the rest of the model. Your goal should not be to perfect your testing but to keep it adaptive to innovations and new methods. This approach will pay the most dividends as technology continues to evolve.

新的呼吁行动

css introduction

Originally published Dec 28, 2021 7:00:00 AM, updated December 28 2021

Topics:

Developer Operations