Cloud native automatic testing method based on Paas cloud platform, storage medium, equipment and computer program product

By analyzing the architectural model of cloud-native applications and using genetic algorithms to optimize test cases, the problem that cloud-native automation testing technology is difficult to fully cover complex cloud-native applications is solved, and higher test coverage and quality are achieved, ensuring cloud-native applications Functional and performance.

CN119292926APending Publication Date: 2025-01-10CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411378992.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Cloud-native automation testing technology is difficult to fully cover all components of complex cloud-native applications and the interaction between them. Traditional automation testing technology can often only be tested on a single component, making it difficult to achieve comprehensive testing of the entire cloud-native application.

Method used

By analyzing the architectural models of cloud-native applications, identifying the interaction between components, and optimizing test cases with genetic algorithms to improve test coverage and test quality.

Benefits of technology

It improves the testing effect and quality of complex cloud-native applications, can cover the components and interaction relationships of cloud-native applications more comprehensively, detect and fix potential problems in advance, and improves development efficiency and software delivery quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292926A_ABST
    Figure CN119292926A_ABST
Patent Text Reader

Abstract

The invention discloses a cloud native automatic testing method based on a PaaS cloud platform, a storage medium, equipment and a computer program product, and the method comprises the steps: building an architecture model of a cloud native application through analyzing a configuration file, a service discovery mechanism and network configuration of a container arrangement tool of the cloud native application in the PaaS cloud platform; analyzing interaction relationships among different components in the cloud native application according to the established architecture model, wherein the interaction relationships comprise a service calling relationship, a message passing relationship and a data sharing relationship; the method comprises the following steps: randomly generating a plurality of test cases according to the interaction relationship among different components in the cloud native application in combination with the characteristics and test targets of the cloud native application, and carrying out optimization solution through a genetic algorithm to find out the test case with the highest test coverage rate. According to the method, the interaction relationship among the components in the architecture model of the cloud native application is analyzed, and the test case is optimized through the genetic algorithm, so that the test coverage is enhanced, and the test effect and quality of the complex cloud native application are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of cloud native testing technology, and specifically, relates to a cloud native automated testing method, storage medium, device and computer program product based on a Paas cloud platform. Background Art

[0002] Cloud-native automated testing technology is a key technology that has developed with the rise of cloud computing and cloud-native applications. The rise of cloud computing provides enterprises with elastic, scalable, and highly available infrastructure, making application development and deployment more flexible and efficient. Cloud-native applications are applications designed and built for cloud environments, with features such as containerization, microservice architecture, and elastic expansion, which can better adapt to the characteristics of cloud computing.

[0003] With the rapid development of cloud-native applications, software testing is also facing new challenges. Cloud-native applications are usually composed of multiple microservices, involving multiple containers, services, and components, and their complexity is far greater than that of traditional monolithic applications. Traditional manual testing methods cannot meet the needs of rapid iteration and continuous delivery, so automated testing technology is needed to improve testing efficiency and quality.

[0004] The development of cloud-native automated testing technology is inseparable from the concepts of continuous integration and continuous delivery. Continuous integration is a software development practice that can detect and solve problems early by frequently integrating and building code, ensuring that the team remains stable and reliable in rapid iterations; continuous delivery is the process of delivering tested and verified code to the production environment to speed up the speed and frequency of software delivery.

[0005] In a cloud-native environment, continuous integration and continuous delivery rely on automated testing to ensure software quality. Cloud-native automated testing technology can automatically execute test cases, verify the functionality, performance, and reliability of applications, and monitor the deployment and operation of applications in cloud environments. It can help development teams discover and fix potential defects and problems in a timely manner, and improve the quality and efficiency of software delivery.

[0006] The core goal of cloud-native automated testing technology is to achieve comprehensive test coverage and continuous test feedback. Through automated testing, all components and their interactions can be covered to ensure that the functions and performance of the entire cloud-native application meet expectations. At the same time, automated testing can also provide timely test feedback to help the development team quickly locate and solve problems and improve development efficiency.

