As we all know, the interaction between software services and components mainly relies on a large number of API interfaces.
Take Huawei Cloud's more than 300 commercial cloud services as an example. Each service contains an average of 500 interfaces, and the total number of interfaces is as high as 100,000. The interface calling context business scenarios are unimaginably complex.
How to ensure that the API test scenario is as complete as possible, without omissions, or causing serious problems on the live network? This is a classic problem that people currently encounter, and the common bottlenecks are mainly as follows:
So, how does Huawei Cloud solve these problems?
ATGen (APITestGenerator) is a context-aware API scenario-level zero-code independent test generation service that realizes fully automatic design, generation, execution and judgment of application API scenario-level tests without writing a single line of code.
The traditional test design and execution interaction model requires manual understanding of design documents, arrangement of test plans, and test automation development. This requires participants to be familiar with product or service business and interface documents, and to be proficient in testing technology, test automation framework, and test automation. Code writing.
Nowadays, with the support of AI algorithms that are independently designed, generated, executed, and judged independently, the human-computer interaction model of API scenario-level testing has undergone tremendous changes.
During the testing process, the machine independently parses documents and data and automatically generates an API scenario-level operation dependency ODG (OperationDependencyGraph) graph. The tester only needs to make appropriate revisions, and the machine can autonomously explore and traverse the ODG graph execution and complete the results synchronously. For judgment and report generation, testers only need to confirm the results in batches by category.
Based on the forward API interface definition document, Huawei Cloud ATGen automatically mines the API test context operation dependency graph (ODG), explores and traverses the ODG to independently generate API test sequences, constructs and issues API test requests in real time, and determines the API test response results. Dynamically correct the ODG map and optimize the next round of generation.
Six key features of Huawei Cloud ATGen:
*For specific technical details, please refer to the top conference papers published in ICSE and ASE [1, 2].
Huawei Cloud ATGen business value and application prospects:
Huawei Cloud ATGen has deployed 30 daily applications of products and services within Huawei, and measures business application effects in three dimensions:
Three typical business application scenario practices within Huawei
Product form: storage management & control service cloud products, northbound service-based, southbound control of embedded storage devices
Test team size: 50 people
Total number of northbound Restful interfaces: 2300
Current situation before application: The team is newly established and lacks interface and functional test automation protection network
Application mode: quickly build interface test and functional test protection network test cases from scratch
Application effect: A total of 350 interface defects were found, covering 3 major categories of defects. The effectiveness of API interface level requests can reach 80%, and the false positive rate is 10%.
Product form: operator & enterprise network assurance & intelligent operation and maintenance cloud services, public cloud/private cloud deployment
Test team size: 50 people
Total number of northbound Restful interfaces: 10,000
Current status before application: 8000 interface & functional test cases
Application mode: coverage enhancement and supplement to existing test cases
Application effect: Scenario test coverage increased by 30%, and 30 new deep business logic problems were discovered. Examples are as follows:
Product form: XX tool cloud native service
Test team size: full-featured team, no full-time testers
Total number of Restful interfaces: 1300
Current status before application: 10,000 interface test cases
Application mode: Integrate ATGen into the tool service alpha and beta environment pipeline. After the build is completed and the regression test task is completed, the generation task is automatically triggered to detect whether there are failed interfaces as alpha and beta access control reinforcement.
Application effect: 60 interface defects were additionally discovered, and the effectiveness of API interface test generation can reach 82%.
Faced with the rapid iteration of cloud product versions, application scenarios are becoming increasingly rich, and product functions are becoming increasingly complex. It is becoming increasingly difficult to rely solely on human testing experience to ensure quality. The independently generated full-scenario functional test robot ATGen emerged as the times require. It can achieve low-cost, zero-code, high-coverage, and low-false-positive API full-scenario testing, and continue to provide developers with high-quality services. 【1】"MOREST: Model-based RESTful API Testing with Execution Feedback", ICSE ’22,
【2】“Industry practice of automatic RESTful API testing”, ASE’22
Follow @HUAWEICloud for more information
The above is the detailed content of API full-scenario zero-code testing robot, Huawei Cloud releases ATGen in CodeArts TestPlan. For more information, please follow other related articles on the PHP Chinese website!