Software testing method and system based on fusion containerization and intelligent scheduling

By adopting a method of converged containerization and intelligent scheduling in software testing, the shortcomings of existing automated testing technologies in functional limitations, expansion capabilities and resource utilization are solved, efficient utilization of test tools and data privacy protection are achieved, and testing efficiency and consistency are improved.

CN119652788APending Publication Date: 2025-03-18NARI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411787938.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The existing automated testing technology has shortcomings in terms of lightweight, high efficiency and ease of use, resulting in problems such as functional limitations, insufficient expansion capabilities and low resource utilization.

Method used

Using a software testing method based on converged containerization and intelligent scheduling, through lightweight containerized packaging testing tools, intelligent scheduling technology and elastic scaling technology, efficient utilization and dynamic management of test resources are achieved.

Benefits of technology

It improves the efficiency and consistency of testing tools, protects data privacy, realizes efficient utilization of resources and improves testing efficiency, and promotes vulnerability library information sharing and collaborative innovation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652788A_ABST
    Figure CN119652788A_ABST
Patent Text Reader

Abstract

The invention discloses a software testing method based on fusion containerization and intelligent scheduling, which comprises the following steps of: (1) determining a testing requirement, and preparing a testing environment; (2) carrying out lightweight containerization packaging on software of the test tool; (3) performing testing, generating a test report after the testing is completed, and selecting an idle test report analysis executor to perform report analysis by utilizing an intelligent scheduling technical scheme; if the resources of the test report analysis executor are insufficient, the resources of the test report analysis executor are expanded by adopting an elastic scaling technology for report analysis, and if the resources are more and idle for a long time, the resources of the test report analysis executor are reduced by adopting the elastic scaling technology; and (4) updating the maintenance software according to the test report. According to the method, the coverage rate and the reliability of the test are remarkably improved, the distribution of the test resources is optimized, and the test process is quicker and more efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to software testing services, and in particular to a software testing method and system based on fusion containerization and intelligent scheduling. Background Art

[0002] Software testing is a key process to ensure that software products can run normally and meet user needs under various conditions. In the daily software production and iteration process, a variety of test software needs to be used. There are many types of test software, and there are different degrees of learning costs and usage costs in the test and use process. Kubernetes is a general platform, and the test report parsing service (a general term for report parsing and test report parsing executors) is developed and designed. The specific deployment, implementation and implementation are all on the test report parsing and test report parsing executors.

[0003] The existing automated testing technology still has a lot of room for improvement in terms of lightweight, high efficiency and ease of use. The following problems exist:

[0004] 1. Functional limitations

[0005] General testing tools usually only support specific test types or fields and cannot provide comprehensive testing services. This may cause users to purchase and use multiple tools to meet different testing needs. Testing tools may only support specific test types or fields, such as only supporting interface testing or performance testing, and cannot cover other types of testing requirements. This may lead to incomplete testing work.

[0006] 2. Insufficient expansion capabilities

[0007] The testing tools may lack sufficient scalability and cannot meet the testing team's needs for customization and secondary development of the testing tools.

[0008] 3. Low resource utilization

[0009] Testing resources are distributed among various units, and sharing and collaboration are impossible, resulting in repeated purchases of similar resources. There is also a lot of duplication of labor and management costs in the construction and maintenance of the test environment, and the self-built model will also lead to the siloing of test data and information. Therefore, it is necessary to establish a unified test platform to centrally manage and share test resources, improve resource utilization and test efficiency, and achieve cost reduction and efficiency improvement. Summary of the invention

[0010] Purpose of the invention: To solve the above problems, this patent proposes a software testing method and system based on the integration of containerization and intelligent scheduling. It can design and develop a test resource pool to accommodate a variety of testing tools while protecting data privacy. It can not only improve the accuracy and efficiency of detection, but also promote vulnerability library information sharing and collaborative innovation within the industry.

[0011] Technical solution: A software testing method based on integrated containerization and intelligent scheduling, including the following steps:

[0012] (1) Determine test requirements and prepare the test environment;

[0013] (2) Packaging the test tool software in a lightweight container;

[0014] (3) Conduct the test, generate a test report after the test is completed, and use the intelligent scheduling technology to select an idle test report parsing executor to parse the report; if the test report parsing executor resources are insufficient, elastic scaling technology is used to expand the test report parsing executor resources for report parsing; if the resources are large and idle for a long time, elastic scaling technology is used to reduce the test report parsing executor resources; the test report parsing executor is used to receive and execute tasks;

[0015] (4) Update and maintain software based on test reports.

[0016] Furthermore, the lightweight containerization packaging encapsulates the test tool into a Docker image, including the following steps:

[0017] Prepare the installation packages required for packaging test tools and set up basic images; compile the automated script Dockerfile for image production; use Docker software to run the automated script Dockerfile to automatically generate Docker images for test tools; compile automated script Dockerfile for different test tools, and automatically generate Docker images for test tools; upload the Docker images of all test tools to the image repository; when starting software testing, configure the YAML file as required, execute the Docker images of the test tools in sequence according to the order set in the YAML file, and generate a test report after the test is completed.

[0018] Furthermore, the software lightweight container packaging adopts a post-test burn solution.

[0019] The running state of the Docker image is the Docker container. In the Kubernetes platform, multiple Docker containers are used for serial execution. After the execution is completed, all Docker containers and the source code uploaded by the user are destroyed, leaving only the test report.

[0020] Furthermore, the intelligent scheduling technical solution is specifically as follows:

[0021] When a new test report parsing task is to be executed, the scheduling service will perform dynamic service routing according to the following steps to ensure that the scheduling service can access the qualified test report parsing executor:

[0022] Service instance retrieval: The scheduling service first obtains a list of all available test report parsing executors; a service instance refers to a test report parsing executor.

[0023] Metadata evaluation: Filter out the test report parsing executor with the largest remaining memory space; this step uses the JVM memory information in the service metadata.

[0024] Threshold check: Calculate the sum of the remaining memory space and the size of the report file to be parsed to ensure that it does not exceed the preset heap memory usage threshold (for example, not exceeding 80% of the total heap memory); if the condition is met, select the test report parsing executor; otherwise, abandon the current scheduling attempt and wait for the next round of query;

[0025] Polling mechanism: The scheduling task in the scheduling service is polled in a period of s seconds to continuously search for test report parsing executors that meet the conditions.

[0026] Furthermore, the elastic scaling technology is specifically:

[0027] Obtain and calculate the remaining memory of the test report parsing service in real time. The smallest logical unit in the test report parsing service is the test report parsing executor. Obtain the status data of all test report parsing executors, use the status data to create a resource pool and monitor the log information of the test report parsing executors.

[0028] Start the polling timer task, check the status of the test report parsing executor in a period of t minutes, calibrate and obtain the status data of the test report parsing executor in the resource pool;

[0029] If the scheduling service issues an instruction to reduce the number of test report parsing executors, triggering the scaling-down mechanism, the idle test report parsing executors are first screened to determine whether the number of idle test report parsing executors reaches the set lower limit of the number of test report parsing executors. If the lower limit is not reached, the number of test report parsing executors is reduced by 1. Otherwise, the current instruction is ignored. The lower limit is set to 3, and this setting is added to the configuration file.

[0030] If the scheduling service issues a command to add a test report parsing executor, the expansion mechanism is triggered to determine whether the number of active test report parsing executors has reached the upper limit of the number of test report parsing executors. If it has not reached the upper limit, the number of test report parsing executors is increased by 1. Otherwise, the task enters the queue and waits for execution. The upper limit is set to 10, and this setting is added to the configuration file.

[0031] A software testing system based on fusion containerization and intelligent scheduling, including an initial module, a packaging module, a testing module and a maintenance module;

[0032] The initial module determines the test requirements and prepares the test environment;