[0007] In order to achieve cloud-native automated testing, it is necessary to combine a variety of technologies and tools. Among them, container orchestration tools such as Kubernetes can help build and manage the test environment of cloud-native applications; testing frameworks and tools such as Selenium, JUnit, and JMeter can be used to perform automated testing and performance testing; continuous integration and continuous delivery platforms such as Jenkins, Travis CI, and GitLab CI / CD can integrate automated testing processes and provide test reports and feedback.

[0008] The background of cloud-native automated testing technology is that it is a key technology developed in the context of cloud computing and cloud-native applications to cope with the challenges of complexity and rapid delivery and to improve software quality and development efficiency. It supports the development and deployment of cloud-native applications by automating the execution of test cases, verifying the functions and performance of applications, and continuously monitoring the deployment and operation of applications, achieving comprehensive test coverage and continuous test feedback.

[0009] However, cloud-native automated testing technology has limited testing coverage for complex systems. Since cloud-native applications are usually composed of multiple microservices, involving multiple containers, services, and components, it is a challenge to test all components and the interactions between them. Traditional automated testing technology can often only test a single component, and it is difficult to fully cover the complex structure and dynamic changes of the entire cloud-native application. Summary of the invention

[0010] In response to the problems existing in the prior art, the present invention provides a cloud-native automated testing method, storage medium, device and computer program product based on the Paas cloud platform, which analyzes the interaction between components in the architecture model of cloud-native applications and optimizes test cases through genetic algorithms to enhance test coverage and improve the testing effect and quality of complex cloud-native applications.

[0011] To achieve the above technical objectives, the present invention adopts the following technical solution: a cloud native automated testing method based on Paas cloud platform, specifically comprising the following steps:

[0012] Step S1: Establish an architecture model of the cloud native application by analyzing the configuration file, service discovery mechanism, and network configuration of the container orchestration tool of the cloud native application in the PaaS cloud platform;

[0013] Step S2: Analyze the interaction relationship between different components in the cloud native application according to the established architecture model, including: service call relationship, message transmission relationship and data sharing relationship;

[0014] Step S3: randomly generate a number of test cases according to the interaction relationship between different components in the cloud native application and in combination with the characteristics and test objectives of the cloud native application;

[0015] Step S4: Use a number of randomly generated test cases as the initial population of the genetic algorithm, optimize and solve the genetic algorithm, find the test case with the highest test coverage, and perform automated testing.

[0016] Furthermore, step S1 includes the following sub-steps:

[0017] Step S1.1, obtaining the structure and deployment information of the cloud native application by analyzing the configuration file of the container orchestration tool of the cloud native application;

[0018] Step S1.2, using a service discovery mechanism to obtain the services in the cloud native application as well as the location and communication method of the services;

[0019] Step S1.3, obtaining detailed information about the network topology of the cloud native application by analyzing the network configuration in the Kubernetes cluster in the cloud native application;

[0020] Step S1.4: Establish an architectural model of the cloud native application based on the structure and deployment information of the cloud native application obtained in step S1.1, the services in the cloud native application as well as the location and communication methods of the services obtained in step S1.2, and the detailed information about the network topology of the cloud native application obtained in step S1.3.

[0021] Further, step S2.1, according to the constructed architecture model, identifying the service provider component, the service consumer component and the calling relationship between the service provider component and the service consumer component, and obtaining the service calling relationship;

[0022] Step S2.2, according to the constructed architecture model, analyze the asynchronous communication message, determine the message sender component, the message receiver component, the content and format of the message, and the message transmission method and sequence, and obtain the message transmission relationship;

[0023] Step S2.3: According to the constructed architecture model, determine the components, shared data types and access methods that have data sharing relationships in the cloud native application to obtain the data sharing relationship.

[0024] Furthermore, step S4 includes the following sub-steps:

[0025] Step S4.1, using a number of randomly generated test cases as the initial population of the genetic algorithm, each test case as an individual of the genetic algorithm, and setting the maximum number of iterations of the genetic algorithm;

[0026] Step S4.2, calculate the test coverage of each test case, and retain the test case with the largest test coverage;

[0027] Step S4.3: In the next iteration, according to the test coverage of the test cases in the current iteration, the roulette wheel method is used to select the test cases, and the selected test cases are updated by crossover and mutation;

[0028] Step S4.4: Repeat steps S4.2-S4.3 for the updated test case until the maximum number of iterations is reached, and use the test case with the highest test coverage as the test case of the cloud native application for automated testing.

