Software testing automation platform and intelligent optimization method thereof

By introducing technical means such as natural language processing, task scheduling algorithms and data prediction models into the software testing automation platform, problems such as test case management, script generation and execution scheduling in the existing technology have been solved, and efficient and stable software has been achieved Test automation.

CN119415393AActive Publication Date: 2025-02-11ZHIHAIBOXIN (BEIJING) TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411527017.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-11
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

Existing software testing automation tools have many problems in test case management, script generation, execution scheduling and result analysis, resulting in inefficiency in testing and unstable results.

Method used

Provides a software testing automation platform, including test case management module, test script generation module, test execution module, test result analysis module and intelligent optimization module. Automatically analyze test cases through natural language processing technology, generate executable automated test scripts, use task scheduling algorithm to run test tasks in parallel, build a data prediction model to identify abnormal use cases, and dynamically adjust the priority of test cases.

Benefits of technology

It significantly improves the efficiency of test case management, automated script generation, test execution scheduling, result analysis and optimization, ensures the accuracy and reliability of test results, and improves the testing efficiency of key functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415393A_ABST
    Figure CN119415393A_ABST
Patent Text Reader

Abstract

The invention discloses a software testing automation platform and an intelligent optimization method thereof, and particularly relates to the technical field of software testing. The test case management module simplifies definition and automatic classification of test cases through a visual interface and a natural language processing technology; secondly, a test script generation module automatically generates and optimizes a test script by utilizing a preset template library and a self-defined script function in combination with an intelligent optimization tool; the test execution module executes test tasks in parallel in a multi-server or virtual machine environment through a task scheduling algorithm, and extracts environment load and response time characteristics in real time; then, the test result analysis module comprehensively analyzes an execution result by using the data prediction model, and identifies and marks an abnormal test case; and finally, the intelligent optimization module deletes the abnormal cases and dynamically adjusts the priorities of the normal cases to ensure that the high-priority test cases are executed preferentially, so that the automation level of test management is effectively improved, and the test execution efficiency and the result accuracy are optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to a software testing automation platform and an intelligent optimization method thereof. Background Art

[0002] As software scale and complexity continue to increase, automated testing has become crucial in the software development process. Traditional manual testing methods are not only inefficient, but also easily affected by human factors, resulting in unstable test results. Although existing automated testing tools can improve test efficiency to a certain extent, there are still many problems in test case management, script generation, execution scheduling, and result analysis. For example, the definition and management of test cases usually need to be done manually, which is time-consuming and labor-intensive, and difficult to adapt to the needs of rapid iteration development. In addition, the generated test scripts often contain redundant steps and lack automatic optimization, resulting in reduced test execution efficiency. The current test execution module lacks intelligent scheduling means, making it difficult to dynamically allocate test tasks according to the load of system resources, and unable to achieve efficient parallel execution. On the other hand, existing analysis tools have limited capabilities in identifying and processing abnormal test cases, and cannot effectively delete abnormal cases or adjust the priority of normal cases, resulting in resource waste and reduced reliability of test results. Summary of the invention

[0003] The purpose of the present invention is to provide a software testing automation platform and an intelligent optimization method thereof to solve the deficiencies in the background technology.

[0004] In order to achieve the above object, the present invention provides the following technical solution: a software testing automation platform, including a test case management module, a test script generation module, a test execution module, a test result analysis module and an intelligent optimization module:

[0005] The test case management module is used to provide a visual interface integrated with the script editor, allowing users to define test cases while supporting switching to code editing mode for advanced customization. It also uses natural language processing technology to automatically analyze the content of test cases and assign labels and categories to test cases.

[0006] A test script generation module is used to automatically generate executable automated test scripts based on test cases. The automated test scripts include a preset script template library and support user-defined script templates. The generated scripts are analyzed by intelligent optimization tools to automatically remove redundant steps and simplify the script structure.

[0007] The test execution module distributes the test tasks to various servers or virtual machines for parallel execution through the task scheduling algorithm, collects the test execution results in real time, and extracts the environmental load characteristics and execution response time characteristics of the test tasks during the test process;

[0008] The test result analysis module is used to build a data prediction model, input the environmental load characteristics and execution response time characteristics into the model for comprehensive calculation, and determine the abnormal test cases in the test execution process according to the calculation results;

[0009] The intelligent optimization module is used to delete abnormal test cases during the test execution process and generate detailed test reports. For normal test cases, the priority of normal test cases is dynamically adjusted to give priority to high-priority normal test cases.

[0010] Preferably, in the test case management module, the content of the test case is automatically analyzed by natural language processing technology, and labels and categories are assigned to the test case, specifically:

[0011] Automatically parse the descriptive text entered by the user when writing a test case and extract test-related information, including the operation object, test type, and test goal;

[0012] Automatically assigning labels to test cases based on information extracted by the natural language processing module, wherein the labels are based on functional modules, test types, risk levels, and operating platform dimensions;

[0013] Based on the analysis results of the natural language processing module, the test cases are automatically classified into different classification levels, including functional module classification, risk priority classification, platform or environment classification, which respectively correspond to the software functions, impact scope and operating platform or test environment involved in the test cases.

[0014] Preferably, in the test execution module, when the loads of all existing nodes are close to the upper limit, the environmental load characteristics of the test task during the test are analyzed, and the deviation between the load of each node and the upper limit is analyzed to generate a comprehensive load deviation index. The method for obtaining the comprehensive load deviation index is:

[0015] For each server or virtual machine node i, first obtain the current load parameters of the node including: CPU utilization Ci, memory utilization Mi, disk I / O utilization Di, network bandwidth utilization Bi, obtain the load upper limit parameters of each node, each type of resource of each node i has a corresponding load upper limit, calculate the single load deviation of each node, for each node i, calculate the deviation value of each load of the node, that is, the difference between the actual load and the upper limit, use PCi, PMi, PDi, PBi to represent the difference between the current load and the upper limit of the CPU, memory, disk I / O, and network bandwidth of node i, respectively, assign different weights to different resources, and calculate the weighted average sum of each node's CPU utilization Ci, memory utilization Mi, disk I / O utilization Di, and network bandwidth utilization Bi to obtain the comprehensive load deviation index.

[0016] Preferably, in the test execution module, the response time drift index is generated after analyzing the execution response time characteristics of each test script executing the test step, and the method for obtaining the response time drift index is:

[0017] Set T0 as the target response time reference value and drift threshold κ, and the cumulative sum C t The initial value of is set to 0, that is, C0 = 0, and the response time deviation at each time point is calculated. For each time point t, the response time T t , calculate T t The deviation from the target response time T0 is denoted as ΔT t , update the cumulative sum value C according to the response time deviation of each test step execution t , the expression is: C t =max(0,C t-1 +(T t -T0-κ)); For the forward accumulation, the response time drift index calculation expression is: For negative accumulation, the response time drift index calculation expression is: KM is the response time drift index.

[0018] Preferably, in the test result analysis module, a data prediction model is constructed, and the environmental load characteristics and the execution response time characteristics are input into the model for comprehensive calculation, and the abnormal test cases in the test execution process are determined according to the calculation results, specifically:

[0019] The comprehensive load deviation index and the response time drift index are converted into the first eigenvector, and the first eigenvector is used as the input of the machine learning model. The machine learning model predicts the abnormality degree value label of the test case of the test execution process with each group of first eigenvectors as the prediction target, and minimizes the sum of the prediction errors of the abnormality degree value labels of all test cases in the test execution process as the training target. The machine learning model is trained until the sum of the prediction errors converges and the model training is stopped. The abnormality degree value of the test case in the test execution process is determined according to the model output results, wherein the machine learning model is a polynomial regression model.

[0020] Preferably, the acquired abnormality degree value of the test case in the test execution process is compared with a preset abnormality degree reference threshold. If the abnormality degree value of the test case in the test execution process is greater than or equal to the preset abnormality degree reference threshold, it means that the abnormality degree of the test case in the test execution process is high. In this case, an early warning signal is generated and the test case is marked. If the abnormality degree value of the test case in the test execution process is less than the preset abnormality degree reference threshold, it means that the abnormality degree of the test case in the test execution process is low. In this case, no early warning signal is generated and the test case is not marked.

[0021] The present invention also provides a software testing intelligent optimization method, comprising:

[0022] S1: Provides integration of a visual interface and a script editor, allowing users to define test cases while supporting switching to code editing mode for advanced customization. It also automatically analyzes the content of test cases through natural language processing technology, assigning labels and categories to test cases.

[0023] S2: Automatically generate executable automated test scripts based on test cases. The automated test scripts include a preset script template library and support user-defined script templates. The generated scripts are analyzed by intelligent optimization tools to automatically remove redundant steps and simplify the script structure.

[0024] S3: The test tasks are assigned to various servers or virtual machines through the task scheduling algorithm to run in parallel, and the test execution results are collected in real time. The environmental load characteristics and execution response time characteristics of the test tasks during the test process are extracted;

[0025] S4: Build a data prediction model, input the environmental load characteristics and execution response time characteristics into the model for comprehensive calculation, and determine the abnormal test cases in the test execution process according to the calculation results;

[0026] S5: Delete abnormal test cases during the test execution process and generate a detailed test report. For normal test cases, dynamically adjust the priority of normal test cases and give priority to executing high-priority normal test cases.

[0027] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0028] 1. The present invention significantly improves the efficiency of test case management, automated script generation, test execution scheduling, result analysis and optimization by constructing an intelligent software testing automation platform. Through natural language processing technology, the system can automatically parse the test case text input by the user, extract information such as test objects, types and targets, and automatically assign labels and classification levels to test cases, simplifying the test case management work. Based on the automatically generated test scripts, the platform removes redundant steps through intelligent optimization tools, thereby improving the script execution efficiency. At the same time, the test execution module adopts a task scheduling algorithm to run test tasks in parallel under a multi-server or virtual machine environment, monitor the system load and response time characteristics in real time, and ensure the efficient execution of test tasks.

[0029] 2. The present invention uses a machine learning model to comprehensively analyze the environmental load and execution response time characteristics, accurately identify abnormal test cases, and delete abnormal test cases to ensure the accuracy of the test results. For normal test cases, the system prioritizes high-priority test cases based on dynamically adjusted priorities, thereby improving the test efficiency of key functions. The comprehensive load deviation index and response time drift index are converted into feature vectors and input into the machine learning model to automatically predict the degree of abnormality of the test case, generate early warning signals and mark high-risk test cases, thereby effectively avoiding resource waste and improving the reliability of the test. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0031] Figure 1 The figure is a flow chart of the method of the present invention.

[0032] Figure 2 It is a system module diagram of the present invention. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0034] Example 1, please refer to Figure 1 and Figure 2 As shown, a software testing automation platform described in this embodiment includes a test case management module, a test script generation module, a test execution module, a test result analysis module and an intelligent optimization module:

[0035] The test case management module is used to provide a visual interface integrated with the script editor, allowing users to define test cases while supporting switching to code editing mode for advanced customization. It also uses natural language processing technology to automatically analyze the content of test cases and assign labels and categories to test cases.

[0036] A test script generation module is used to automatically generate executable automated test scripts based on test cases. The automated test scripts include a preset script template library and support user-defined script templates. The generated scripts are analyzed by intelligent optimization tools to automatically remove redundant steps and simplify the script structure.

[0037] The test execution module distributes the test tasks to various servers or virtual machines for parallel execution through the task scheduling algorithm, collects the test execution results in real time, and extracts the environmental load characteristics and execution response time characteristics of the test tasks during the test process;

[0038] The test result analysis module is used to build a data prediction model, input the environmental load characteristics and execution response time characteristics into the model for comprehensive calculation, and determine the abnormal test cases in the test execution process according to the calculation results;

[0039] The intelligent optimization module is used to delete abnormal test cases during the test execution process and generate detailed test reports. For normal test cases, the priority of normal test cases is dynamically adjusted to give priority to high-priority normal test cases.

[0040] One of the core functions of the test case management module is to provide seamless integration of the visual interface and the script editor, so that users with different technical levels can efficiently create, edit and manage test cases. The specific implementation is as follows:

[0041] Visual interface: Users can create and define test cases through an intuitive graphical user interface (GUI). The system provides a set of predefined components or templates, which users can quickly build complex test cases by dragging and dropping these components together. For example, users can directly drag and drop "input field", "click button", "verify result" and other operation steps in the interface to design the test process. This interface is particularly suitable for testers who do not have programming skills, and they can define the test logic without writing code.

[0042] Script Editor: For advanced users or test engineers with programming skills, the system also provides a script editor that allows users to manually write or modify the underlying implementation of test cases. The script editor supports multiple programming languages ​​(such as Python, Java, JavaScript, etc.) and test frameworks (such as Selenium, Appium, JUnit, etc.), and provides code highlighting, intelligent code prompts, automatic completion and other functions to help users quickly write efficient and robust test scripts.

[0043] Synchronous operation: The visual interface and the script editor are bidirectionally synchronized, which means that any operation performed by the user on the visual interface will be reflected in the script editor in real time to generate the corresponding code, and vice versa. For example, when the user drags a "click button" operation in the visual interface, the script editor will automatically generate the code for the operation; if the user manually adds new logic in the script editor, the visual interface will update the corresponding operation steps. This integration greatly reduces the technical threshold for test case creation, while providing flexibility for users who need higher customization.

[0044] Another innovative feature of the test case management module is based on natural language processing (NLP) technology, which can automatically analyze the content of test cases written by users and assign appropriate labels and categories to them. This function greatly simplifies the management and organization of test cases and improves the scalability of the system in large-scale testing scenarios. The specific implementation method is as follows:

[0045] The system uses natural language processing algorithms to automatically parse the descriptive text entered by users when writing test cases. Test cases usually contain detailed information about test steps, expected results, test objectives, etc. NLP algorithms can extract key information from them, such as operation objects (such as "buttons"), test types (such as "functional tests"), test objectives (such as "verify user login function"), etc.

[0046] Based on the parsed key information, the system automatically assigns appropriate tags to test cases. Tags can be based on dimensions such as functional modules, test types, risk levels, and operating platforms. For example, the system may assign tags such as "login", "functional test", and "high priority" to a test case for a login function. This automated tag assignment mechanism reduces the workload of manual classification by users and ensures that test cases can be quickly retrieved and managed.

[0047] In addition to labels, the system will automatically classify test cases into appropriate classification levels based on NLP analysis results. Common classification dimensions include:

[0048] Functional module classification: automatically classify according to the software functions involved in the test cases, such as "user management", "order processing", "payment system", etc.;

[0049] Risk priority classification: Assign priorities based on the impact and complexity of the test case, such as "high priority", "medium priority", "low priority";

[0050] Platform or environment classification: Classify according to the operating platform or test environment involved in the test case (such as "mobile test", "web test" or "API test").

[0051] Dynamically adjust classification: As the system is used, test cases will be continuously updated and added. The system will dynamically adjust classification rules through continuous NLP analysis and machine learning to ensure that newly added test cases can be automatically classified according to the latest project requirements and risk conditions. For example, when a module of the software is updated, the system can identify related test cases and classify them into new functional modules or adjust their priorities.

[0052] The core function of the test script generation module is to automatically generate executable automated test scripts based on user-defined test cases. The specific implementation is as follows:

[0053] Automation script generation engine: By parsing the test cases created by users, it converts them into corresponding automated test scripts. The operation steps defined in the test cases (such as clicking buttons, inputting data, verifying results, etc.) will be translated into code instructions that can be recognized by the automation tool. For different test frameworks (such as Selenium, Appium, JUnit, etc.), the system will generate the corresponding script format.

[0054] Multi-language and multi-framework support: Supports multiple programming languages ​​and test frameworks. For example, for Web application testing, you can choose to use Java or Python combined with the Selenium framework to generate scripts; for mobile application testing, you can use Appium to generate automation scripts based on JavaScript or Java. Users can choose different testing tools and programming languages ​​according to project requirements, and the system will automatically adapt and generate corresponding test scripts.

[0055] In order to improve the efficiency of generating automated test scripts, the test script generation module provides a preset script template library from which users can select a template that suits their test needs. The specific implementation is as follows:

[0056] Structure and function of the template library: The script template library contains predefined script templates for different test scenarios, such as: Functional test template: used to simulate user operations, such as logging in, filling out forms, submitting orders, etc.; Performance test template: used to evaluate the performance of the system under high load, such as multi-threaded requests, concurrent user simulation; Security test template: used to detect security vulnerabilities in applications, such as SQL injection, cross-site scripting attacks (XSS), etc.

[0057] When analyzing test cases, the system automatically recommends corresponding templates based on the test scenario. For example, when a user defines a test case for a login function, the system automatically selects the "User Login Function Test" template and generates the corresponding test script based on the data entered by the user. This template design not only speeds up script generation, but also ensures the consistency and standardization of scripts.

[0058] In addition to using the preset template library, the system also allows users to customize templates according to project requirements. Users can write custom script templates through the template editor and save them to the template library. In the future, when similar test cases appear, the system can automatically call the user-defined template to generate the corresponding test script. This feature is particularly suitable for projects with unique business logic, which can significantly improve the flexibility and reusability of testing.

[0059] After the generated automated test script is initially generated, it will be further analyzed and optimized by the built-in intelligent optimization tool. The specific technical implementation of the tool is as follows:

[0060] Code analysis tool: The system's built-in code analysis tool will perform static analysis on the generated test scripts to detect redundant steps, unnecessary code blocks, and possible performance bottlenecks in the scripts. The analysis tool can analyze the structure, execution path, and code complexity of the scripts to ensure that the generated scripts have high execution efficiency and are easy to maintain.

[0061] Remove redundant steps: During the test script generation process, some repeated test operations may appear multiple times. Through code analysis tools, the system can automatically identify these redundant steps and merge them. For example, the system will merge page refresh or navigation operations that are repeated in multiple test steps into a single operation, thereby reducing unnecessary repeated steps and simplifying the code structure. This optimization can reduce script execution time and reduce maintenance costs.

[0062] Script simplification and optimization: In addition to removing redundant steps, the system will automatically optimize the script according to best practices. For example: Conditional branch optimization: If there are too many conditional branches (such as if-else statements) in the test script, the system will detect and optimize these branch structures, reduce complex branch logic, and simplify the readability of the script; Loop optimization: When the test case needs to repeat certain operations (such as testing form submission with different data inputs), the system will convert these repeated operation steps into loop structures to reduce the amount of code and improve the reusability of the script. Cross-environment optimization: For scripts that need to be executed in multiple test environments (such as web browsers, mobile devices, and different operating systems), the system will perform environment adaptation analysis. The intelligent optimization tool will automatically adjust the generated script according to the characteristics of different environments. For example, for different browsers (such as Chrome, Firefox, and Safari), the script will use appropriate positioning methods or waiting mechanisms to ensure that the script can be executed correctly in all environments. Parallel processing optimization: For complex test scenarios (such as large-scale concurrent testing), the system will automatically parallelize some test steps in the script. By executing test steps that can be executed independently at the same time, the total execution time of the test is reduced. This is especially important for performance testing and large-scale regression testing.

[0063] The intelligent optimization tool provides a real-time feedback mechanism when optimizing scripts. Users can view script changes and optimization suggestions through the interface during script generation and optimization. The specific implementation of this mechanism is as follows:

[0064] Real-time optimization tips: When the intelligent optimization tool detects that there are parts in the script that can be optimized, it will prompt the user on the interface. The user can view detailed optimization suggestions and choose whether to apply these optimizations. For example, the system may prompt the user "This step is a repeated operation, it is recommended to merge", and provide sample code on how to merge.

[0065] Integrated debugging tools: Generated test scripts can be tested instantly with built-in debugging tools. Users can step through the steps in the script to check whether the script is executed as expected, and find and fix potential errors or incompatibilities. The debugging tool can work together with the intelligent optimization tool to ensure that the optimized script performs best in actual execution.

[0066] In this application, the test script generation module can not only quickly generate efficient automated test scripts based on test cases, but also conduct in-depth analysis and automatic optimization of the scripts through intelligent optimization tools.

[0067] One of the core functions of the test execution module is to efficiently distribute test tasks to multiple servers or virtual machines for parallel execution through task scheduling algorithms to maximize resource utilization and reduce test execution time. The specific implementation is as follows:

[0068] Introduction of task scheduling algorithm: The main goal of the test task scheduling algorithm is to achieve optimal task allocation based on the currently available computing resources (including servers, virtual machines, cloud instances, etc.) and the characteristics of the test tasks (such as task size, complexity, execution priority, etc.). Common scheduling algorithms used in the system include:

[0069] Round Robin: Allocate test tasks to available servers or virtual machines in sequence to ensure balanced use of all resources and avoid overloading of some nodes.

[0070] Least Loaded: The system will prioritize servers or virtual machines with smaller loads to assign test tasks, ensuring that each execution node runs efficiently within its processing capacity.

[0071] Task priority scheduling: Based on the importance or priority of test tasks (such as high-risk test cases), these tasks are preferentially allocated to available computing resources, thereby optimizing resource usage strategies.

[0072] Parallel processing: After the test tasks are dispatched to different servers or virtual machines, the system can run multiple test cases or test scripts in parallel. Parallel processing not only significantly reduces the test execution time, but also can cope with large-scale regression testing or stress testing needs. The system splits the test tasks into multiple independently executable subtasks through task splitting technology. These subtasks are assigned to different computing nodes to run in parallel, thereby improving execution efficiency.

[0073] Resource-aware scheduling: The scheduling algorithm of this module can dynamically perceive the utilization of system resources, such as CPU, memory, network bandwidth, etc. During the test task allocation process, the system will continuously monitor the resource usage of each server or virtual machine, and dynamically adjust the task allocation based on this information. For example, when the CPU usage of a node is close to the upper limit, the system will automatically allocate new test tasks to nodes with lower loads to prevent resource overload.

[0074] The test execution module is not only responsible for allocating and executing test tasks, but also collects various test execution data in real time during the entire test execution process to ensure the integrity and traceability of the test results. Its implementation methods include:

[0075] Real-time monitoring and feedback of test results: The system monitors all test tasks running in parallel in real time, collects and records the execution status, success and failure, error logs, and intermediate results of each test step. Real-time monitoring not only allows testers to grasp the progress of test execution in a timely manner, but also triggers alarms or notifications in real time when errors occur in test tasks, facilitating rapid location and repair of problems.

[0076] Centralized data storage and analysis: The test result data generated by all test nodes will be stored in a central database. The database can store detailed test logs, execution time, performance indicators (such as response time, throughput, etc.), and resource usage of servers or virtual machines (such as CPU, memory, disk usage). Through subsequent analysis of these data, testers can gain in-depth understanding of test execution and optimize system performance.

[0077] When the system detects that the load of all existing nodes is close to the upper limit, the system automatically triggers the dynamic resource expansion mechanism. In virtualized and cloud environments, the system can dynamically create new virtual machines or containers to carry newly assigned test tasks, ensuring that test tasks can be completed within a reasonable time without being delayed due to resource bottlenecks.

[0078] When the loads of all existing nodes are close to the upper limit, the environmental load characteristics of the test task during the test are analyzed, and the deviation between the load of each node and the upper limit is analyzed to generate a comprehensive load deviation index. The method for obtaining the comprehensive load deviation index is:

[0079] For each server or virtual machine node i, first obtain the current load parameters of the node, including: CPU usage Ci (percentage, ranging from 0-100), memory usage Mi (percentage, ranging from 0-100), disk I / O usage Di (percentage, ranging from 0-100), network bandwidth usage Bi (percentage, ranging from 0-100). These load parameters reflect the actual usage of the current node resources. Obtain the load upper limit parameters of each node. Each type of resource of each node i has a corresponding load upper limit. Generally speaking, the load upper limit of a node can be regarded as 100% or a preset value Li of the node (such as the safe load upper limit of the CPU or memory). Set the upper limit of each type of load to 100%, that is, the upper limit of CPU usage LC = 100, the upper limit of memory usage LM = 100, the upper limit of disk I / O usage LD = 100, and the upper limit of network bandwidth usage LB = 100; calculate the single load deviation of each node. For each node i, calculate the deviation value of each node load (CPU, memory, disk I / O, network bandwidth), that is, the difference between the actual load and the upper limit. Use PCi, PMi, PDi, and PBi to represent the difference between the current load and the upper limit of the CPU, memory, disk I / O, and network bandwidth of node i. Assign different weights to different resources to reflect their importance in the overall load. The weights are: CPU weight WC, memory weight WM, disk I / O weight WD, and network bandwidth weight WB; the selection of these weights is usually based on actual needs and system bottlenecks. For example, in computing-intensive tasks, the CPU load may occupy a larger weight; in data-intensive tasks, disk I / O and memory loads may be more important. Set WC+WM+WD+WB=1, that is, the sum of all weights is 1, and calculate the weighted average sum of each node's CPU utilization Ci, memory utilization Mi, disk I / O utilization Di, and network bandwidth utilization Bi to obtain the comprehensive load deviation index.

[0080] When the comprehensive load deviation index is large, it indicates that the resource load of the test node is close to its upper limit. As resources (such as CPU, memory, disk I / O, etc.) tend to be saturated, the system is more likely to have anomalies when executing test cases. Common anomalies include significantly extended test case execution time, slow system response or timeout, and may even cause test task failure or system crash. In this case, the test results may be unstable or inaccurate, with a large degree of anomalies, and the test efficiency and reliability will be greatly reduced.

[0081] On the contrary, when the comprehensive load deviation index is small, it means that the resource load of the test node is light and the system can handle the test task smoothly. In this case, the test cases can usually be completed on time and stably, the system responds promptly, and the test results are accurate and reliable. The probability of abnormal situations is low, and there are fewer delays and timeouts during execution, which greatly improves the success rate and efficiency of the test tasks. Therefore, when the load deviation index is small, the degree of abnormality in the test execution is slight or basically no abnormality.

[0082] After analyzing the execution response time characteristics of each test script execution test step, a response time drift index is generated. The method for obtaining the response time drift index is:

[0083] Set T0 as the target response time reference value, usually the average response time of the system under ideal conditions. For example, if the average response time of the system under normal conditions is 200ms, then T0 = 200ms. κ is the drift threshold, which is used to control the sensitivity to response time changes. Typically, κ can be set to a small fraction of the target response time (such as 0.5% or 1% of T0).

[0084] Cumulative Sum C t The initial value of is set to 0, that is, C0 = 0, and the response time deviation at each time point is calculated. For each time point t, the response time T t , calculate T t The deviation from the target response time T0 is denoted as ΔT t , update the cumulative sum value C according to the response time deviation of each test step execution t , the expression is: C t =max(0,C t-1 +(T t -T0-κ)); For the forward accumulation, the response time drift index calculation expression is: For negative accumulation, the response time drift index calculation expression is: KM is the response time drift index, when the cumulative sum C t = 0, indicating that the current response time is basically consistent with the target value T0, and no significant drift occurs. t >0, and the cumulative sum continues to increase, indicating that the system response time is gradually deviating from the target value T0, showing a drift phenomenon. The larger the cumulative sum, the more obvious the drift.

[0085] When the response time drift index is large, it means that the response time of the test case continues to deviate from the normal value during the test execution, indicating that the system performance is significantly abnormal. The larger the drift index, the greater the deviation of the response time, which may be caused by resource bottlenecks, excessive system load or software defects. The execution process of the test case may experience significant delays, timeouts or even failures, which indicates that the system is in a state of performance degradation or instability, the degree of abnormality is relatively serious, and urgent optimization or repair may be required.

[0086] When the response time drift index is small, it means that the response time of the test case is basically stable during the test execution, with small fluctuations, and the test case execution is relatively smooth. A small drift index means that the system performance is close to the normal level, the response time changes little, the system runs stably, and there is no obvious performance degradation. At this time, test case abnormalities rarely occur, the system can run efficiently under normal load, the test results are stable and reliable, and the degree of abnormality is mild or basically no abnormality.

[0087] The test result analysis module is used to build a data prediction model, input the environmental load characteristics and execution response time characteristics into the model for comprehensive calculation, and determine the abnormal test cases in the test execution process based on the calculation results.

[0088] The comprehensive load deviation index and the response time drift index are converted into the first eigenvector, and the first eigenvector is used as the input of the machine learning model. The machine learning model predicts the abnormality degree value label of the test case of the test execution process with each group of first eigenvectors as the prediction target, and minimizes the sum of the prediction errors of the abnormality degree value labels of all test cases in the test execution process as the training target. The machine learning model is trained until the sum of the prediction errors converges and the model training is stopped. The abnormality degree value of the test case in the test execution process is determined according to the model output results, wherein the machine learning model is a polynomial regression model.

[0089] The method for obtaining the abnormality degree value of the test case in the test execution process is: from the first eigenvector training data of the trained machine learning model, obtain the corresponding function expression: CK=F(SQ, KM); wherein F is the output function of the model, SQ is the comprehensive load deviation index, KM is the response time drift index, and CK is the abnormality degree value of the test case in the test execution process.

[0090] The acquired abnormality degree value of the test case in the test execution process is compared with the preset abnormality degree reference threshold. If the abnormality degree value of the test case in the test execution process is greater than or equal to the preset abnormality degree reference threshold, it means that the abnormality degree of the test case in the test execution process is high. At this time, an early warning signal is generated and it is marked; if the abnormality degree value of the test case in the test execution process is less than the preset abnormality degree reference threshold, it means that the abnormality degree of the test case in the test execution process is low. At this time, no early warning signal is generated and it is not marked.

[0091] The intelligent optimization module is used to delete abnormal test cases during the test execution process and generate detailed test reports. For normal test cases, the priority of normal test cases is dynamically adjusted to give priority to high-priority normal test cases.

[0092] Once abnormal test cases are identified, they need to be deleted or isolated to ensure the reliability of the test results. The specific steps for deleting abnormal cases are as follows:

[0093] Test cases marked as abnormal: Test cases that have been marked as abnormal are recorded and excluded from subsequent test reports to ensure that the test data included in the final report is accurate and valid.

[0094] Delete from the test set: In the next round of test execution, the system will delete these abnormal cases from the test plan to avoid affecting the execution results of the entire test set due to their existence. This operation can not only improve the operating efficiency of the system, but also ensure the accuracy of the test results.

[0095] Retain abnormal data for subsequent analysis: Although the abnormal case is deleted from the main test set, the system will still retain its related data for subsequent analysis and debugging. The retained data includes execution logs, system load conditions, response time records, etc., to help the development and operation teams locate the root cause of the problem.

[0096] Generate a detailed test report: After the system completes the test execution, it needs to generate a detailed test report that summarizes the test execution status, abnormal use cases, and system performance indicators. The generated test report should contain the following key parts:

[0097] Total Test Cases: Lists the total number of all test cases executed, including both successful and failed cases.

[0098] Success and failure statistics: List the number of successfully executed test cases and the number of failed or abnormal test cases. For example: successful test cases: X, abnormal test cases: Y; calculate the pass rate of test execution, the formula is: pass rate = number of successful test cases / total number of test cases;

[0099] Abnormal test case identification: Lists detailed information of all test cases marked as abnormal, including the name, identifier, execution time, etc. of the test case.

[0100] Based on the analysis of abnormal cases, the system can provide suggestions for improvement. For example, for system bottlenecks, it is recommended to adjust server resource configuration, optimize code performance, or add load balancing mechanisms. Based on the current test results, the system can recommend which test cases need to be redesigned or repaired, or suggest which modules should be focused on in the next test plan.

[0101] First, the system needs to assign a priority to each normal test case. Priorities can be dynamically calculated and adjusted based on different dimensions. Common priority dimensions include:

[0102] Business Importance: Assign priorities based on the importance of the business modules involved in the test cases. For example, core functions (such as user login, payment processing) may need to be set with a higher priority.

[0103] Risk level of test cases: Assign higher priority to high-risk modules in the software, especially those functional modules that have been prone to defects historically.

[0104] Scope of code change impact: If the test cases involve code modules or new features that have been updated frequently recently, then the priority should be higher to ensure that these new changes are fully tested.

[0105] Historical failure rate: Based on the historical execution records of test cases, if some test cases have a high failure rate in history, you may need to set a higher priority to detect potential problems as early as possible.

[0106] Priority grading: The system can divide the priority of test cases into multiple levels (such as 1-5, 1 is the highest priority and 5 is the lowest) to facilitate the implementation of scheduling strategies.

[0107] The priority of test cases is not fixed, but dynamically adjusted. The system can update the priority according to the current environment and business needs before each execution. The specific mechanism of dynamic adjustment includes:

[0108] Dynamic adjustment of code updates: After each code update, the system analyzes the changes and updates the priority of the affected test cases. The priority of functions involving new code or modifications is automatically increased.

[0109] Real-time monitoring and dynamic load adjustment: According to the current load of the system, the system can adjust the priority of some test cases with low resource consumption so that they can be executed in time even under high load.

[0110] Adjustment based on historical data: Dynamically update the priority of test cases based on the success rate, failure rate, and frequency of exceptions in historical test results. The priority of test cases that have been unstable or have had problems in the past should be increased.

[0111] Real-time adjustment based on business needs: When business needs change, the development team can manually or through the system to configure the priority of certain use cases. For example, before releasing a key function, the test cases involving the function will be executed first.

[0112] Once the test case priority is determined, the system will stratify all normal test cases according to the priority and then schedule them. The specific steps are as follows:

[0113] Step 1: Building a priority queue includes:

[0114] High priority queue: The system first sorts all normal test cases by priority and builds a priority queue. For example, test cases can be divided into priorities 1-5, with test cases with priority 1 at the front of the queue and test cases with priority 5 at the end.

[0115] Priority tiering: Test cases are tiered. For example, all test cases with a priority of 1 will be placed in a high priority layer, and test cases in the high priority layer will be scheduled for execution first.

[0116] Step 2: Scheduling and allocation of test tasks includes:

[0117] In a distributed or multi-node environment, the system can reasonably allocate resources to the test cases according to their priorities. The scheduling strategy is as follows:

[0118] Prioritize resource allocation for high-priority test cases: When executing tests, the system first checks the highest priority test cases to ensure that they are executed immediately if resources (such as virtual machines, test nodes, CPU, memory, etc.) allow. For example, if there are multiple test cases waiting to be executed, the scheduler will prioritize resource allocation to test cases with priority 1.

[0119] Parallel execution: For test cases of the same priority, the system can use parallel execution to speed up the test. For example, multiple test cases with priority 1 can be assigned to multiple test nodes or virtual machines at the same time to ensure that they are executed in the shortest time.

[0120] Scheduling of low-priority test cases: When high-priority test cases are completed, the system will start scheduling lower-priority test cases. If system resources allow, low-priority test cases can also be executed in parallel, but their execution will be interrupted or delayed by high-priority test cases.

[0121] Step 3: Dynamic resource expansion includes:

[0122] In high-load scenarios, the system can dynamically scale resources as needed to ensure that high-priority test cases can be executed in a timely manner. Dynamic scaling strategies include:

[0123] Automatically create new test nodes: The system can automatically start new virtual machines or test nodes to share the execution tasks of high-priority test cases.

[0124] Load balancing strategy: Ensure that high-priority test cases are processed first under high load conditions. The system can prioritize nodes with less resources to execute high-priority test cases based on the current load of the test nodes.

[0125] During the priority scheduling process, the system continuously optimizes the test task allocation strategy through real-time monitoring feedback mechanism. The specific feedback mechanism includes:

[0126] Test result feedback: After each round of testing, the system will provide feedback on the results of all completed test cases. If some high-priority test cases fail to pass successfully or have an exception, the system will automatically increase the test priority of the relevant modules to ensure that the problem is verified and fixed first in subsequent tests.

[0127] Execution time feedback: The system dynamically adjusts the priority of subsequent test cases based on the execution time of each test case. If some test cases take too long to execute, it may mean that they have high resource requirements, and the system will reserve more resources for such cases.

[0128] Load adjustment feedback: If the system load is too high during execution, the scheduler can reduce the execution frequency of low-priority test cases based on the feedback, or temporarily suspend certain low-priority tasks to ensure smooth execution of high-priority tasks.

[0129] The following is a concrete example of how to dynamically adjust and prioritize high priority test cases:

[0130] Priority setting: Before the test is executed, the system divides 100 test cases into 5 priorities (1-5), among which the test cases with priority 1 involve core functions, such as user login, order payment, etc.

[0131] Task queue sorting: The system puts all test cases with priority 1 at the front of the queue, and test cases with priority 2 and below are sorted in order.

[0132] Execution of high-priority test cases: When the test execution starts, the system first assigns all test cases with a priority of 1 to the test nodes for execution, and starts parallel execution at the same time, so that these important test cases can be completed in the shortest time.

[0133] Low-priority test cases wait: After the high-priority test cases are executed, the system starts scheduling test cases with a priority of 2 until all test cases are executed.

[0134] Feedback and adjustment: During the testing process, if a high-priority use case is delayed due to insufficient resources, the system will automatically adjust the node resources or priority strategy to ensure that similar problems do not occur later.

[0135] In this application, high-priority normal test cases are executed first through intelligent scheduling, dynamic resource allocation and real-time feedback, ensuring that key test cases can be verified first when resources are tight, thereby improving the effectiveness and efficiency of the test. The dynamic adjustment strategy of priority makes the test more flexible and ensures that the system can still meet the testing requirements of core functions under high load.

[0136] In this embodiment, the test case management module provides a visual interface integrated with the script editor, allowing users to define and edit test cases, and automatically classifies and labels the test cases through natural language processing technology. The test script generation module automatically generates executable automated test scripts based on the test cases, supports preset template libraries and custom templates, and simplifies the code structure through intelligent optimization tools. The test execution module uses a task scheduling algorithm to assign test tasks to multiple servers or virtual machines for parallel operation, collects execution results in real time, and extracts environmental load and response time characteristics. The test result analysis module determines abnormal test cases by building a data prediction model, analyzing environmental load and response time. The intelligent optimization module is responsible for deleting abnormal test cases and generating detailed test reports, while dynamically adjusting the priority of normal test cases to ensure that high-priority test cases are executed first.

[0137] Embodiment 2, a software testing intelligent optimization method described in this embodiment comprises the following steps:

[0138] S1: Provides integration of a visual interface and a script editor, allowing users to define test cases while supporting switching to code editing mode for advanced customization. It also automatically analyzes the content of test cases through natural language processing technology, assigning labels and categories to test cases.

[0139] S2: Automatically generate executable automated test scripts based on test cases. The automated test scripts include a preset script template library and support user-defined script templates. The generated scripts are analyzed by intelligent optimization tools to automatically remove redundant steps and simplify the script structure.

[0140] S3: The test tasks are assigned to various servers or virtual machines through the task scheduling algorithm to run in parallel, and the test execution results are collected in real time. The environmental load characteristics and execution response time characteristics of the test tasks during the test process are extracted;

[0141] S4: Build a data prediction model, input the environmental load characteristics and execution response time characteristics into the model for comprehensive calculation, and determine the abnormal test cases in the test execution process according to the calculation results;

[0142] S5: Delete abnormal test cases during the test execution process and generate a detailed test report. For normal test cases, dynamically adjust the priority of normal test cases and give priority to executing high-priority normal test cases.

[0143] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0144] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0145] 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 herein 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.

[0146] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A software testing automation platform, characterized in that: It includes test case management module, test script generation module, test execution module, test result analysis module and intelligent optimization module: The test case management module is used to provide a visual interface integrated with the script editor, allowing users to define test cases while supporting switching to code editing mode for advanced customization. It also uses natural language processing technology to automatically analyze the content of test cases and assign labels and categories to test cases. A test script generation module is used to automatically generate executable automated test scripts based on test cases. The automated test scripts include a preset script template library and support user-defined script templates. The generated scripts are analyzed by intelligent optimization tools to automatically remove redundant steps and simplify the script structure. The test execution module distributes the test tasks to various servers or virtual machines for parallel execution through the task scheduling algorithm, collects the test execution results in real time, and extracts the environmental load characteristics and execution response time characteristics of the test tasks during the test process; The test result analysis module is used to build a data prediction model, input the environmental load characteristics and execution response time characteristics into the model for comprehensive calculation, and determine the abnormal test cases in the test execution process according to the calculation results; The intelligent optimization module is used to delete abnormal test cases during the test execution process and generate detailed test reports. For normal test cases, the priority of normal test cases is dynamically adjusted to give priority to high-priority normal test cases.

2. A software testing automation platform according to claim 1, characterized in that: In the test case management module, natural language processing technology is used to automatically analyze the content of test cases and assign labels and categories to test cases. Specifically: Automatically parse the descriptive text entered by the user when writing a test case and extract test-related information, including the operation object, test type, and test goal; Automatically assigning labels to test cases based on information extracted by the natural language processing module, wherein the labels are based on functional modules, test types, risk levels, and operating platform dimensions; Based on the analysis results of the natural language processing module, the test cases are automatically classified into different classification levels, including functional module classification, risk priority classification, platform or environment classification, which respectively correspond to the software functions, impact scope and operating platform or test environment involved in the test cases.

3. A software testing automation platform according to claim 1, characterized in that: In the test execution module, when the load of all existing nodes is close to the upper limit, the environmental load characteristics of the test task during the test are analyzed, and the deviation between the load of each node and the upper limit is analyzed to generate a comprehensive load deviation index. The method for obtaining the comprehensive load deviation index is: For each server or virtual machine node i, first obtain the current load parameters of the node including: CPU utilization Ci, memory utilization Mi, disk I / O utilization Di, network bandwidth utilization Bi, obtain the load upper limit parameters of each node, each type of resource of each node i has a corresponding load upper limit, calculate the single load deviation of each node, for each node i, calculate the deviation value of each load of the node, that is, the difference between the actual load and the upper limit, use PCi, PMi, PDi, PBi to represent the difference between the current load and the upper limit of the CPU, memory, disk I / O, and network bandwidth of node i, respectively, assign different weights to different resources, and calculate the weighted average sum of each node's CPU utilization Ci, memory utilization Mi, disk I / O utilization Di, and network bandwidth utilization Bi to obtain the comprehensive load deviation index.

4. A software testing automation platform according to claim 3, characterized in that: In the test execution module, the response time characteristics of each test script executing the test step are analyzed to generate a response time drift index. The response time drift index is obtained as follows: Set T0 as the target response time reference value and drift threshold κ, and the cumulative sum C t The initial value of is set to 0, that is, C0 = 0, and the response time deviation at each time point is calculated. For each time point t, the response time T t , calculate T t The deviation from the target response time T0 is denoted as ΔT t , update the cumulative sum value C according to the response time deviation of each test step execution t , the expression is: C t =max ( 0,C t-1 +(T t -T0-κ)); For forward accumulation, the response time drift index calculation expression is: For negative accumulation, the response time drift index calculation expression is: KM is the response time drift index.

5. A software testing automation platform according to claim 4, characterized in that: The test result analysis module is used to build a data prediction model, input the environmental load characteristics and execution response time characteristics into the model for comprehensive calculation, and determine the abnormal test cases during the test execution process based on the calculation results, specifically: The comprehensive load deviation index and the response time drift index are converted into the first eigenvector, and the first eigenvector is used as the input of the machine learning model. The machine learning model predicts the abnormality degree value label of the test case of the test execution process with each group of first eigenvectors as the prediction target, and minimizes the sum of the prediction errors of the abnormality degree value labels of all test cases in the test execution process as the training target. The machine learning model is trained until the sum of the prediction errors converges and the model training is stopped. The abnormality degree value of the test case in the test execution process is determined according to the model output results, wherein the machine learning model is a polynomial regression model.

6. A software testing automation platform according to claim 5, characterized in that: Compare the acquired abnormality level value of the test case in the test execution process with the preset abnormality level reference threshold value. If the abnormality level value of the test case in the test execution process is greater than or equal to the preset abnormality level reference threshold value, it means that the abnormality level of the test case in the test execution process is high. At this time, an early warning signal is generated and marked. If the abnormality level value of the test case in the test execution process is less than the preset abnormality level reference threshold, it means that the abnormality level of the test case in the test execution process is low. At this time, no warning signal is generated and it is not marked.

7. A software testing intelligent optimization method, used to implement a software testing automation platform according to any one of claims 1 to 6, characterized in that: S1: Provides integration of a visual interface and a script editor, allowing users to define test cases while supporting switching to code editing mode for advanced customization. It also automatically analyzes the content of test cases through natural language processing technology, assigning labels and categories to test cases. S2: Automatically generate executable automated test scripts based on test cases. The automated test scripts include a preset script template library and support user-defined script templates. The generated scripts are analyzed by intelligent optimization tools to automatically remove redundant steps and simplify the script structure. S3: The test tasks are assigned to various servers or virtual machines through the task scheduling algorithm to run in parallel, and the test execution results are collected in real time. The environmental load characteristics and execution response time characteristics of the test tasks during the test process are extracted; S4: Build a data prediction model, input the environmental load characteristics and execution response time characteristics into the model for comprehensive calculation, and determine the abnormal test cases in the test execution process according to the calculation results; S5: Delete abnormal test cases during the test execution process and generate a detailed test report. For normal test cases, dynamically adjust the priority of normal test cases and give priority to executing high-priority normal test cases.

Citation Information

Patent Citations

  • Automatic testing platform

    CN104331360A

  • Automatic test management system and management method

    CN116881153A

  • Test case automatic generation method, system and device and readable storage medium

    CN116909915A

  • Computer software testing method and system

    CN118349433A

  • Software engineering automation test system based on Internet

    CN118626391A

Cited By

  • Low-intrusive environmental anomaly test method and system

    CN119922105A

  • Test data management method and system based on database calling corresponding information

    CN120353710A

  • Low-code form data early warning method

    CN120386520A

  • UI test script visual arrangement method and system based on reinforcement learning

    CN120670322A

  • A UI test script visual arrangement method and system based on reinforcement learning

    CN120670322B