Testing framework

更新时间:
复制 MD 格式

Build a comprehensive testing strategy that covers unit tests, interface tests, UI tests, and production regression tests to improve delivery quality and reduce defect costs.

Software testing validates program correctness under specific conditions to find errors and measure quality. Common scenarios include functional, usability, performance, compatibility, automation, and reliability testing.

image.png

Unit testing

Unit tests verify the smallest testable units of software. Unlike integration or system tests, unit tests are performed early in the development cycle at the smallest scale and are led by developers. According to research:

  • 85% of bugs originate in the code design phase.

  • Bug fix costs increase exponentially the later a bug is found.

Unit tests significantly improve delivery quality and reduce labor costs.

Apsara Devops Flow provides out-of-the-box unit testing for mainstream languages, enabling cloud-migrating enterprises to run unit tests with minimal setup.

Module interface testing

Interface testing verifies that an API returns correct values for different input parameters. Key benefits include:

  • Interfaces are the primary method for servers to exchange data. Testing interfaces is equivalent to testing the underlying business logic.

  • Interface tests are easier to automate and more stable than UI tests, reducing manual regression costs and shortening release cycles.

Automated interface testing provides the following benefits:

  • Eliminates repetitive manual testing work.

  • Handles scenarios that are difficult or impossible to simulate manually.

  • Automates compilation, packaging, deployment, and CI/CD for the test environment.

  • Speeds up root-cause analysis. For example, a trace ID can pinpoint errors to a specific log entry or line of code.

  • Detects bugs early and automatically notifies testers for fast response.

Apsara Devops Automated Test (SAT) provides a graphical interface for writing and debugging test scripts. SAT supports multiple protocols and integrates with CI/CD pipelines.

User interface feature testing

UI testing covers web, mobile, desktop, and embedded interfaces. Each UI type requires different testing methods. For example, Windows desktop automation often uses AutoIT to simulate mouse operations.

Some UI scenarios require manual testing, such as verifying page layout and component styles (color, size, alignment). However, automation improves efficiency for logic-driven flows like logon, form CRUD operations, and workflows.

Apsara Devops Web UI Automated Test (AUI) provides codeless, graphical recording for UI test automation and integrates with CI/CD pipelines.

Production regression testing

As business systems grow complex, both manual and automated testing risk incomplete coverage, especially for legacy system changes. Traditional automated testing faces several challenges:

  • High script development costs

  • Tedious test data preparation

  • High sensitivity of scripts to environmental changes

Alibaba Cloud recommends using production traffic for automated regression testing. This approach eliminates the need to write test scripts or prepare test data. Real production traffic provides realistic use cases that catch bugs traditional testing might miss, while reducing labor costs and preventing production failures.

The Dual-Engine Automated Regression Platform (Doom) copies real production traffic for regression testing. Its automatic mocking mechanism supports both read and write APIs, including order and payment APIs.

image.png