[0029] Furthermore, the calculation process of the test coverage of the test case is:

[0030]

[0031] Among them, F t,i represents the test coverage of the i-th test case in the t-th iteration, N t,i N represents the number of components actually covered by the i-th test case in the t-th iteration. all Indicates the number of all components in a cloud-native application.

[0032] Furthermore, the process of selecting test cases using the roulette wheel method in step S4.3 is as follows: the higher the test coverage of a test case, the easier it is for the test case to be selected in the next iteration:

[0033]

[0034] Among them, P(F t+1,i ) represents the probability of the i-th test case being selected in the t+1-th iteration, and I represents the number of all test cases in the t-th iteration.

[0035] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the cloud-native automated testing method based on the Paas cloud platform.

[0036] Furthermore, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the cloud-native automated testing method based on the Paas cloud platform is implemented.

[0037] Furthermore, the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the cloud-native automated testing method based on the Paas cloud platform.

[0038] Compared with the prior art, the present invention has the following beneficial effects: the cloud-native automated testing method based on the Paas cloud platform of the present invention constructs an architectural model of cloud-native applications, analyzes the interaction relationship between different components, and then constructs test cases, which can cover as many components of complex cloud-native applications as possible, thereby improving the test effect and quality; and, the present invention introduces a genetic algorithm to optimize the test cases, which can generate diversified test cases, thereby improving the test coverage of the test cases and improving the test effect and quality of complex cloud-native applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is a flow chart of the cloud-native automated testing method based on the Paas cloud platform of the present invention;

[0040] Figure 2 The flowchart of the genetic algorithm optimization test case in the present invention. DETAILED DESCRIPTION

[0041] The technical solution of the present invention is further explained below in conjunction with the accompanying drawings.

[0042] like Figure 1 The flowchart of the cloud native automated testing method based on the Paas cloud platform of the present invention specifically includes the following steps:

[0043] Step S1: Establish an architecture model of cloud-native applications by analyzing the configuration files, service discovery mechanisms, and network configurations of the container orchestration tools of cloud-native applications in the PaaS cloud platform. The architecture model clearly reflects the components, services, and their interactions of the cloud-native applications, so that the automated testing process of cloud-native applications can be based on an accurate architecture model, thereby improving the accuracy and efficiency of the test. The specific steps include the following:

[0044] Step S1.1: By analyzing the configuration file of the container orchestration tool of the cloud-native application, the configuration file can know the components of the cloud-native application and the relationship between the components, such as which containers run on which nodes, the dependencies and network connections between them, etc., so as to obtain the structure and deployment information of the cloud-native application;

[0045] Step S1.2: Use the service discovery mechanism to obtain the services in the cloud native application, as well as the location and communication methods of the services. Through the Service object of Kubernetes, you can determine the name, IP address, port and other information of the service, so as to understand the communication path between services;

[0046] Step S1.3, by analyzing the network configuration in the Kubernetes cluster in the cloud native application, obtain detailed information about the network topology of the cloud native application, such as subnets, routes, and network policies, etc., which can help understand the network connection mode, access control rules, and security configuration information in the cloud native application;

[0047] Step S1.4: Based on the structure and deployment information of the cloud-native application obtained in step S1.1, the services in the cloud-native application as well as the location and communication methods of the services obtained in step S1.2, and the detailed information about the network topology of the cloud-native application obtained in step S1.3, an architectural model of the cloud-native application is established, which can accurately describe the components, services, and interaction relationships of the cloud-native application, thereby improving the accuracy and efficiency of the test.

[0048] Step S2: Analyze the interaction relationship between different components in the cloud-native application according to the established architecture model, including: service call relationship, message passing relationship and data sharing relationship. By analyzing the interaction relationship between different components, it is possible to design automated test cases more accurately, cover various interaction scenarios, and discover potential problems and defects in a timely manner. At the same time, through test cases designed for interaction relationships, the collaboration and integration between components can be verified to ensure that the functions and performance of cloud-native applications are fully verified.

[0049] Step S2 specifically includes the following sub-steps:

[0050] Step S2.1, different components make service calls by calling API or message bus. Therefore, according to the constructed architecture model, the service provider component, the service consumer component and the calling relationship between the service provider component and the service consumer component are identified to obtain the service calling relationship;

[0051] Step S2.2: The components of the cloud-native application communicate asynchronously through message queues, event buses, or similar mechanisms. According to the constructed architecture model, analyze the asynchronous communication messages, determine the message sender component, message receiver component, message content and format, and message delivery method and order, and obtain the message delivery relationship. Based on the message delivery relationship, deeply understand the message delivery mechanism, so as to design corresponding test cases to verify the correct delivery and processing of messages;

[0052] Step S2.3: In cloud-native applications, different components may need to share data, such as databases, file systems, or shared storage. Based on the constructed architecture model, determine the components, shared data types, and access methods that have data sharing relationships in cloud-native applications, and obtain the data sharing relationships. The data sharing relationships help design test cases and verify the correct sharing and consistency of data.

[0053] Step S3: According to the interaction relationship between different components in the cloud native application, combined with the characteristics and test objectives of the cloud native application, several test cases are randomly generated. Specifically, according to the interaction relationship, different test paths, data inputs and interaction sequences are traversed. Assuming that the number of components in the cloud native application is n, the number of interaction relationships between components is m, and according to the multiple states of each component, the number of possible test cases is N. all =n m , randomly generate multiple test cases.

[0054] Step S4: Use the randomly generated test cases as the initial population of the genetic algorithm, optimize and solve the genetic algorithm, find the test cases with the highest test coverage, and perform automated testing. The genetic algorithm can generate a variety of test cases in a short time, thereby improving the test coverage of the test cases and improving the test effect and quality of complex cloud native applications. Figure 2 , specifically including the following sub-steps:

[0055] Step S4.1, using a number of randomly generated test cases as the initial population of the genetic algorithm, each test case as an individual of the genetic algorithm, and setting the maximum number of iterations of the genetic algorithm;

[0056] Step S4.2: Calculate the test coverage of each test case and retain the test case with the highest test coverage. The higher the test coverage, the more comprehensive the test case can test the cloud-native application, thereby discovering and fixing potential problems in the cloud-native application, thereby improving the stability and security of the cloud-native application.

[0057] The calculation process of the test coverage of the test case in the present invention is:

[0058]

[0059] Among them, F t,i represents the test coverage of the i-th test case in the t-th iteration, N t,i N represents the number of components actually covered by the i-th test case in the t-th iteration. all Indicates the number of all components in a cloud-native application.

[0060] Step S4.3: In the next iteration, according to the test coverage of the test cases in the current iteration, the roulette method is used to select test cases, and the selected test cases are updated by crossover and mutation, which helps to explore new search spaces and may find better test cases than those in the current iteration, preventing the genetic algorithm from falling into a local optimal solution.

[0061] The process of selecting test cases using the roulette wheel method in the present invention is as follows: the higher the test coverage of a test case, the easier it is for the test case to be selected in the next iteration:

[0062]

[0063] Among them, P(F t+1,i ) represents the probability of the i-th test case being selected in the t+1-th iteration, and I represents the number of all test cases in the t-th iteration.

[0064] Step S4.4: Repeat steps S4.2-S4.3 with the updated test case until the maximum number of iterations is reached, and use the test case with the highest test coverage as the test case of the cloud native application.

[0065] The present invention can more effectively traverse the architecture model and interaction relationship of cloud native applications through genetic algorithms, and find test cases with high test coverage in a relatively short time by simulating the inheritance and mutation mechanisms in the biological evolution process. High-coverage test cases can cover more interactive scenarios, ensure the breadth and depth of the test, and can more comprehensively check the operation of cloud native applications, discover and fix potential problems early, and improve the stability and security of cloud native applications. Compared with traditional exhaustive methods or random searches, genetic algorithms can approach the optimal solution faster, greatly improving the testing efficiency of cloud native applications.

[0066] In a technical solution of the present invention, a computer-readable storage medium is also provided, storing a computer program, wherein the computer program enables a computer to execute the cloud-native automated testing method based on the Paas cloud platform.

[0067] In a technical solution of the present invention, an electronic device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the cloud-native automated testing method based on the Paas cloud platform is implemented.

[0068] In a technical solution of the present invention, a computer program product is also provided, including a computer program, which implements the cloud-native automated testing method based on the Paas cloud platform when executed by a processor.

[0069] In the embodiments disclosed in the present application, the computer storage medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. The computer storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of computer storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0070] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0071] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.

Claims

1. A cloud-native automated testing method based on Paas cloud platform, characterized in that: The specific steps include: Step S1: Establish an architecture model of the cloud native application by analyzing the configuration file, service discovery mechanism, and network configuration of the container orchestration tool of the cloud native application in the PaaS cloud platform; Step S2: Analyze the interaction relationship between different components in the cloud native application according to the established architecture model, including: service call relationship, message transmission relationship and data sharing relationship; Step S3: randomly generate a number of test cases according to the interaction relationship between different components in the cloud native application and in combination with the characteristics and test objectives of the cloud native application; Step S4: Use a number of randomly generated test cases as the initial population of the genetic algorithm, optimize and solve the genetic algorithm, find the test case with the highest test coverage, and perform automated testing.

2. According to a cloud-native automated testing method based on Paas cloud platform according to claim 1, it is characterized in that: Step S1 includes the following sub-steps: Step S1.1, obtaining the structure and deployment information of the cloud native application by analyzing the configuration file of the container orchestration tool of the cloud native application; Step S1.2, using a service discovery mechanism to obtain the services in the cloud native application as well as the location and communication method of the services; Step S1.3, obtaining detailed information about the network topology of the cloud native application by analyzing the network configuration in the Kubernetes cluster in the cloud native application; Step S1.4: Establish an architectural model of the cloud native application based on the structure and deployment information of the cloud native application obtained in step S1.1, the services in the cloud native application as well as the location and communication methods of the services obtained in step S1.2, and the detailed information about the network topology of the cloud native application obtained in step S1.

3.

3. According to a cloud-native automated testing method based on Paas cloud platform according to claim 2, it is characterized in that: Step S2.1, according to the constructed architecture model, identify the service provider component, the service consumer component and the calling relationship between the service provider component and the service consumer component to obtain the service calling relationship; Step S2.2, according to the constructed architecture model, analyze the asynchronous communication message, determine the message sender component, the message receiver component, the content and format of the message, and the message transmission method and sequence, and obtain the message transmission relationship; Step S2.3: According to the constructed architecture model, determine the components, shared data types and access methods that have data sharing relationships in the cloud native application to obtain the data sharing relationship.

4. According to a cloud-native automated testing method based on Paas cloud platform according to claim 3, it is characterized in that: Step S4 includes the following sub-steps: Step S4.1, using a number of randomly generated test cases as the initial population of the genetic algorithm, each test case as an individual of the genetic algorithm, and setting the maximum number of iterations of the genetic algorithm; Step S4.2, calculate the test coverage of each test case, and retain the test case with the largest test coverage; Step S4.3: In the next iteration, according to the test coverage of the test cases in the current iteration, the roulette wheel method is used to select the test cases, and the selected test cases are updated by crossover and mutation; Step S4.4: Repeat steps S4.2-S4.3 for the updated test case until the maximum number of iterations is reached, and use the test case with the highest test coverage as the test case of the cloud native application for automated testing.

5. According to a cloud-native automated testing method based on Paas cloud platform according to claim 4, it is characterized in that: The calculation process of the test coverage of the test case is: Among them, F t,i represents the test coverage of the i-th test case in the t-th iteration, N t,i N represents the number of components actually covered by the i-th test case in the t-th iteration. all Indicates the number of all components in a cloud-native application.

6. According to a cloud-native automated testing method based on Paas cloud platform according to claim 5, it is characterized in that: The process of selecting test cases using the roulette wheel method in step S4.3 is as follows: the higher the test coverage of a test case, the easier it is for the test case to be selected in the next iteration: Among them, P(F t+1,i ) represents the probability of the i-th test case being selected in the t+1-th iteration, and I represents the number of all test cases in the t-th iteration.

7. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables the computer to execute the cloud-native automated testing method based on the Paas cloud platform as described in any one of claims 1-6.

8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the cloud-native automated testing method based on the Paas cloud platform as described in any one of claims 1 to 6 is implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by the processor, the cloud-native automated testing method based on the Paas cloud platform described in any one of claims 1 to 6 is implemented.