[0033] The packaging module performs lightweight container packaging on the software of the testing tool;

[0034] The test module performs the test, generates a test report after the test is completed, and uses the intelligent scheduling technology solution to select an idle test report parsing executor for report parsing; if the test report parsing executor resources are insufficient, the elastic scaling technology is used to expand the test report parsing executor resources for report parsing; if the resources are large and idle for a long time, the elastic scaling technology shrinks the test report parsing executor resources; the test report parsing executor is used to receive and execute tasks;

[0035] The maintenance module updates the maintenance software according to the test report.

[0036] Beneficial effects: (1) The use of lightweight containerization technology not only has a good application scenario in the use of test tools, but also has the advantage of supporting asynchronous concurrent execution of multiple test tasks. It can meet the parallelization of diversified test tools in multi-task scenarios, thereby improving the full utilization of test server resources.

[0037] (2) In the report parsing phase, the intelligent scheduling solution not only provides a registration and discovery mechanism for service instances, but also provides solid technical support for the dynamic resource scheduling and intelligent service distribution of the cloud platform through its custom metadata extension function.

[0038] (3) This patent uses Kubernetes API to implement basic functions, and provides stable performance support for the report parsing of test tasks through independently developed elastic scaling technology. It uses the strategy of expanding capacity during high-task periods and shrinking capacity during idle periods, solving the problem of excessive memory consumption caused by large file type reports, leading to microservice crashes and restarts. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is a lightweight containerization flow chart of the test tool in the present invention;

[0040] Figure 2 This is a containerization flow chart of Fortify in an embodiment of the present invention;

[0041] Figure 3 This is an architecture diagram of the intelligent scheduling technical solution of the present invention;

[0042] Figure 4 This is a flow chart of the elastic scaling technology of the present invention. DETAILED DESCRIPTION

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

[0044] A software testing method based on integrated containerization and intelligent scheduling includes the following steps:

[0045] (1) Determine test requirements and prepare the test environment;

[0046] (2) Packaging the test tool software in a lightweight container;

[0047] (3) Conduct the test, generate a test report after the test is completed, and use the intelligent scheduling technology to select an idle test report parsing executor to perform report parsing; if the test report parsing executor resources are insufficient, then use elastic scaling technology to expand the test report parsing executor resources for report parsing; if the resources are large and idle for a long time, the elastic scaling technology will shrink the test report parsing executor resources; the test report parsing executor is used to receive tasks and execute tasks;

[0048] (4) Update and maintain software based on test reports.

[0049] Lightweight containerization technology plays a vital role in the present invention patent. Its core idea is to realize the distributed processing of software testing and the containerization of test tools. In the traditional software testing model, testers need to download and install various test software, and then access the test samples for testing. This not only increases the cost of use, but also brings the risk of data privacy leakage. If the level of the tester and the rule base of the test tool are inconsistent, it is easy to cause deviations in the test results, which is easy to mislead the project team. The lightweight containerization technology containerizes the test tools and uses them in the cloud platform, and then uses the containerized test tools in a diversified way using the Nacos configuration center and Kubernetes task modules, which effectively improves the efficiency of the test tools, ensures the consistency of the test results, and protects data privacy.

[0050] This patent uses lightweight containerization technology to containerize and encapsulate the software of the test tool, collect and prepare all the software programs required for installation, design the installation steps of the test tool, and then write the Dockerfile compilation file. The containerized Docker image is obtained through the Docker build command, and then the same steps are used to create diversified Docker images according to the software testing process.

[0051] Finally, upload this series of Docker images to the image repository, start the test task in Kubernetes by configuring the YAML file, execute the containers step by step in the configured order, perform the customized test tasks and produce the results.

[0052] Lightweight containerization technology provides an innovative data privacy protection mechanism in this invention patent. The "test-after-test" test task not only ensures the recycling and release of detection resources, but also ensures the security of data.

[0053] The lightweight containerization flow chart of the test tool is as follows Figure 1 shown.

[0054] Taking the containerization of the code detection tool Fortify as an example, the test task consists of a code upload container, a dependency upload container, a Fortify scan container, and a report parsing container. The code upload container represents the introduction of the user-uploaded code into the test container; the dependency upload container represents the introduction of the user-uploaded code dependency file package into the test container; the Fortify scan container represents the encapsulated Fortify code testing tool; the report parsing container represents the report generated after the code is detected, and this container is responsible for the result content parsing.

[0055] When the Fortify scanning container is executed, the code file and the Fortify scanning container are destroyed together during the execution of the report parsing container, and only the report results after scanning are left and transferred to the report parsing container for result analysis. Figure 2 .

[0056] In addition, lightweight containerization technology not only has a good application scenario in the use of testing tools, but also has the advantage of supporting asynchronous concurrent execution of multiple test tasks. It can meet the parallel use of diversified test tools in multi-tasking scenarios, thereby improving the full utilization of test server resources.

[0057] Intelligent scheduling plays a vital role in this patent. The report parsing stage is the final link in the execution of the test task, and it is also the link that is most likely to cause a sharp increase in resource consumption, which in turn causes a scheduling performance bottleneck. Despite attempts to alleviate the pressure by increasing the resource quota of the service node, the parsing failure rate still exists, highlighting the limitations of the traditional architecture. To this end, this patent designs a set of custom load balancing strategies based on Nacos (Service Registration and Configuration Center) to achieve intelligent scheduling and dynamic resource management of test report parsing tasks. The architecture of intelligent scheduling technology is as follows: Figure 3 shown.

[0058] Preferably, Nacos is used as the key component of the service registration and configuration center in this patent, which not only provides a registration and discovery mechanism for service instances, but also provides solid technical support for dynamic resource scheduling and intelligent service distribution of the cloud platform through its custom metadata extension function.

[0059] The test report parsing and execution service will regularly report its runtime status to Nacos, paying special attention to the JVM memory usage. By integrating Java's Runtime API, the test report parsing and execution service can capture real-time snapshots of the JVM's memory usage, including important indicators such as the usage ratio of heap memory and non-heap memory, and the frequency of garbage collection. These real-time data are then encoded as custom metadata, registered and updated to Nacos, forming a dynamic, real-time service health portrait, providing a rich information foundation for subsequent intelligent scheduling decisions. The test report parsing and scheduling service executes an intelligent distribution strategy based on the above metadata, using a custom load balancing rule (LoadBalanceRule).

[0060] Elastic scaling technology is another core component of the present invention patent. It combines the advantages of intelligent scheduling technology and provides an accurate, efficient and mature method for elastic scaling of server resources. Figure 4 .

[0061] Preferably, this patent uses Kubernetes API to implement basic functions, and realizes overall functions through self-developed elastic scaling technology algorithms. The purpose is to provide stable performance support for the report parsing of test tasks, using the strategy of expanding capacity during high-task and shrinking capacity during idle time, solving the problem of excessive memory consumption caused by large file type reports, leading to microservice crash and restart.

[0062] The basic principles of resource management are as follows:

[0063] 1. The maximum number of actuators that can be started for test report analysis is 10;

[0064] 2. The minimum number of actuators to be started in the test report analysis is 3;

[0065] 3. To start a new test report parsing executor, you only need to determine whether the upper limit has been reached. If it meets the requirements, you can expand the capacity by one unit;

[0066] 4. To shrink the old execution period, you need to filter out idle test report parsing executors and find the test report parsing executor with the lowest activity to shrink it;

[0067] 5. The test report parsing actuator rotation inspection cycle is 15 minutes, and only one test report parsing actuator is allowed to be expanded or contracted each time;

[0068] This patent proposes a method and system for implementing a new test system based on the integration of microservice containerization and intelligent scheduling. Under the premise of protecting data privacy, this method can design and develop a test resource pool to accommodate a variety of test tools. Different users store test configuration information, samples for inspection, and report information in the resource pool. It uses lightweight containerization technology, intelligent scheduling technology, and custom elastic scaling technology to achieve efficient use of test resources. A large-scale comprehensive test system is designed to provide a variety of testing services for R&D testers, which greatly facilitates the test work of testers and reduces time and learning costs. It can not only improve the accuracy and efficiency of detection, but also promote the sharing of vulnerability library information and collaborative innovation within the industry, and promote the high-quality development of the testing industry.

Claims

1. A software testing method based on fusion containerization and intelligent scheduling, characterized in that: The following steps are involved: (1) Determine test requirements and prepare the test environment; (2) Packaging the test tool software in a lightweight container; (3) Conducting a test, generating a test report after the test is completed, and using an intelligent scheduling technology solution to select an idle test report parsing executor for report parsing; if the test report parsing executor resources are insufficient, elastic scaling technology is used to expand the test report parsing executor resources for report parsing; if the resources are large and idle for a long time, elastic scaling technology is used to shrink the test report parsing executor resources; the test report parsing executor is used to receive and execute tasks; (4) Update and maintain software based on test reports.

2. According to claim 1, a software testing method based on fusion containerization and intelligent scheduling is characterized in that: The lightweight containerization packaging encapsulates the test tool into a Docker image, including the following steps: Prepare the installation packages required for packaging test tools and set up basic images; compile the automated script Dockerfile for image production; use Docker software to run the automated script Dockerfile to automatically generate Docker images for test tools; compile automated script Dockerfile for different test tools, and automatically generate Docker images for test tools; upload the Docker images of all test tools to the image repository; when starting software testing, configure the YAML file as required, execute the Docker images of the test tools in sequence according to the order set in the YAML file, and generate a test report after the test is completed.

3. According to claim 1, a software testing method based on fusion containerization and intelligent scheduling is characterized in that: The software is lightweight containerized and packaged using a test-and-burn solution The running state of the Docker image is a Docker container. In the test platform, multiple Docker containers are used for serial execution. After the execution is completed, all Docker containers and the source code uploaded by the user are destroyed, leaving only the test report.

4. According to claim 1, a software testing method based on fusion containerization and intelligent scheduling is characterized in that: The intelligent scheduling technical solution is specifically as follows: When a new test report parsing task is to be executed, the scheduling service will perform dynamic service routing according to the following steps to ensure that the scheduling service can access the qualified test report parsing executor: Service instance retrieval: The scheduling service first obtains a list of all available test report parsing executors; Metadata evaluation: Filter out the test report parsing executor with the largest remaining memory space; Threshold check: Calculate the sum of the remaining memory space and the size of the report file to be parsed to ensure that it does not exceed the preset heap memory usage threshold; If the conditions are met, the test report parsing executor is selected; Otherwise, the current scheduling attempt is abandoned and the next round of query is awaited; Polling mechanism: The scheduling task in the scheduling service is polled in a period of s seconds to continuously search for test report parsing executors that meet the conditions.

5. According to claim 1, a software testing method based on fusion containerization and intelligent scheduling is characterized in that: The elastic scaling technology is specifically: Obtain and calculate the remaining memory of the test report parsing service in real time. The smallest logical unit in the test report parsing service is the test report parsing executor. Obtain the status data of all test report parsing executors, use the status data to create a resource pool and monitor the log information of the test report parsing executors. Start the polling timer task, check the status of the test report parsing executor in a period of t minutes, calibrate and obtain the status data of the test report parsing executor in the resource pool; If the scheduling service issues a command to reduce the number of test report parsing executors, the scaling-down mechanism is triggered. First, the idle test report parsing executors are screened to determine whether the number of idle test report parsing executors reaches the set lower limit of the number of test report parsing executors. If the lower limit is not reached, the number of test report parsing executors is reduced by 1. Otherwise, the current command is ignored. If the scheduling service issues a command to add a test report parsing executor, the expansion mechanism is triggered to determine whether the number of active test report parsing executors has reached the upper limit of the number of test report parsing executors. If the upper limit is not reached, the number of test report parsing executors is increased by 1. Otherwise, the task enters the queue and waits for execution.

6. A software testing system based on fusion containerization and intelligent scheduling, characterized in that: Includes initial module, packaging module, test module and maintenance module; The initial module determines the test requirements and prepares the test environment; The packaging module performs lightweight container packaging on the software of the testing tool; The test module performs the test, generates a test report after the test is completed, and uses the intelligent scheduling technology solution to select an idle test report parsing executor for report parsing; if the test report parsing executor resources are insufficient, the elastic scaling technology is used to expand the test report parsing executor resources for report parsing; if the resources are large and idle for a long time, the elastic scaling technology shrinks the test report parsing executor resources; the test report parsing executor is used to receive and execute tasks; The maintenance module updates the maintenance software according to the test report.

7. The software testing system based on fusion containerization and intelligent scheduling according to claim 6 is characterized in that: The lightweight containerization packaging encapsulates the test tool into a Docker image, including the following steps: Prepare the installation packages required for packaging test tools and set up basic images; compile the automated script Dockerfile for image production; use Docker software to run the automated script Dockerfile to automatically generate Docker images for test tools; compile automated script Dockerfile for different test tools, and automatically generate Docker images for test tools; upload the Docker images of all test tools to the image repository; when starting software testing, configure the YAML file as required, execute the Docker images of the test tools in sequence according to the order set in the YAML file, and generate a test report after the test is completed.

8. The software testing system based on fusion containerization and intelligent scheduling according to claim 6 is characterized in that: The software is lightweight containerized and packaged using a test-and-burn solution The running state of the Docker image is the Docker container. In the Kubernetes platform, multiple Docker containers are used for serial execution. After the execution is completed, all Docker containers and the source code uploaded by the user are destroyed, leaving only the test report.

9. The software testing system based on fusion containerization and intelligent scheduling according to claim 6 is characterized in that: The intelligent scheduling technical solution is specifically as follows: When a new test report parsing task is to be executed, the scheduling service will perform dynamic service routing according to the following steps to ensure that the scheduling service can access the qualified test report parsing executor: Service instance retrieval: The scheduling service first obtains a list of all available test report parsing executors; Metadata evaluation: Filter out the test report parsing executor with the largest remaining memory space; Threshold check: Calculate the sum of the remaining memory space and the size of the report file to be parsed to ensure that it does not exceed the preset heap memory usage threshold; If the conditions are met, the test report parsing executor is selected; Otherwise, the current scheduling attempt is abandoned and the next round of query is awaited; Polling mechanism: The scheduling task in the scheduling service is polled in a period of s seconds to continuously search for test report parsing executors that meet the conditions.

10. A software testing method based on fusion containerization and intelligent scheduling according to claim 6, characterized in that: The elastic scaling technology is specifically: Obtain and calculate the remaining memory of the test report parsing service in real time. The smallest logical unit in the test report parsing service is the test report parsing executor. Obtain the status data of all test report parsing executors, use the status data to create a resource pool and monitor the log information of the test report parsing executors. Start the polling timer task, check the status of the test report parsing executor in a period of t minutes, calibrate and obtain the status data of the test report parsing executor in the resource pool; If the scheduling service issues a command to reduce the number of test report parsing executors, the scaling-down mechanism is triggered. First, the idle test report parsing executors are screened to determine whether the number of idle test report parsing executors reaches the set lower limit of the number of test report parsing executors. If the lower limit is not reached, the number of test report parsing executors is reduced by 1. Otherwise, the current command is ignored. If the scheduling service issues a command to add a test report parsing executor, the expansion mechanism is triggered to determine the active Check whether the number of test report parsing executors has reached the upper limit. If the upper limit has not been reached, The test report parses the number of executors + 1. Otherwise, the task enters the queue and waits for execution.