El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ CodeArts TestPlan/ Best Practices/ Testing Pyramid and Continuous Automated Testing

Testing Pyramid and Continuous Automated Testing

Updated on 2024-10-18 GMT+08:00

In agile and DevOps development modes, products must be able to be released at any time. This document describes how to use the testing pyramid and continuous integration and continuous delivery (CI/CD) automated testing to implement efficient test feedback and ensure the quality of products released at any time.

Testing Pyramid

The test automation pyramid was first proposed by Mike Cohn in 2009 in his book Succeeding with Agile: Software Development Using Scrum. It was first proposed as a three-layer pyramid, which consists of the GUI tests, service tests, and unit tests from top to bottom. With the development of agile tests, there are some variants of the test automation pyramid. In practice, the service tests can also be regarded as API tests.

The triangle structure indicates that the recommended investment proportion for automation at each layer increases from top to bottom.

Martin Fowler has a comment on the testing pyramid, "Most importantly such tests are very brittle. An enhancement to the system can easily end up breaking lots of such tests, which then have to be re-recorded. You can reduce this problem by abandoning record-playback tools, but that makes the tests harder to write. Even with good practices on writing them, end-to-end tests are more prone to non-determinism problems, which can undermine trust in them. In short, tests that run end-to-end through the UI are: brittle, expensive to write, and time consuming to run. So the pyramid argues that you should do much more automated testing through unit tests than you should through traditional GUI based testing."

The test technologies involved in each layer of the testing pyramid have their own advantages and limitations. The upper-layer GUI tests are brittle (instability), time-consuming (execution efficiency), and the distance between the problem symptom location (UI) and the root cause location (code) is too long. The testing pyramid focuses on the test quality instead of quantity. It is recommended that the bottom-layer test investment be increased.

  • A higher layer leads to lower running efficiency, which slows down the build-feedback cycle of continuous integration.
  • A higher layer leads to higher development complexity, which slows down delivery progress when the team capabilities are limited.
  • End-to-end testing is more likely to bring uncertainty in test results.
  • A lower layer leads to stronger unit isolation, which makes it easier to locate and analyze problems.

In principle, the unit test needs to be undertaken by the developers. In many teams, the developers are insufficient, so they have to focus on function implementation first. In addition, due to a lack of investment and experience in the unit test, many teams do not perform the unit test or just do it reactively. Some have proposed the anti-patterns of the pyramid structure—the Ice-Cream Cone and the Cupcake.

The Ice-Cream Cone pattern, proposed by Alister Scott in 2012, inverts the ratio of GUI tests and unit tests in the testing pyramid to form an inverted pyramid. In addition, a large number of manual tests are added above GUI tests. Although anti-patterns are not recommended, they are indeed used frequently. At the early stages, most teams did not perform automated testing and completely relied on manual tests. Later, the teams started from function test automation and generated some GUI automated testing cases. This way of building automated testing from outside to inside leads to such an anti-pattern. This pattern has some problems in terms of test efficiency and test case maintainability. However, it is an inevitable path for many teams to build test automation capabilities. When problems are accumulated to a certain level, this pattern needs to gradually evolve to the testing pyramid.

Continuous Automated Testing

Continuous automated testing is to run automated testing during CI/CD and quickly report failures. It is first derived from the idea that developers obtain quick feedback through unit tests in the development environment. Continuous automated testing gradually matures with the development of CI/CD. Today, developers are required to update product and fix online problems more and more quickly. If manual tests are still used frequently or development and testing are completely separated, it is difficult to ensure that the test quality assurance activities are completed in a short time window. Therefore, automated testing needs to be embedded in the CI/CD process to ensure the quality of deliverables.

Continuous testing means that test activities are incorporated into the continuous integration, feedback, and improvement cycle. Continuous testing runs through the entire software delivery cycle. Continuous testing advocates early, frequent, and automated testing.

"Continuous" is reflected in the whole process of evolving deliverables from small granularity to finished software in the agile and DevOps processes, from white-box code tests to component module tests, API tests, E2E function tests, and even online tests in the production environment after delivery. Each stage maps the layers of the testing pyramid from bottom to top. The lower-layer tests are performed in the early stages, and the upper-layer tests are performed in the later stages. This is similar to each stage of the automobile manufacturing pipeline. After the assembly in each stage is complete, necessary checks are performed before the next stage starts. During software DevOps development, the pipeline carries the assembly, check, and test processes.

  • Shift-left testing and shift-right testing

    During continuous testing, test activities can go beyond the time, role, and department restrictions of traditional tests, and are developed into coherent and continuous quality assurance activities.

    Shift-left testing emphasizes that the test activities are carried out as early as possible. The testers participate in the activities in the early stages of a software project. The related test cases are defined before the function development to detect quality problems in advance. The developers participate in the tests.

    Shift-right testing emphasizes that test monitoring is performed in the production environment, and that user feedback is obtained in real time to continuously improve user satisfaction and product quality.

  • Test automation

    To achieve fast flow and quick feedback, continuous testing needs to be automated to improve efficiency. Therefore, automated unit tests, API tests, and E2E tests are embedded into the DevOps pipeline. Automated testing improves test feedback efficiency and reduces errors caused by human factors. Test automation not only automates the execution of test case scripts, but also implements all other activities that can reduce manpower input, such as automatic environment creation, deployment, monitoring, and data analysis.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback