Adaptive software test environment configuration method and system
Through the adaptive software test environment configuration method, using the collaborative work of the perception layer, decision-making layer, execution layer and feedback layer, it solves the problem of traditional software test environment configuration relying on manual operations, realizes dynamic environment configuration and real-time optimization, and improves testing efficiency and quality.
Patent Information
- Application Number
- CN202411295876.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-21
AI Technical Summary
Traditional software testing environment configuration relies on manual operation, lacks intelligence and automation support, making it difficult to quickly respond to changes in diverse test requirements, and the accuracy of test environment indicator data directly affects subsequent data processing and analysis results.
Put forward a method of adaptive software testing environment configuration methods. Through the analysis of the testing needs of the perception layer, the decision -making layer generates a preliminary environment configuration solution. The containerization and virtualization management module creates and configures the virtual machine and container. The SDN control module sets the network topology and strategy. Automated configuration module execute the configuration scheme, dynamically monitor the use of resource usage in real time, adjust the strategy, optimize the effectiveness of the feedback module evaluation and adjust the effectiveness and adjust.
It realizes dynamic environment configuration, real-time feedback and adjustment, self-learning and optimization, ensuring the efficiency, accuracy and reliability of the test environment, and improving the overall quality of software products.
Smart Images

Figure CN119336651A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a method and system for configuring an adaptive software testing environment; Background Art
[0002] Traditional software testing environment configuration usually involves manually building and managing the hardware, software, and network resources required for testing. The testing team will manually configure the testing environment according to the test plan, including installing necessary components such as the operating system, database, and application server, and setting the corresponding parameters and network connections. Traditional software testing environment configuration methods rely on manual operations and lack intelligent and automated technical support. With the rapid development of the software industry and the continuous evolution of testing needs, traditional methods have been unable to adapt to these changes. It is urgent to introduce more advanced and efficient configuration methods to improve the efficiency and quality of software testing.
[0003] A search of the prior art revealed that a Chinese invention patent with publication number CN116594913A discloses an intelligent software automated testing method, which builds and configures a software testing environment through automated scripts and cloud service technology, performs deep prediction and calculation of test environment indicator data, and performs monitoring deployment and monitoring data collection on edge computing nodes based on benchmark test case data, performs enhanced dynamic adjustment, and then generates multimodal test data through cloud service computing, and finally performs adaptive feedback optimization to obtain intelligent software testing feedback optimization data;
[0004] However, in the actual software testing process, faced with diverse testing requirements and ever-changing software environments, once the test environment is built, adjusting and optimizing it is often a cumbersome task, and it is difficult to quickly respond to changes in test requirements. In addition, the accuracy of the test environment indicator data directly affects the subsequent data processing and analysis results. If there are errors or omissions in the collected data during the transmission process, all subsequent analyses will be based on inaccurate data. Summary of the invention
[0005] The purpose of the present invention is to propose an adaptive software testing environment configuration method and system in view of the problems existing in the background technology;
[0006] The technical solution of the present invention is a method for configuring an adaptive software testing environment, comprising the following specific steps:
[0007] Step 1: Before software testing begins, the perception layer uses the test requirement perception prediction model to analyze the software testing requirements, parse the code and configuration, analyze the requirement documents, and analyze the historical data. Then, based on the static analysis features and the results of historical data analysis, the decision layer generates a preliminary environment configuration plan through the test requirement perception prediction model and in combination with the rule engine.
[0008] Step 2: The containerization and virtualization management module uses virtualization technology to create and configure virtual machines according to the preliminary environment configuration plan, and uses containerization technology to deploy services and applications. The SDN control module uses the SDN controller to set the virtual network topology and network policy. Then the automation configuration module automatically executes the construction of the environment required for software testing according to the environment configuration plan.
[0009] Step 3: During the software testing process, the dynamic monitoring module monitors the resource usage in the test environment in real time. The data is collected by the monitoring tool and sent to the test demand perception prediction model based on the data interaction protocol. The test demand perception prediction model analyzes the monitoring data and identifies resource bottlenecks.
[0010] Step 4: The decision layer generates resource adjustment strategies based on real-time monitoring data and the prediction results of the test demand perception prediction model. It generates network optimization strategies based on the results of network traffic analysis and adjusts the test strategies through the test demand perception prediction model. The instruction execution layer dynamically adjusts the execution order and frequency of test cases.
[0011] Step 5: The optimization feedback module evaluates the effectiveness of the current software testing environment configuration, generates feedback information, and transmits the feedback information to the decision-making layer, which makes adjustments based on the feedback information.
[0012] Preferably, the test demand perception prediction model is a multi-input, multi-output deep neural network, which combines static analysis features, dynamic monitoring features and historical data features, and finally outputs prediction results for specific test requirements. The model construction process is as follows:
[0013] S1. Data preparation: Collect static analysis data, dynamic monitoring data, and historical test data from multiple projects to build a data set. Then, standardize the input data and perform One-Hot encoding on categorical variables.
[0014] S2. Loss function: A weighted multi-task loss function is used. The loss of each output task includes mean square error for resource prediction output and cross entropy loss for test case priority prediction.
[0015] S3. Model training: Use the Adam optimizer for training, set the initial learning rate to 0.001, and use the learning rate decay strategy during training. Use the validation set to monitor model performance during training, and use the early stopping technique to prevent overfitting.
[0016] S4. Use accuracy, error, and user feedback consistency evaluation indicators to evaluate the performance of the model;
[0017] S5. Deploy the constructed test demand perception prediction model in the model library of the decision-making layer.
[0018] Preferably, the data interaction protocol includes the following implementation steps:
[0019] S1, dynamic monitoring module selects random number r∈Z p * ={1,2,...,,p-1};
[0020] S2, the dynamic monitoring module calculates the following data transmission parameters in sequence:
[0021] P~data1=a r modp;
[0022] P~data2=H(P~data1,data resource );
[0023] P~data3=P~data2×ε+r;
[0024] Among them, p and q are large prime numbers, and a is Z p * The generator of q ≡1modp, H is the hash function, ε is the information encoding, data resource Use data for collected resources;
[0025] S3, the dynamic monitoring module generates a resource usage data packet Packet in the test environment = {P~data2, P~data3, data resource}, and transmit the data packet to the decision layer;
[0026] S4, the decision layer extracts data transmission parameters P~data2, data transmission parameters P~data3, and resource usage data from the received data packet Packet resource , and calculate the following data transmission parameters:
[0027]
[0028] P~data2'=H(P~data1'||data resource );
[0029] Among them, information decoding κ≡a q modp, || is the string concatenation symbol;
[0030] If P~data2'=P~data2, it means that no packet loss occurs, that is, the real-time test environment resource usage data obtained by the dynamic monitoring module is completely transmitted to the decision layer.
[0031] Preferably, the specific implementation steps of step 5 are as follows:
[0032] S1. Record the results of each test, including successful and failed test cases, test coverage, and performance indicators. Record the resource usage during the test and analyze the test results. Evaluate the impact of the current configuration on the test results. Identify configuration deficiencies and improvements. Associate test results with resource usage data. Identify the relationship between resource configuration and test quality.
[0033] S2. Based on the feedback data and test results, update the parameters of the test demand perception prediction model. The test demand perception prediction model continuously improves the prediction ability and optimization strategy by learning new data.
[0034] S3, update the policies in the rule engine and adjust the best practices in the rule base based on feedback data;
[0035] S4. Adjust the system configuration plan based on new strategies and optimization suggestions, collect configuration adjustment suggestions and opinions from users, and incorporate them into the system learning and optimization process;
[0036] S5. During the software testing process, the feedback and optimization layer collects user usage feedback in real time and performs optimization based on user feedback.
[0037] Preferably, the static analysis features include code complexity indicators extracted from static code analysis, module dependencies reflected by a dependency matrix between code modules, and test coverage.
[0038] Preferably, the dynamic monitoring features include:
[0039] Real-time resource usage, including CPU utilization, memory usage, and disk IO real-time monitoring data;
[0040] Network traffic data, including network latency and bandwidth utilization;
[0041] Test execution log, including the execution results and time of the test cases.
[0042] Preferably, the historical data features include:
[0043] Historical version test results, including the number of successful and failed test cases, test time, and error rate;
[0044] Resource usage history data, including resource usage during testing of previous versions;
[0045] User feedback history data, including user feedback and modification suggestions for previously tested configurations.
[0046] The technical solution of the present invention is: an adaptive software test environment configuration system, which is applicable to the above-mentioned adaptive software test environment configuration method, comprising:
[0047] Perception layer, used to collect test requirement data;
[0048] The decision-making layer is used to formulate configuration plans based on the perception data;
[0049] The execution layer is used to build and adjust the specific environment;
[0050] Feedback and optimization layer, used to collect and analyze test results and resource utilization.
[0051] Preferably, the perception layer includes:
[0052] Static analysis module, which is used to parse the project's code base, dependency files, and configuration files, identify the environmental resources and network configuration requirements required for testing, and use natural language processing technology to parse the requirements document to extract the test scope and key indicators;
[0053] Dynamic monitoring module, which is used to monitor resource usage during test execution and use SDN technology to monitor and analyze network traffic in the test environment;
[0054] The historical data analysis module is used to analyze the code and test results of historical versions, predict the test requirements of the current version, and collect and analyze the configuration adjustments made by users during the testing process.
[0055] Preferably, the execution layer includes:
[0056] Virtualization and containerization management module, used to create, start, pause and destroy virtual machines, dynamically adjust the resource allocation of virtual machines, and manage the test environment;
[0057] SDN control module, which is used to dynamically configure network routing and QoS policies, optimize network performance in the test environment, adjust network configuration in real time, and manage virtual network topology, supporting network segmentation, isolation, and cross-node connections;
[0058] The automated configuration module is used to automatically execute the configuration plan generated by the decision-making layer.
[0059] Compared with the prior art, the above technical solution of the present invention has the following beneficial technical effects:
[0060] (1) Dynamic environment configuration: Based on the perceived test requirements, the system automatically generates the optimal test environment configuration plan, realizes flexible allocation of network resources through SDN technology, and realizes rapid deployment and release of computing resources by combining virtualization technology;
[0061] (2) Real-time feedback and adjustment: During the test execution process, the system collects feedback information such as performance data and resource usage of the test environment in real time, and dynamically adjusts the environment configuration based on this information to ensure the stability and efficiency of the test;
[0062] (3) Self-learning and optimization: The system has the ability to self-learn and continuously optimizes its configuration strategy based on test results and feedback data, thus improving the accuracy and efficiency of self-adaptation.
[0063] (4) Complete data transmission: The present invention designs a data interaction protocol, which generates data transmission parameters for the resource usage status data collected in real time in the test environment, thereby ensuring complete data transmission and improving the accuracy of the model data;
[0064] The present invention overcomes the defects in the configuration of traditional software testing environment through intelligent perception, automatic configuration, dynamic adjustment and optimization technical means, realizes a more efficient, accurate and reliable software testing process, and ultimately achieves the beneficial technical effect of improving the overall quality of software products. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 This is an architecture diagram of an adaptive software testing environment configuration system proposed by the present invention;
[0066] Figure 2 This is the network structure diagram of the text extraction model;
[0067] Figure 3 This is a network structure diagram of a test demand perception prediction model proposed by the present invention. DETAILED DESCRIPTION
[0068] Embodiment 1, as Figure 1 As shown, the present invention proposes an adaptive software testing environment configuration system, including a perception layer, a decision layer, an execution layer and a feedback and optimization layer;
[0069] The perception layer is responsible for collecting test requirement data, and the perception layer includes a static analysis module, a dynamic monitoring module, and a historical data analysis module;
[0070] The static analysis module analyzes the project's code base, dependency files, and configuration files (such as Dockerfile and Kubernetes YAML) to identify the environment resources and network configuration requirements required for testing. It also uses natural language processing (NLP) technology to parse requirement documents to extract test scope and key indicators.
[0071] The dynamic monitoring module is used to monitor resource usage during test execution, including CPU, memory, disk IO, and network traffic. This data is used to determine whether the test environment configuration needs to be adjusted. On the other hand, SDN technology is used to monitor and analyze network traffic in the test environment.
[0072] The historical data analysis module is used to analyze the code and test results of historical versions, predict the test requirements of the current version, and collect and analyze the configuration adjustments made by users during the test process to optimize future configuration suggestions;
[0073] The decision layer formulates a configuration plan based on the perception data. The decision layer includes a model library, which stores the following models:
[0074] Test demand perception prediction model: Based on the data of the perception layer, a deep learning model is used to predict the resource allocation required during the test process so as to prepare the appropriate environment configuration in advance;
[0075] Network optimization model: optimizes the traffic path configuration in SDN (software defined network) to ensure the best network performance during the test;
[0076] Rule engine: contains the best configuration practices in different test scenarios (including but not limited to performance testing, security testing, and compatibility testing). The rule engine generates a preliminary environment configuration plan based on the output of the machine learning model and the rule base.
[0077] The execution layer is responsible for the construction and adjustment of the specific environment, and includes a virtualization and containerization management module, an SDN control module, and an automated configuration module;
[0078] The virtualization and containerization management module uses virtualization technology to create, start, pause, and destroy virtual machines, dynamically adjusts the resource allocation of virtual machines to meet test requirements, and uses containerization technology to manage the test environment, supporting rapid deployment, expansion, and recycling to ensure the flexibility and scalability of the environment;
[0079] The SDN control module uses the SDN controller to dynamically configure network routing and QoS (Quality of Service) policies to optimize network performance in the test environment. It adjusts network configuration in real time according to the instructions of the network optimization model and manages virtual network topology. It supports network segmentation, isolation, and cross-node connection to ensure that the network structure in the test environment is consistent with actual needs.
[0080] The automated configuration module is used to automatically execute the configuration scheme generated by the decision-making layer, including but not limited to resource allocation, network settings, and test case scheduling, to ensure the automated configuration and execution of the test environment;
[0081] The feedback and optimization layer provides real-time performance monitoring and data, including monitoring feedback module and optimization feedback module;
[0082] The monitoring feedback module monitors the usage of various resources in the test environment in real time and feeds the data back to the decision-making layer to trigger further optimization adjustments;
[0083] The optimization feedback module is used to collect and analyze test results and resource utilization, adjust model parameters and strategies in the rule engine, and continuously improve the system configuration efficiency and test quality.
[0084] Embodiment 2, an adaptive software test environment configuration method proposed by the present invention, which is applicable to an adaptive software test environment configuration system described in embodiment 1, specifically comprises the following steps:
[0085] Initial environment construction phase:
[0086] S1. Before software testing begins, the perception layer analyzes the requirements for software testing, including the following:
[0087] (1) Static analysis:
[0088] Code and configuration analysis: The static analysis module analyzes the source code, configuration files (such as Dockerfile, Kubernetes YAML files) and dependencies of the project to identify the basic requirements of the project, including but not limited to the required operating system, dependent libraries, and service components;
[0089] Requirements document analysis: Figure 2 As shown in the figure, the static analysis module uses natural language processing technology (NLP) and the BERT+BiLSTM+CRF text extraction model to automatically extract key information from the requirement document, such as test objectives, functional requirements, and performance standards;
[0090] In the figure, BERT (Bidirectional Encoder Representations from Transformers) is a pre-trained model, BiLSTM (Bidirectional Long Short-Term Memory) is a bidirectional long short-term memory network, LSTM is a long short-term memory network, CRF (conditional random field) is a conditional random field, and softmax is a normalization function;
[0091] (2) Historical data analysis:
[0092] Version history analysis: The historical data analysis module analyzes the test results and environment configurations of historical versions, identifies common configuration patterns and problems, and predicts resource requirements and potential problems of the current version by comparing the test results of different versions;
[0093] User feedback analysis: The historical data analysis module collects and analyzes user feedback and configuration adjustment records from previous tests;
[0094] S2. Based on the results of static analysis and historical data analysis, the decision-making layer generates a preliminary environment configuration plan through the test demand perception prediction model and in combination with the rule engine. The preliminary environment configuration plan includes but is not limited to the required computing resources, network settings, and test cases;
[0095] After that, the containerization and virtualization management module uses virtualization technology to create and configure virtual machines according to the preliminary environment configuration plan, including CPU, memory, storage, and network. It also uses containerization technology (such as Docker) to deploy necessary services and applications, including the network, storage, and service discovery of the container.
[0096] The SDN (Software Defined Network) control module uses the SDN controller to set the virtual network topology and network policies, including but not limited to traffic routing and QoS policies, to meet the network requirements of the test environment;
[0097] The automatic configuration module automatically builds the environment required for software testing according to the above environment configuration plan;
[0098] Dynamic configuration and execution phase:
[0099] S1. During the software testing process, the system monitors resources and network traffic in real time, including the following:
[0100] (1) The dynamic monitoring module monitors the resource usage in the test environment in real time, including but not limited to CPU utilization, memory usage, and disk IO. The data is collected through monitoring tools (such as Prometheus) and sent to the test demand-aware prediction model. The test demand-aware prediction model analyzes the monitoring data and identifies resource bottlenecks (such as CPU overload and insufficient memory).
[0101] (2) The SDN controller monitors network traffic and performance indicators (such as latency and bandwidth utilization), analyzes network traffic in real time, detects network bottlenecks and abnormal traffic patterns, and transmits them to the dynamic monitoring module;
[0102] It should be noted that in order to prevent the real-time test environment resource usage data obtained by the monitoring tool in the dynamic monitoring module from being lost during the transmission process and to ensure the accuracy of the input data of the test demand perception prediction model, this embodiment designs a data interaction protocol, and the specific implementation steps of the protocol are as follows:
[0103] S1-1, Dynamic monitoring module selects random number r∈Z p * ={1,2,...,,p-1};
[0104] S1-2, the dynamic monitoring module calculates the following data transmission parameters in sequence:
[0105] P~data1=a r modp;
[0106] P~data2=H(P~data1,data resource );
[0107] P~data3=P~data2×ε+r;
[0108] Among them, p and q are large prime numbers, and a is Z p * The generator of q ≡1modp, H is the hash function, ε is the information encoding, data resource Use data for collected resources;
[0109] S1-3, the dynamic monitoring module generates a resource usage data packet Packet in the test environment = {P~data2, P~data3, data resource}, and transmit the data packet to the model library;
[0110] S1-4, the decision layer extracts data transmission parameters P~data2, data transmission parameters P~data3, and resource usage data from the received data packet Packet resource , and calculate the following data transmission parameters:
[0111]
[0112] P~data2'=H(P~data1'||data resource );
[0113] Among them, information decoding κ≡a q modp, || is the string concatenation symbol;
[0114] If P~data2'=P~data2, it means that no packet loss occurs, that is, the real-time test environment resource usage data obtained by the monitoring tool in the dynamic monitoring module is completely transmitted to the decision-making layer;
[0115] S2, Adaptive solution adjusts various parameters of the test environment in real time according to predicted needs:
[0116] (1) The decision-making layer generates resource adjustment strategies based on real-time monitoring data and the prediction results of the test demand perception prediction model. The adjustment strategies include but are not limited to increasing or decreasing CPU, memory, and storage resources;
[0117] Afterwards, the execution layer dynamically adjusts the resource allocation of virtual machines and containers according to the instructions of the decision layer, generates resource adjustment instructions, and the automated configuration module executes the resource adjustment instructions and ensures the accuracy of the environment configuration;
[0118] (2) Based on the results of network traffic analysis, the network optimization model in the decision layer generates network optimization strategies, including but not limited to adjusting network routing and modifying QoS strategies. The SDN controller then executes the network optimization strategies and adjusts network configuration to improve performance and reliability.
[0119] (3) The decision-making layer adjusts the test strategy through the test demand perception prediction model, and the execution layer dynamically adjusts the execution order and frequency of test cases to adapt to environmental changes;
[0120] Feedback and optimization phase:
[0121] The optimization feedback module collects real-time data of the test environment, evaluates the effectiveness of the current software test environment configuration, and makes necessary adjustments based on the feedback information. The specific implementation steps are as follows:
[0122] S1. Record the results of each test, including but not limited to successful and failed test cases, test coverage, and performance indicators; record the resource usage during the test; analyze the test results; evaluate the impact of the current configuration on the test results; identify configuration deficiencies and improvements; correlate test results with resource usage data; and identify the relationship between resource configuration and test quality;
[0123] S2. Update the parameters of the machine learning model based on feedback data and test results. The models in the model library continuously improve their prediction capabilities and optimization strategies by learning new data.
[0124] S3, update the policies in the rule engine and adjust the best practices in the rule base based on feedback data;
[0125] S4. Based on the new strategies and optimization suggestions, adjust the system configuration plan, including but not limited to resource allocation, network settings, and test strategies, and collect configuration adjustment suggestions and opinions from users, and incorporate this information into the system learning and optimization process;
[0126] S5. The feedback and optimization layer in the software testing process collects user feedback in real time and optimizes based on user feedback, as follows:
[0127] (1) Feedback collection: Provide a feedback form or interface to allow users to submit feedback after the test is completed. The feedback includes but is not limited to opinions on environment configuration, test results, and resource usage;
[0128] (2) Feedback processing: The system analyzes user feedback and uses it to optimize the model and rule engine, continuously improving the configuration and optimization strategy of the test environment.
[0129] Embodiment three, as Figure 3 As shown, the present invention proposes a test demand perception prediction model, which is applicable to an adaptive software test environment configuration method proposed in Example 2. The model is a multi-input, multi-output deep neural network (DNN), which combines static analysis features, dynamic monitoring features and historical data features, and finally outputs prediction results for specific test requirements. Its specific architecture is as follows:
[0130] (1) The data input at the input layer includes static analysis features, dynamic monitoring features, and historical data features:
[0131] It should be noted that static analysis features include:
[0132] Code complexity: Code complexity metrics extracted from static code analysis (such as McCabe complexity);
[0133] Module dependency: dependency matrix between code modules to obtain the degree of coupling between modules;
[0134] Test coverage: current test coverage data, showing uncovered code areas;
[0135] It should be noted that the dynamic monitoring features include:
[0136] Real-time resource usage: CPU utilization, memory usage, and disk IO real-time monitoring data;
[0137] Network traffic data: network latency and bandwidth utilization collected through SDN;
[0138] Test execution log: test log data during runtime, including the execution results and time of the test cases;
[0139] It should be noted that the historical data characteristics include:
[0140] Historical version test results: including the number of successful and failed test cases, test time, and error rate;
[0141] Resource usage history data: includes resource usage of previous versions during testing (such as CPU, memory, and network traffic);
[0142] User feedback history: User feedback and modification suggestions on previously tested configurations;
[0143] (2) The hidden layer includes the feature fusion layer and the feature processing layer:
[0144] The feature fusion layer inputs the static analysis, dynamic monitoring and historical data features into different fully connected layers for processing, extracts high-level features, uses the ReLU activation function, and undergoes batch normalization (BN) processing. The Concatenate layer then fuses these processed high-level features to form a comprehensive feature vector.
[0145] It should be noted that the operation of BN is as follows:
[0146]
[0147] Among them, μ B , σ B 2 are the mean error and variance calculated from the samples in the mini-batch, respectively. γ and β are hyperparameters that can be learned during network training.
[0148] The ReLU activation function introduces nonlinearity, and its expression is as follows:
[0149] ReLU(x)=max(0,x);
[0150] The feature processing layer inputs the fused comprehensive feature vector into a multi-layer fully connected network to further extract deep features. Each layer contains a ReLU activation function, a Dropout layer, and a batch normalization layer.
[0151] (3) Output layer:
[0152] The model ultimately outputs resource demand predictions, test case priorities, and environment configuration optimization recommendations, including the following outputs:
[0153] Resource demand forecast output:
[0154] Output 1: Predict the computing resources required for the test (e.g., CPU, memory, disk IO);
[0155] Output 2: predict the network bandwidth and latency requirements required for the test;
[0156] Test case priority output:
[0157] Output 3: Predict which test cases should be executed first to maximize coverage of critical functions and potential defect areas;
[0158] Environmental configuration optimization suggestion output:
[0159] Output 4: Generate optimized test environment configuration suggestions (such as adjusting virtual machine configuration and optimizing network topology) based on current test requirements;
[0160] It should be noted that the construction process of the above test demand perception prediction model is as follows:
[0161] S1. Data preparation: Collect static analysis data, dynamic monitoring data, and historical test data from multiple projects to form a large-scale data set. Then standardize the input data and perform one-hot encoding on categorical variables (such as event types in logs).
[0162] S2. Since the model has multiple outputs, the test demand-aware prediction model designed in this embodiment uses a weighted multi-task loss function. The loss of each output task includes the mean square error (MSE) for resource prediction output and the cross entropy loss for test case priority prediction.
[0163] Resource demand prediction loss L resource The calculation method of is as follows:
[0164]
[0165] Where N is the number of samples, y resource,i is the actual resource demand of the i-th sample, The resource demand value predicted by the model;
[0166] Test case priority loss L priority The calculation method of is as follows:
[0167]
[0168] Among them, N is the number of samples, C is the number of priority categories, and y priority,i,c is the true label (one-hot encoding) of the i-th sample in category c, Predict the probability that the i-th sample belongs to category c for the model;
[0169] Environmental configuration priority recommended loss L config The calculation method of is as follows:
[0170]
[0171] Among them, y config,i is the real configuration recommendation value of the i-th sample, Suggested values for the configuration predicted by the model;
[0172] Comprehensive multi-task loss function L total The calculation method of is as follows:
[0173] L total =λ resource ×L resource +λ priority ×L priority +λ config ×L config ;
[0174] Among them, λ resource , priority , config They are the weight coefficients of resource demand prediction loss, test case priority prediction loss, and environment configuration optimization suggestion loss;
[0175] S3. Model training: Use the Adam optimizer for training, set the initial learning rate to 0.001, and use the learning rate decay strategy during training. Use the validation set to monitor model performance during training, and use the Early Stopping technique to prevent overfitting.
[0176] S4. Model evaluation:
[0177] Accuracy: Evaluate the classification accuracy of the predicted test case priorities;
[0178] Error: The mean square error of the resource demand forecast results is evaluated;
[0179] User feedback consistency: Compare the model's environmental configuration recommendations with actual user feedback and adjust the model's weights;
[0180] S5. Deploy the constructed test demand perception prediction model in the model library of the decision-making layer.
[0181] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited thereto, and various changes can be made within the knowledge scope of technicians in the relevant technical field without departing from the purpose of the present invention.
Claims
1. A method for configuring an adaptive software testing environment, characterized in that: The specific steps include: Step 1: Before software testing begins, the perception layer uses the test requirement perception prediction model to analyze the software testing requirements, parse the code and configuration, analyze the requirement documents, and analyze the historical data. Then, based on the static analysis features and the results of historical data analysis, the decision layer generates a preliminary environment configuration plan through the test requirement perception prediction model and in combination with the rule engine. Step 2: The containerization and virtualization management module uses virtualization technology to create and configure virtual machines according to the preliminary environment configuration plan, and uses containerization technology to deploy services and applications. The SDN control module uses the SDN controller to set the virtual network topology and network policy. Then the automation configuration module automatically executes the construction of the environment required for software testing according to the environment configuration plan. Step 3: During the software testing process, the dynamic monitoring module monitors the resource usage in the test environment in real time. The data is collected by the monitoring tool and sent to the test demand perception prediction model based on the data interaction protocol. The test demand perception prediction model analyzes the monitoring data and identifies resource bottlenecks. Step 4: The decision layer generates resource adjustment strategies based on real-time monitoring data and the prediction results of the test demand perception prediction model. It generates network optimization strategies based on the results of network traffic analysis and adjusts the test strategies through the test demand perception prediction model. The instruction execution layer dynamically adjusts the execution order and frequency of test cases. Step 5: The optimization feedback module evaluates the effectiveness of the current software testing environment configuration, generates feedback information, and transmits the feedback information to the decision-making layer, which makes adjustments based on the feedback information.
2. The method for configuring an adaptive software testing environment according to claim 1, characterized in that: The test demand perception prediction model is a multi-input, multi-output deep neural network that combines static analysis features, dynamic monitoring features, and historical data features to ultimately output prediction results for specific test requirements. The model construction process is as follows: S1. Data preparation: Collect static analysis data, dynamic monitoring data, and historical test data from multiple projects to build a data set. Then, standardize the input data and perform One-Hot encoding on categorical variables. S2. Loss function: A weighted multi-task loss function is used. The loss of each output task includes mean square error for resource prediction output and cross entropy loss for test case priority prediction. S3. Model training: Use the Adam optimizer for training, set the initial learning rate to 0.001, and use the learning rate decay strategy during training. Use the validation set to monitor model performance during training, and use the early stopping technique to prevent overfitting. S4. Use accuracy, error, and user feedback consistency evaluation indicators to evaluate the performance of the model; S5. Deploy the constructed test demand perception prediction model in the model library of the decision-making layer.
3. The method for configuring an adaptive software testing environment according to claim 1, characterized in that: The data interaction protocol includes the following implementation steps: S1, dynamic monitoring module selects random number r∈Z p * ={1,2,...,,p-1}; S2, the dynamic monitoring module calculates the following data transmission parameters in sequence: P~data1=a r modp; P~data2=H(P~data1,data resource ); P~data3=P~data2×ε+r; Among them, p and q are large prime numbers, and a is Z p * The generator of q ≡1mod p, H is the hash function, ε is the information encoding, data resource Use data for collected resources; S3, the dynamic monitoring module generates a resource usage data packet Packet in the test environment = {P~data2, P~data3, data resource }, and transmit the data packet to the model library; S4, the decision layer extracts data transmission parameters P~data2, data transmission parameters P~data3, and resource usage data from the received data packet Packet resource , and calculate the following data transmission parameters: P~data2'=H(P~data1'||data resource ); Among them, information decoding κ≡a q modp, || is the string concatenation symbol; If P~data2'=P~data2, it means that no packet loss occurs, that is, the real-time test environment resource usage data obtained by the dynamic monitoring module is completely transmitted to the decision layer.
4. The method for configuring an adaptive software testing environment according to claim 1, characterized in that: The specific implementation steps of step 5 are as follows: S1. Record the results of each test, including successful and failed test cases, test coverage, and performance indicators. Record the resource usage during the test and analyze the test results. Evaluate the impact of the current configuration on the test results. Identify configuration deficiencies and improvements. Associate test results with resource usage data. Identify the relationship between resource configuration and test quality. S2. Based on the feedback data and test results, update the parameters of the test demand perception prediction model. The test demand perception prediction model continuously improves the prediction ability and optimization strategy by learning new data. S3, update the policies in the rule engine and adjust the best practices in the rule base based on feedback data; S4. Adjust the system configuration plan based on new strategies and optimization suggestions, collect configuration adjustment suggestions and opinions from users, and incorporate them into the system learning and optimization process; S5. During the software testing process, the feedback and optimization layer collects user usage feedback in real time and performs optimization based on user feedback.
5. The method for configuring an adaptive software testing environment according to claim 2, characterized in that: The static analysis features include code complexity indicators extracted from static code analysis, module dependencies reflected by the dependency matrix between code modules, and test coverage.
6. The method for configuring an adaptive software testing environment according to claim 2, characterized in that: The dynamic monitoring features include: Real-time resource usage, including CPU utilization, memory usage, and disk IO real-time monitoring data; Network traffic data, including network latency and bandwidth utilization; Test execution log, including the execution results and time of the test cases.
7. The method for configuring an adaptive software testing environment according to claim 2, characterized in that: The historical data features include: Historical version test results, including the number of successful and failed test cases, test time, and error rate; Resource usage history data, including resource usage during testing of previous versions; User feedback history data, including user feedback and modification suggestions for previously tested configurations.
8. An adaptive software test environment configuration system, which is applicable to an adaptive software test environment configuration method according to any one of claims 1 to 7, characterized in that: include: Perception layer, used to collect test requirement data; The decision-making layer is used to formulate configuration plans based on the perception data; The execution layer is used to build and adjust the specific environment; Feedback and optimization layer, used to collect and analyze test results and resource utilization.
9. The adaptive software testing environment configuration system according to claim 8, characterized in that: The perception layer includes: Static analysis module, which is used to parse the project's code base, dependency files, and configuration files, identify the environmental resources and network configuration requirements required for testing, and use natural language processing technology to parse the requirements document to extract the test scope and key indicators; Dynamic monitoring module, which is used to monitor resource usage during test execution and use SDN technology to monitor and analyze network traffic in the test environment; The historical data analysis module is used to analyze the code and test results of historical versions, predict the test requirements of the current version, and collect and analyze the configuration adjustments made by users during the testing process.
10. The adaptive software testing environment configuration system according to claim 8, characterized in that: The execution layer includes: Virtualization and containerization management module, used to create, start, pause and destroy virtual machines, dynamically adjust the resource allocation of virtual machines, and manage the test environment; SDN control module, which is used to dynamically configure network routing and QoS policies, optimize network performance in the test environment, adjust network configuration in real time, and manage virtual network topology, supporting network segmentation, isolation, and cross-node connections; The automated configuration module is used to automatically execute the configuration plan generated by the decision-making layer.
Citation Information
Patent Citations
Automatic testing method for intelligent software
CN116594913A
Cited By
User personalized content pushing system and promotion method based on big data
CN119646319A
Alarm management system, method and device and storage medium
CN120066897A
Test data management method and system based on database calling corresponding information
CN120353710A
Dual-mode self-healing method of automatic test system based on virtualization hierarchical monitoring
CN120578561A
Software automation testing and optimizing method oriented to cloud computing environment
CN120596392A