Software testing method and device based on virtual machine and electronic equipment

By automatically adjusting the virtual machine and software configuration in software testing, the inefficient test caused by manual intervention in the prior art is solved, and more efficient and accurate software testing is achieved.

CN120234248APending Publication Date: 2025-07-01STATE GRID BEIJING ELECTRIC POWER CO +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510390072.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

In the prior art, when using a virtual machine to perform software testing, the virtual machine or software cannot be automatically adjusted according to the test results, and manual intervention and adjustment is required, resulting in low software testing efficiency.

Method used

Provide a virtual machine-based software testing method. By deploying multiple virtual machines, the target software is tested multiple rounds, and the configuration parameters of the virtual machine and/or the target software are automatically adjusted according to the test results of each round of tests, and after the adjustment is completed, the system status of the virtual machine is reset to perform the next round of tests.

Benefits of technology

It realizes automatic adjustment of the testing environment and software configuration without manual intervention, improving the efficiency and accuracy of software testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234248A_ABST
    Figure CN120234248A_ABST
Patent Text Reader

Abstract

The invention discloses a software testing method and device based on a virtual machine and electronic equipment, and relates to the field of software testing. The method comprises the following steps: deploying N virtual machines; performing X rounds of test on the target software on the N virtual machines, and recording a test result of each round of test; adjusting the configuration parameters of the virtual machine and / or the configuration parameters of the target software according to the test result of each round of test; and after the configuration parameters of the virtual machines and / or the configuration parameters of the target software are adjusted, resetting system states of the N virtual machines according to the newest configuration parameters of the virtual machines, and performing Y rounds of testing on the target software on the N virtual machines which are reset successfully according to the newest configuration parameters of the target software. The technical problem that in the prior art, when a virtual machine is used for software testing, the virtual machine or software cannot be automatically adjusted according to the testing result, testing can be deployed again after manual intervention and adjustment, and consequently the software testing efficiency is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software testing. Specifically, it relates to a software testing method, apparatus, and electronic device based on a virtual machine. Background Art

[0002] In the process of software development and testing, it is necessary to repeatedly test the software to ensure its quality and stability. Traditional testing methods often rely on physical test machines, which have problems such as complex environment setup, inflexible resource allocation, high testing costs, and difficulty in ensuring that the initial conditions of each test are exactly the same. With the development of virtualization technology, using virtual machines for testing has become a trend. However, in the prior art, when using virtual machines for software testing, the virtual machines or software cannot be automatically adjusted according to the test results, and manual intervention is required for adjustment before re-deploying the test, resulting in the technical problem of low software testing efficiency.

[0003] In response to the above problems, no effective solution has been proposed yet. Summary of the Invention

[0004] Embodiments of this application provide a software testing method, apparatus, and electronic device based on a virtual machine to at least solve the technical problem of low software testing efficiency in the prior art, where when using a virtual machine for software testing, the virtual machine or software cannot be automatically adjusted according to the test results, and manual intervention is required for adjustment before re-deploying the test.

[0005] According to one aspect of the embodiments of this application, a software testing method based on a virtual machine is provided, including: deploying N virtual machines, where N is an integer greater than 1, and the initial system states of the N virtual machines are the same; performing X rounds of testing on the target software on the N virtual machines and recording the test results of each round, where X is an integer greater than or equal to 1; adjusting the configuration parameters of the virtual machines and / or adjusting the configuration parameters of the target software according to the test results of each round; after completing the adjustment of the configuration parameters of the virtual machines and / or the target software, resetting the system states of the N virtual machines according to the latest configuration parameters of the virtual machines, and performing Y rounds of testing on the target software according to the latest configuration parameters of the target software on the N virtual machines that have been successfully reset, where Y is an integer greater than or equal to 1.

[0006] Optionally, deploying N virtual machines includes: creating virtual machine configuration information, where the virtual machine configuration information at least includes: N virtual machine instances corresponding to the N virtual machines, IP addresses corresponding to each virtual machine, network isolation states between different virtual machines, operating system information corresponding to the N virtual machines, and running environment information; deploying the N virtual machines in the virtual network according to the virtual machine configuration information.

[0007] Optionally, adjust the configuration parameters of the virtual machine and / or the configuration parameters of the target software according to the test results of each round of testing, including: according to the test results of each round of testing, when it is detected that a software failure occurs in any round of the X-round testing of the target software, determine the type of the software failure; according to the type of the software failure, adjust the configuration parameters of the target software; and / or; according to the test results of each round of testing, determine the performance information of K virtual machines among the N virtual machines during the X-round testing of the target software, and when it is detected that the performance information of the i-th virtual machine does not meet the preset condition, adjust the configuration parameters of the virtual machine according to the performance information of the i-th virtual machine, where i is an integer greater than or equal to 1 and less than or equal to K, K is an integer greater than or equal to 1, and the preset condition represents a maximum threshold or a minimum threshold preset for the performance information of the i-th virtual machine.

[0008] Optionally, the performance information of K virtual machines includes at least one of the following virtual machine performance information: network latency information of the N virtual machines during the X-round testing of the target software; processor utilization information of the N virtual machines during the X-round testing of the target software; memory utilization information of the N virtual machines during the X-round testing of the target software; disk data read speed and / or disk data write speed of the N virtual machines during the X-round testing of the target software; network bandwidth information of the N virtual machines during the X-round testing of the target software.

[0009] Optionally, according to the type of the software failure, adjust the configuration parameters of the target software, including: determine the software plug-in related to the software failure according to the type of the software failure; update the version and code corresponding to the software plug-in until the software plug-in can run normally independently; adjust the configuration parameters of the target software according to the updated software plug-in.

[0010] Optionally, after completing the adjustment of the configuration parameters of the virtual machine and / or the configuration parameters of the target software, reset the system state of the N virtual machines according to the latest configuration parameters of the virtual machine, including: delete the temporary files generated by the N virtual machines during the X-round testing of the target software; after determining that the deletion of the temporary files is successful, reset the system state of the N virtual machines according to the latest configuration parameters of the virtual machine, where the system states of the reset N virtual machines are the same.

[0011] Optionally, deploy N virtual machines, including: when the test process of the target software involves testing the data communication function of the target software between different devices, perform grouped deployment on the N virtual machines, where each group includes at least two virtual machines, and different virtual machines within each group can communicate with each other; when the test process of the target software does not involve testing the data communication function of the target software between different devices, set network isolation for different virtual machines among the N virtual machines.

[0012] Optionally, when deploying N virtual machines, it further includes: setting network isolation between virtual machines in different combinations when grouping and deploying the N virtual machines.

[0013] According to another aspect of the embodiments of the present application, there is also provided a software testing apparatus based on virtual machines, including: a first processing unit that deploys N virtual machines, where N is an integer greater than 1, and the initial system states of the N virtual machines are the same; a testing unit that conducts X rounds of testing on the target software on the N virtual machines and records the test results of each round of testing, where X is an integer greater than or equal to 1; a second processing unit that adjusts the configuration parameters of the virtual machines and / or adjusts the configuration parameters of the target software according to the test results of each round of testing; a third processing unit that, after completing the adjustment of the configuration parameters of the virtual machines and / or the configuration parameters of the target software, resets the system states of the N virtual machines according to the latest configuration parameters of the virtual machines, and conducts Y rounds of testing on the target software according to the latest configuration parameters of the target software on the N virtual machines that have been successfully reset, where Y is an integer greater than or equal to 1.

[0014] According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program runs, it causes the device where the computer-readable storage medium is located to execute the above-mentioned software testing method based on virtual machines.

[0015] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including one or more processors and a memory, where the memory is used to store one or more programs, and when the one or more programs are executed by the one or more processors, it causes the one or more processors to execute the above-mentioned software testing method based on virtual machines.

[0016] As can be seen from the above, the test machine re-entry system based on the virtual machine network of the present application uses virtual machines to test the target software in two batches. After the first batch of testing is completed, the configuration of the virtual machines and / or the configuration of the target software is automatically adjusted according to the test results. This process no longer requires manual intervention, and after determining that the adjustment is completed, the state of the virtual machines can be reset automatically to start the next batch of testing (that is, test using the adjusted software and / or virtual machines), thereby improving the test efficiency of the software. It can be seen that through the technical solution of the present application, the technical problem of low software test efficiency in the prior art, where it is impossible to automatically adjust the virtual machines or software according to the test results when using virtual machines for software testing and manual intervention is required for adjustment before redeploying the test, is solved. Description of the Drawings

[0017] The accompanying drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:

[0018] Figure 1 is a flowchart of a software testing method based on a virtual machine according to an embodiment of the present application;

[0019] Figure 2 is an optional system architecture diagram according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of an optional software testing device based on a virtual machine according to an embodiment of the present application. Detailed implementation manners

[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above accompanying drawings are used to distinguish similar objects and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0023] It should also be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) collected in this application are information and data authorized by the user or fully authorized by all parties. Moreover, for the processing of relevant data such as collection, storage, use, processing, transmission, provision, disclosure, and application, all comply with the relevant laws, regulations, and standards of the relevant regions, necessary confidentiality measures are taken, it does not violate public order and good customs, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set between this system and relevant users or institutions. Before obtaining relevant information, a request for acquisition needs to be sent to the aforementioned users or institutions through the interface, and after receiving the consent information feedback from the aforementioned users or institutions, the relevant information is obtained.

[0024] According to an embodiment of the present application, an embodiment of a method for software testing based on a virtual machine is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0025] Optionally, a test machine re-entry system based on a virtual network (hereinafter referred to as the system) can be used as the execution entity for software detection in the embodiments of the present application. Among them, the test machine re-entry system based on a virtual network can be a software system or an embedded system combining software and hardware. Of course, the execution entity of the technical method of the present application can also be other forms of devices, equipment, etc. Those skilled in the art should know that the specific manifestation forms of the execution entity of the present application are not particularly limited.

[0026] Figure 1 is a flowchart of a method for software testing based on a virtual machine according to an embodiment of the present application, as Figure 1 shown, the method includes the following steps:

[0027] Step S101, deploy N virtual machines.

[0028] Among them, N is an integer greater than 1, and the initial system states of the N virtual machines are the same.

[0029] Optionally, deploying N virtual machines means creating multiple virtual machine instances (each instance represents a virtual machine), which can also be called test machine instances (each instance represents a test machine), and the number of the N virtual machines is dynamically adjusted according to test requirements and can be multiple, such as 3, 5 or more. These virtual machine instances are not simply software running on a physical host, but independent computing environments, and each environment contains a complete operating system and necessary hardware simulation.

[0030] Optionally, the initial system state includes but is not limited to the operating system version, the configuration of application software, system settings, network parameters, etc.

[0031] Optionally, the same initial system state means that before the start of the test, each virtual machine has the same software environment and hardware configuration. This environmental consistency ensures that comparable test results can be obtained regardless of which virtual machine the test is carried out on, eliminating test errors that may be caused by differences in hardware or software environments. This feature provides a solid foundation for functional testing, performance testing, especially for scenarios that require multiple rounds or concurrent testing, making the test results more accurate and reliable. At the same time, it also creates conditions for the effective operation of the test machine re-entry mechanism.

[0032] Optionally, the tester submits test requirements through an interactive interface or a script, specifying parameters such as the test type, the number of times, and the environmental configuration; the virtual machine management module creates virtual machines as needed, the network configuration module completes network initialization, the test task scheduling module assigns initial tasks, and at the same time records task assignment information; the test task scheduling module receives test task requests, comprehensively considers factors such as task priority and the idle status of test machine resources, and intelligently assigns tasks to appropriate test machines.

[0033] For example, in a functional testing scenario, if the tester needs to test a certain software 5 times on operating system A, the system will create 3 virtual machine instances, each instance running operating system A, and installing the same version of the test software, with exactly the same test environment configuration. This consistency is not limited to the software environment, but also includes the allocation of hardware resources, such as CPU, memory, disk read and write speeds, etc., to ensure that each test instance is tested under the same conditions.

[0034] In a performance testing scenario, in order to simulate concurrent access in a high-load network environment, the system may create multiple high-performance virtual machines, each with the same operating system environment and network configuration, and at the same time allocate sufficient CPU and memory resources to accurately test the performance of the software in a high-concurrency scenario. In this way, a repeatable, controllable and consistent test environment can be provided for software testing, greatly improving the efficiency and accuracy of testing.

[0035] Step S102: Conduct X rounds of tests on the target software on N virtual machines and record the test results of each round.

[0036] Wherein, X is an integer greater than or equal to 1.

[0037] Optionally, the target software refers to the software system to be evaluated in this test. The target software can be software under development, updated software, or deployed software that requires performance evaluation. The purpose of the test is to verify whether its functions, performance, stability, security, etc. meet the expectations.

[0038] Optionally, system testing is not completed on a single virtual machine, but on multiple virtual machines with the same initial state simultaneously or sequentially. This design can improve the test coverage and efficiency, reduce the test time, especially when conducting concurrent testing or stress testing.

[0039] Optionally, the system receives test task requests through the test task scheduling module, and comprehensively considers factors such as task priority and the idle status of test machine resources, and intelligently allocates tasks to appropriate test machines. For example, for urgent regression test tasks, they are preferentially allocated to test machines with good performance and idle status to ensure quick feedback.

[0040] Optionally, the test machine loads test resources and executes tests according to a predetermined process, and the status monitoring and recovery module monitors the performance in real time. If the test ends normally, the results are stored; if there is a failure, it is processed in a timely manner and the error is recorded.

[0041] Step S103, adjust the configuration parameters of the virtual machine and / or adjust the configuration parameters of the target software according to the test results of each round of testing.

[0042] Optionally, the configuration parameters of the virtual machine involve the allocation of virtual machine hardware resources, such as the number of CPU cores, memory size, disk space, network bandwidth, etc., as well as the setting of the software environment, including the operating system version, pre-installed software, network configuration, etc. Adjusting these parameters can optimize the performance of the virtual machine and make it more suitable for specific test requirements.

[0043] Optionally, the configuration parameters of the target software usually refer to the settings that can be adjusted when the software is running, such as service ports, the number of threads, cache size, database connection parameters, network timeout settings, etc. These parameters directly affect the performance and behavior of the software. By adjusting them, different running conditions can be simulated in the test to test the stability and efficiency of the software in various environments.

[0044] Optionally, after the system executes the first test, if the test ends normally, the results are stored; if there is a failure, it is processed in a timely manner and the error is recorded.

[0045] Optionally, the status monitoring and recovery module in the system collects key performance indicators of the test machine in real time, such as CPU, memory, disk I / O, network bandwidth, etc. Once an anomaly is detected (such as memory overflow, network interruption), the recovery process is immediately started, including restarting the service, resetting the network connection, or even restarting the test machine.

[0046] Step S104, after adjusting the configuration parameters of the virtual machine and / or the configuration parameters of the target software, reset the system states of the N virtual machines according to the latest configuration parameters of the virtual machine, and perform Y rounds of tests on the target software according to the latest configuration parameters of the target software on the N virtual machines that have been successfully reset, where Y is an integer greater than or equal to 1.

[0047] Optionally, the system, through the test task scheduling module, tracks the progress of task execution, determines whether the test machine needs to re-enter the test, and reasonably arranges the re-entry process according to a preset policy (such as test failure retry, performance test iteration, etc.), and coordinates the reallocation of resources. After the test task scheduling module determines the re-entry, the status monitoring and recovery module resets the status of the test machine.

[0048] Optionally, resetting the system states of the N virtual machines includes: before the test machine re-enters, the status monitoring and recovery module ensures that the system, application, and data states are fully restored to the initial settings, clears the data and caches left over from the previous test, and restores the system configuration to ensure the independence of each test.

[0049] Optionally, after the reset is successful, enter the re-entry test execution phase. The test machine will perform Y rounds of tests on the software according to the latest configuration parameters of the target software (the test machine repeats the test process and continuously collects monitoring data until the re-entry times are reached or the end conditions are met), where Y is the preset number of test times. For example, if the first test shows that the performance of the software degrades under high-concurrency access, the system may increase the number of CPU cores and the memory size of the virtual machine, and adjust the cache policy and thread configuration of the target software. After these parameter adjustments, the system resets the N virtual machines to the latest state and then performs Y re-entry tests to evaluate the effect of the configuration changes. If Y is set to 3, the system will perform 3 consecutive rounds of tests, and each round of tests uses the same latest configuration parameters to collect enough data to evaluate the stability and performance of the software in the optimized environment.

[0050] Optionally, after all tests are completed, the virtual machine management module shuts down the virtual machine to recycle resources, the network configuration module cleans up the network, and the test result summary module integrates and analyzes the data to generate a report.

[0051] Optionally, the following is an optional syntax code according to this embodiment:

[0052] graph TD;

[0053] A[Virtual machine management module] --> B[Create / Start virtual machine];

[0054] A --> C[Suspend / Shut down virtual machine];

[0055] A --> D[Resource allocation];

[0056] A --> E [Maintain virtual machine status information];

[0057] F [Network configuration module] --> G [Build virtual network architecture];

[0058] F --> H [Configure network devices];

[0059] F --> I [Formulate network policies];

[0060] J [Test task scheduling module] --> K [Receive task requests];

[0061] J --> L [Task allocation];

[0062] J --> M [Track task progress];

[0063] J --> N [Re - entry decision];

[0064] O [Status monitoring and recovery module] --> P [Monitor performance metrics];

[0065] O --> Q [Exception handling];

[0066] O --> R [Status recovery];

[0067] B --> S [Test machine instance 1];

[0068] C --> S;

[0069] D --> S;

[0070] E --> S;

[0071] G --> S;

[0072] H --> S;

[0073] I --> S;

[0074] K --> S;

[0075] L --> S;

[0076] M --> S;

[0077] N --> S;

[0078] P --> S;

[0079] Q --> S;

[0080] R --> S;

[0081] B --> T [Test machine instance 2];

[0082] C --> T;

[0083] D --> T;

[0084] E -> T;

[0085] G -> T;

[0086] H -> T;

[0087] I -> T;

[0088] K -> T;

[0089] L -> T;

[0090] M -> T;

[0091] N -> T;

[0092] P -> T;

[0093] Q -> T;

[0094] R -> T;

[0095] / / More test machine instances and connection relationships can be added as needed.

[0096] Optionally, Figure 2 is an alternative system architecture diagram according to this embodiment, as Figure 2 shown, the system working process includes:

[0097] In the first step, the test preparation stage, the virtual machine management module and the network configuration module work together to create and initialize N virtual machine instances. The initial system states of these instances are the same to ensure the consistency of the environment and the comparability of the tests.

[0098] Optionally, the virtual machine management module is responsible for creating, starting, pausing, and shutting down virtual machine instances, and can dynamically allocate resources such as CPU, memory, and disk according to test requirements. For example, according to the complexity of the test task and the prediction of resource requirements, a virtual machine configuration with multiple cores and high memory is allocated for stress testing, and a basic configuration is provided for regular function testing.

[0099] Optionally, the virtual machine management module can also be used to maintain a virtual machine status information library, and update the running status (such as idle, running, faulty, etc.) and task association of the virtual machine in real time, which is convenient for accurate scheduling.

[0100] Optionally, the network configuration module can be used to build a virtual network architecture, including device configurations such as virtual switches and routers, allocate independent IP segments for the test machines, and ensure test traffic isolation. Taking the distributed system test as an example, a multi-node network topology can be simulated, such as building a virtual network including front-end, back-end, and middleware servers, to meet the simulation requirements of complex business scenarios.

[0101] Optionally, according to the test requirements, the network configuration module performs detailed configuration on the virtual network device, such as setting network latency, bandwidth limit, etc., to simulate different network environments.

[0102] Optionally, the network configuration module can also be used to formulate flexible network policies, including firewall rules, to control the network access permissions inside and outside the test machine and ensure the security of the test environment.

[0103] In the second step, the first execution stage, the test task scheduling module assigns tasks to the test machine instances, and the status monitoring and recovery module starts to monitor the performance metrics during the test process to ensure that the test is carried out under controlled conditions.

[0104] Optionally, the test task scheduling module can be used to receive test task requests, comprehensively consider factors such as task priority and the idle status of test machine resources, and intelligently allocate tasks to appropriate test machines. For example, for urgent regression test tasks, they are preferentially allocated to test machines with good performance and idle status to ensure quick feedback.

[0105] Optionally, the status monitoring and recovery module can be used to collect key performance metrics of the test machine in real time, such as CPU, memory, disk I / O, network bandwidth, etc. Once an anomaly is detected (such as memory overflow, network interruption), the recovery process is immediately started, including restarting services, resetting network connections, and even restarting the test machine. Optionally, Test Machine Instance 1 refers to that in the functional test scenario, the virtual machine management module creates an adapted virtual machine, the network configuration module constructs an isolated network, the test task scheduling module allocates functional test tasks, and the status monitoring and recovery module monitors and ensures the consistency of the test environment.

[0106] Optionally, Test Machine Instance 2 refers to that in the performance test scenario, the virtual machine management module provides high - configuration virtual machine instances, the network configuration module sets a high - speed virtual network, the test task scheduling module coordinates the execution of performance test tasks, and the status monitoring and recovery module monitors and optimizes performance metrics in real time to ensure the accuracy and reliability of test results.

[0107] In the third step, the re - entry decision and preparation stage, after completing a round of testing, the test task scheduling module determines whether to re - enter the test according to the preset policy and test results. If necessary, the status monitoring and recovery module will reset the test machine status to prepare for the next round of testing.

[0108] Optionally, the test task scheduling module can also be used to track the task execution progress, determine whether the test machine needs to re - enter the test, reasonably arrange the re - entry process according to the preset policy (such as test failure retry, performance test iteration, etc.), and coordinate resource re - allocation.

[0109] Optionally, the status monitoring and recovery module can also be used to ensure that the system, application, and data states are fully restored to the initial settings before the test machine re-enters, clear the data and caches left over from the previous test, restore the system configuration, and ensure the independence of each test.

[0110] In the fourth step, re-entrant test execution is carried out. The test machine repeats the test process, and the status monitoring and recovery module continues to monitor the performance metrics until the predetermined number of re-entries is reached or the end condition is met.

[0111] In the fifth step, the test is concluded. The virtual machine management module shuts down the virtual machine to recycle resources, the network configuration module clears the network configuration, and the status monitoring and recovery module is responsible for aggregating the test data and generating a report.

[0112] In summary, Figure 2 Through their close interaction relationships, these modules jointly achieve the automation of software testing, the dynamic allocation of resources, the precise control of the environment, and the timely recovery of faults, significantly improving the efficiency and quality of software testing. Whether in functional testing or performance testing, through the collaborative work of these modules, the test machine can quickly respond, accurately identify, and solve problems that occur during testing when re-entering the system, providing strong support for software development.

[0113] In an alternative embodiment, a functional testing scenario is provided. Preparation phase: The tester submits functional testing requirements, specifying that 5 tests need to be carried out in the environment of Operating System A and a specific software version. The virtual machine management module creates 3 adapted virtual machine instances, the network configuration module constructs an isolated network and assigns IPs, and the test task scheduling module assigns initial tasks. First test: The test machine loads the functional test cases, and during the execution process, the status monitoring and recovery module monitors the performance. If abnormalities such as interface loading lags occur, they are recorded in a timely manner and attempts are made to repair them. The results are stored after normal completion. Re-entry decision: If it is found during the first test that a certain functional module does not respond as expected, the test task scheduling module triggers a re-entry. After the status monitoring and recovery module clears the temporary files and resets the relevant software configuration, the test machine re-enters the test and repeats 5 times or until the function is normal. Conclusion: After the test is completed, the virtual machine is shut down, resources are recycled, and a functional test report is generated.

[0114] In an alternative embodiment, a performance test scenario is provided. Preparation: Submit a performance test requirement, demanding to simulate 1000 concurrent user accesses under a high-load network and a Linux system, and continuously conduct 3 rounds of tests. Accordingly, create a high-performance virtual machine and configure a high-speed virtual network. First-round test: The test machine runs a performance test tool to simulate concurrency, and the monitoring module collects indicators such as CPU, memory, and network in real time. If the network latency is too high, adjust the virtual network configuration to attempt to fix it. Re-entry optimization: According to the results of the first round, if the response time does not meet the standard, the scheduling module arranges for re-entry, the recovery module resets the system state, adjusts the resource allocation, such as increasing the number of CPU cores for key services, and conducts tests again for a total of 3 rounds. Wrapping up: After completion, organize the performance data, generate a report, and guide the system performance optimization.

[0115] As can be seen from the above, the test machine re-entry system based on the virtual machine network of the present application tests the target software using virtual machines in two batches. After the first batch of tests, the configuration of the virtual machine and / or the configuration of the target software are automatically adjusted according to the test results. This process no longer requires manual intervention, and after determining that the adjustment is completed, the state of the virtual machine can be reset by itself to start the next batch of tests (i.e., test using the adjusted software and / or virtual machine), thereby improving the test efficiency of the software.

[0116] Thus, through the technical solution of the present application, the technical problem of low software test efficiency in the prior art, where the virtual machine or software cannot be automatically adjusted according to the test results during software testing using virtual machines and manual intervention is required for adjustment before re-deployment for testing, is solved.

[0117] In an alternative embodiment, N virtual machines are deployed, including: creating virtual machine configuration information, where the virtual machine configuration information at least includes: N virtual machine instances corresponding to the N virtual machines, the IP address corresponding to each virtual machine, the network isolation status between different virtual machines, the operating system information corresponding to the N virtual machines, and the running environment information; and deploying the N virtual machines in the virtual network according to the virtual machine configuration information.

[0118] Optionally, as Figure 2 shown, the system creates, starts, pauses, and shuts down virtual machine instances through the virtual machine management module, and can dynamically allocate resources such as CPU, memory, and disk according to test requirements. For example, according to the complexity of the test task and the prediction of resource requirements, allocate a multi-core high-memory virtual machine configuration for stress testing and provide a basic configuration for regular function testing. The system can also maintain a virtual machine status information library through the virtual machine management module, and update the running status of the virtual machine (such as idle, running, faulty, etc.) and task association in real time to facilitate precise scheduling.

[0119] Optionally, as Figure 2As shown, the system constructs a virtual network architecture through the network configuration module, including the configuration of devices such as virtual switches and routers, assigns an independent IP segment to the test machine, and ensures the isolation of test traffic. Taking the testing of distributed systems as an example, it can simulate a multi-node network topology, such as constructing a virtual network including front-end, back-end, and middleware servers to meet the simulation requirements of complex business scenarios. The system can also formulate flexible network policies through the network configuration module, including firewall rules, to control the network access permissions inside and outside the test machine and ensure the security of the test environment.

[0120] Optionally, the process of deploying N virtual machines is based on the configuration information created by the virtual machine management module, that is, the test preparation stage. Testers submit test requirements through the interactive interface or script, specifying parameters such as the test type, number of times, and environment configuration. The virtual machine management module creates virtual machines as needed, the network configuration module completes network initialization, and the test task scheduling module assigns initial tasks while recording task assignment information.

[0121] Optionally, through the above steps, the system can quickly and accurately deploy N virtual machine instances in the virtual network, providing a highly controllable and reproducible environment for software testing. This can not only improve the efficiency and accuracy of testing but also reduce testing costs, especially when dealing with large-scale and high-concurrency software testing scenarios, demonstrating its unique advantages.

[0122] In an optional embodiment, the configuration parameters of the virtual machine and / or the configuration parameters of the target software are adjusted according to the test results of each round of testing, including: according to the test results of each round of testing, when it is detected that the target software has a software failure in any round of the X-round testing, determining the type of the software failure; according to the type of the software failure, adjusting the configuration parameters of the target software; and / or; according to the test results of each round of testing, determining the performance information of K virtual machines among the N virtual machines during the X-round testing of the target software, and when it is detected that the performance information of the i-th virtual machine does not meet the preset conditions, adjusting the configuration parameters of the virtual machine according to the performance information of the i-th virtual machine, where i is an integer greater than or equal to 1 and less than or equal to K, K is an integer greater than or equal to 1, and the preset conditions represent the maximum threshold or minimum threshold preset for the performance information of the i-th virtual machine.

[0123] Optionally, the system can receive test task requests through the test task scheduling module, and intelligently allocate tasks to appropriate test machines by comprehensively considering factors such as task priority and the idle status of test machine resources. For example, for urgent regression test tasks, they are preferentially allocated to test machines with good performance and idle status to ensure quick feedback.

[0124] Optionally, the system can also track the progress of task execution through the test task scheduling module, determine whether the test machine needs to re-enter the test, reasonably arrange the re-entry process according to preset strategies (such as test failure retry, performance test iteration, etc.), and coordinate resource redistribution.

[0125] Optionally, the system can collect key performance indicators such as the CPU, memory, disk I / O, network bandwidth, etc. of the test machine in real time through the status detection and recovery module. Once an abnormality is found (such as memory overflow, network interruption), the recovery process is immediately started, including restarting the service, resetting the network connection, and even restarting the test machine.

[0126] Optionally, the system can also ensure that the system, application, and data status are completely restored to the initial settings through the status detection and recovery module before the test machine is re-entered, clear the data and cache left over from the last test, restore the system configuration, and ensure the independence of each test.

[0127] Optionally, during the first test execution phase, the test machine loads the test resources and executes the test according to the predetermined process, and the status monitoring and recovery module monitors the performance in real time. If the test ends normally, the results are stored; if a failure occurs, the error is processed and recorded in a timely manner.

[0128] Optionally, during the software testing process, if the state monitoring and recovery module detects that the target software has a software failure in any of the X rounds of testing, it will first determine the type of software failure. Software failures may include but are not limited to program crashes, performance bottlenecks, compatibility issues, security vulnerabilities, etc.

[0129] Optionally, once the system determines the type of fault, it will intelligently adjust the configuration parameters of the target software to try to resolve or mitigate the fault.

[0130] For example, if the failure is due to performance degradation caused by memory leaks, the system may adjust the memory management strategy of the target software, such as increasing the frequency of garbage collection or optimizing the caching mechanism, to reduce memory consumption; if the failure is caused by unstable network connection, the system may adjust the network configuration parameters of the software, such as adding a retry mechanism, optimizing the connection timeout setting, etc., to improve the robustness of the software under unstable network conditions.

[0131] Optionally, the system simultaneously monitors the performance information of N virtual machines during X rounds of testing through a status monitoring and recovery module. The information includes but is not limited to CPU usage, memory usage, disk I / O rate, network latency, etc.

[0132] Optionally, if the status monitoring and recovery module detects that the performance information of the i-th virtual machine does not meet the preset conditions (i.e., the maximum or minimum thresholds), it will intelligently adjust the configuration parameters of the virtual machine according to the performance information of the virtual machine. For example, if the CPU utilization rate of the i-th virtual machine exceeds the preset maximum threshold in a high-concurrency test environment, the system may automatically increase the number of CPU cores of the virtual machine to cope with the high load; if the memory occupancy rate is lower than the preset minimum threshold, the system may reduce the memory allocated to the virtual machine to optimize resource utilization.

[0133] Optionally, the above steps not only reflect the intelligence and self-adaptability of the system, but also ensure that the test environment and software configuration can be dynamically optimized according to the test results, thereby improving the efficiency and accuracy of the test, as well as the performance and stability of the software.

[0134] In an alternative embodiment, the performance information of the K virtual machines includes at least one of the following virtual machine performance information: network latency information of the N virtual machines during X rounds of testing of the target software; processor utilization information of the N virtual machines during X rounds of testing of the target software; memory utilization information of the N virtual machines during X rounds of testing of the target software; disk data read speed and / or disk data write speed of the N virtual machines during X rounds of testing of the target software; network bandwidth information of the N virtual machines during X rounds of testing of the target software.

[0135] Optionally, the system collects performance information such as network latency information, processor utilization information, memory utilization information, disk data read speed and / or disk data write speed, and network bandwidth information of the virtual machine in real time through the status monitoring and recovery module.

[0136] Optionally, the network latency information refers to the communication latency between the virtual machine and the external system or the test machine involved in the test.

[0137] Optionally, the processor utilization information refers to monitoring the CPU usage of the virtual machine.

[0138] Optionally, the memory utilization information refers to the memory usage of the virtual machine.

[0139] Optionally, the disk data read and write speed reflects the performance of the virtual machine disk I / O.

[0140] Optionally, obtaining the network bandwidth information refers to monitoring the network traffic bandwidth of the virtual machine.

[0141] Optionally, when any of the above performance information is detected not to meet the preset conditions, the system will adjust the configuration parameters of the virtual machine or the target software according to this information. The preset conditions are usually a set of performance thresholds, which represent the ideal or acceptable performance levels of the virtual machine or software during the testing process. The purpose of adjusting the configuration parameters is to optimize the test environment and ensure that the software can run stably under all test conditions and meet the performance requirements.

[0142] In an alternative embodiment, according to the type of software failure, the configuration parameters of the target software are adjusted, including: determining the software plug-in related to the software failure according to the type of software failure; updating the version and code corresponding to the software plug-in until the software plug-in can run independently normally; adjusting the configuration parameters of the target software according to the updated software plug-in.

[0143] Optionally, during the software testing process, various types of software failures may be encountered, such as functional anomalies, performance bottlenecks, security vulnerabilities, etc. For these failures, the status monitoring and recovery module will determine the software plug-ins or components that may be related to the software failure according to the type of failure. These plug-ins are usually the parts with specific functions or performance sensitivity in the software. The goal of determining the relevant software plug-ins is to locate the root cause of the failure for targeted repair or optimization.

[0144] Optionally, once the faulty plug-in is determined, the system will automatically or manually (through the intervention of testers) update the version of the plug-in or modify its code until the plug-in can run independently normally. The update of the software plug-in may include applying software patches, upgrading to the latest version, fixing known vulnerabilities, optimizing performance code, etc. to solve the failure. This process emphasizes the replaceability and modular design of software components, allowing the faulty components to be repaired or optimized independently without affecting the entire software system.

[0145] Optionally, the adjustment of the configuration parameters of the target software is based on the results after the plug-in update. When the software plug-in is successfully updated and can run stably, the system will intelligently adjust the configuration parameters of the target software according to the update and test results of the plug-in.

[0146] For example, if the failure is caused by improper memory management, the system may adjust the memory allocation strategy of the plug-in or increase the memory pool size; if the failure is related to the network configuration, the network buffer size may be adjusted and the network communication protocol may be optimized. In this way, the status monitoring and recovery module ensures that the software can run more efficiently and stably after the failure is repaired.

[0147] In an alternative embodiment, after the configuration parameters of the virtual machine and / or the configuration parameters of the target software are adjusted, the system states of the N virtual machines are reset according to the latest configuration parameters of the virtual machine, including: deleting the temporary files generated during the X rounds of testing of the target software in the N virtual machines; after determining that the deletion of the temporary files is successful, resetting the system states of the N virtual machines according to the latest configuration parameters of the virtual machine, where the system states of the N virtual machines after resetting are the same.

[0148] Optionally, when the status monitoring and recovery module detects an abnormal performance metric or a software fault, and adjusts the configuration parameters of the virtual machine or the target software after analysis and processing, it is then necessary to ensure that the system, application, and data states are fully restored to the initial settings for the next round of testing or re-entry testing.

[0149] Optionally, after each test, the status monitoring and recovery module automatically deletes all temporary files related to the target software in the virtual machine. These temporary files may include log files, cached data, temporary database records, etc., which are generated by the software or the virtual machine system during the test to store intermediate results or status information. The purpose of deleting these files is to clear the data and cache left over from the previous test, restore the system configuration, and ensure the independence of each test.

[0150] Optionally, after determining that the temporary files have been completely deleted, the status monitoring and recovery module resets the system states of all N virtual machines according to the latest configuration parameters of the virtual machine.

[0151] Optionally, through the above steps, the system can ensure that the virtual machine is in a unified, clean, and system state that matches the latest configuration parameters before each re-entry test. This not only improves the efficiency and accuracy of software testing but also reduces test errors caused by environmental factors, providing a highly controllable and reproducible environment for software development testing.

[0152] In an alternative embodiment, N virtual machines are deployed, including: when testing the data communication function of the target software based on different devices during the testing process of the target software, the N virtual machines are grouped and deployed, where each group includes at least two virtual machines, and different virtual machines within each group can communicate with each other; when the testing process of the target software does not involve testing the data communication function of the target software based on different devices, network isolation is set for different virtual machines among the N virtual machines.

[0153] Optionally, when deploying N virtual machines, the network configuration module and the virtual machine management module adopt different deployment strategies according to whether the target software under test involves data communication functions between different devices. This strategy division ensures the rationality and pertinence of virtual machine network configuration, and optimizes the test environment and resource utilization.

[0154] Optionally, when the test of the target software involves data communication functions between different devices, such as testing scenarios like distributed systems, network protocols, multi-terminal applications, etc., the network configuration module deploys the N virtual machines in groups to simulate the actual data communication environment. In each group, there are at least two virtual machines, and the network communication between these virtual machines is open, allowing data exchange and functional interaction. Such a configuration simulates the operating environment of the software in the real world, enabling testers to evaluate the performance and functional performance of the software when communicating between different devices.

[0155] Optionally, the creation of a virtual network environment by the network configuration module is involved in the grouped deployment, which includes network devices such as virtual switches and routers, and assigns independent IP segments to each group of virtual machines to ensure efficient and isolated intra-group communication. By simulating communication under different network conditions, such as high latency, packet loss, bandwidth limitation, etc., the system can evaluate the robustness and optimization space of the target software in terms of network communication, providing comprehensive test coverage for the network communication function of the software.

[0156] Optionally, when the test of the target software does not involve data communication functions between different devices, such as functional testing of a single application, system resource occupancy testing, etc., the network configuration module sets network isolation for different virtual machines among the N virtual machines. The network isolation strategy ensures that each virtual machine is independent during the test, avoiding possible mutual influences between virtual machines, such as resource competition and performance interference. This isolation not only improves the independence and accuracy of the test, but also enhances the security of the test environment, preventing the influence of test data leakage or external interference on the test results.

[0157] In an optional embodiment, when grouping and deploying the N virtual machines, network isolation is set between the virtual machines within different combinations.

[0158] For example, in the software testing of a distributed database, the system may divide the virtual machines into two groups: "client side" and "server side". The virtual machines within each group conduct data interaction tests, while inter-group communication is strictly restricted to simulate the network isolation environment in the actual usage scenario. This strategy not only tests the communication function of the software, but also verifies the stability and security of the software in an isolated network environment, which is of great significance for the security evaluation and performance optimization of the software.

[0159] In an optional embodiment, Figure 3A software testing apparatus based on virtual machines according to an embodiment of the present application includes: a first processing unit 301, a testing unit 302, a second processing unit 303, and a third processing unit 304.

[0160] Optionally, the first processing unit 301 is configured to deploy N virtual machines, where N is an integer greater than 1, and the initial system states of the N virtual machines are the same; the testing unit 302 is configured to perform X rounds of tests on the target software on the N virtual machines and record the test results of each round of tests, where X is an integer greater than or equal to 1; the second processing unit 303 is configured to adjust the configuration parameters of the virtual machines and / or adjust the configuration parameters of the target software according to the test results of each round of tests; the third processing unit 304 is configured to, after adjusting the configuration parameters of the virtual machines and / or the configuration parameters of the target software, reset the system states of the N virtual machines according to the latest configuration parameters of the virtual machines, and perform Y rounds of tests on the target software according to the latest configuration parameters of the target software on the N virtual machines that have been successfully reset, where Y is an integer greater than or equal to 1.

[0161] Optionally, the first processing unit 301 includes: a first processing subunit, configured to create virtual machine configuration information, where the virtual machine configuration information at least includes: N virtual machine instances corresponding to the N virtual machines, IP addresses corresponding to each virtual machine, network isolation states between different virtual machines, operating system information corresponding to the N virtual machines, and running environment information; a second processing subunit, configured to deploy the N virtual machines in a virtual network according to the virtual machine configuration information.

[0162] Optionally, the second processing unit 303 includes: a first determination subunit, configured to determine the type of software failure when detecting that the target software has a software failure in any round of the X rounds of tests according to the test results of each round of tests; and adjust the configuration parameters of the target software according to the type of software failure; a second determination subunit, configured to determine the performance information of K virtual machines during the X rounds of tests of the target software on the N virtual machines according to the test results of each round of tests, and adjust the configuration parameters of the virtual machines according to the performance information of the i-th virtual machine when detecting that the performance information of the i-th virtual machine does not meet the preset conditions, where i is an integer greater than or equal to 1 and less than or equal to K, K is an integer greater than or equal to 1, and the preset conditions represent a maximum threshold or a minimum threshold preset for the performance information of the i-th virtual machine.

[0163] Optionally, the K virtual machine performance information includes at least one of the following virtual machine performance information: network latency information of N virtual machines during X rounds of testing on the target software; processor utilization information of N virtual machines during X rounds of testing on the target software; memory utilization information of N virtual machines during X rounds of testing on the target software; disk data read speed and / or disk data write speed of N virtual machines during X rounds of testing on the target software; network bandwidth information of N virtual machines during X rounds of testing on the target software.

[0164] Optionally, the first determination subunit includes: a first determination module, configured to determine a software plug-in related to the software fault according to the type of the software fault; a first processing module, configured to update the version and code of the software plug-in until the software plug-in can run independently normally; a second processing module, configured to adjust the configuration parameters of the target software according to the updated software plug-in.

[0165] Optionally, the third processing unit 304 includes: a third processing subunit, configured to delete the temporary files generated by N virtual machines during X rounds of testing on the target software; a fourth processing subunit, configured to reset the system states of the N virtual machines according to the latest configuration parameters of the virtual machines after determining that the temporary files are successfully deleted, where the system states of the N virtual machines after resetting are the same.

[0166] Optionally, the first processing unit further includes: a fifth processing subunit, configured to perform grouped deployment on N virtual machines when the test of the target software involves testing the data communication function of the target software based on different devices, where each group includes at least two virtual machines, and different virtual machines within each group can communicate with each other; a sixth processing subunit, configured to set network isolation for different virtual machines among the N virtual machines when the test of the target software does not involve testing the data communication function of the target software based on different devices.

[0167] Optionally, the fifth processing subunit includes: a third processing module, configured to set network isolation between virtual machines in different groups when performing grouped deployment on N virtual machines.

[0168] According to another aspect of the present application, there is also provided a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program runs, it causes the device where the computer-readable storage medium is located to execute the above-mentioned software testing method based on virtual machines.

[0169] According to another aspect of the present application, an electronic device is further provided, including one or more processors and a memory for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the above-mentioned software testing method based on a virtual machine.

[0170] The serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0171] In the above-mentioned embodiments of the present application, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0172] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of units or modules can be in electrical or other forms.

[0173] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0174] In addition, the functional units in the various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0175] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs.

[0176] The above are only the preferred embodiments of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of this application.

Claims

1. A software testing method based on a virtual machine, characterized in that: include: Deploy N virtual machines, where N is an integer greater than 1, and the initial system states of the N virtual machines are the same; Performing X rounds of testing on the target software on the N virtual machines, and recording the test results of each round of testing, where X is an integer greater than or equal to 1; Adjusting the configuration parameters of the virtual machine and / or adjusting the configuration parameters of the target software according to the test results of each round of testing; After the configuration parameters of the virtual machine and / or the configuration parameters of the target software are adjusted, the system states of the N virtual machines are reset according to the latest configuration parameters of the virtual machine, and Y rounds of testing are performed on the target software according to the latest configuration parameters of the target software on the N virtual machines that have been successfully reset, where Y is an integer greater than or equal to 1.

2. The method according to claim 1, characterized in that: Deploy N virtual machines, including: Creating virtual machine configuration information, wherein the virtual machine configuration information at least includes: N virtual machine instances corresponding to the N virtual machines, an IP address corresponding to each virtual machine, a network isolation status between different virtual machines, operating system information corresponding to the N virtual machines, and operating environment information; The N virtual machines are deployed in the virtual network according to the virtual machine configuration information.

3. The method according to claim 1, characterized in that: Adjusting the configuration parameters of the virtual machine and / or adjusting the configuration parameters of the target software according to the test results of each round of testing includes: According to the test results of each round of testing, when it is detected that the target software has a software fault in any round of testing of the X rounds of testing, determining the type of the software fault; and adjusting the configuration parameters of the target software according to the type of the software fault; and / or; According to the test results of each round of testing, performance information of K virtual machines of the N virtual machines during the process of performing the X rounds of testing on the target software is determined, and when it is detected that the performance information of the i-th virtual machine does not meet the preset conditions, the configuration parameters of the virtual machine are adjusted according to the i-th virtual machine performance information, wherein i is an integer greater than or equal to 1 and less than or equal to K, K is an integer greater than or equal to 1, and the preset condition represents a maximum threshold or a minimum threshold preset for the performance information of the i-th virtual machine.

4. The method according to claim 3, characterized in that The K virtual machine performance information includes at least one of the following virtual machine performance information: Network delay information of the N virtual machines when performing the X rounds of testing on the target software; Processor utilization information of the N virtual machines when performing the X rounds of testing on the target software; Memory utilization information of the N virtual machines when performing the X rounds of testing on the target software; The disk data reading speed and / or disk data writing speed of the N virtual machines when performing the X rounds of testing on the target software; The network bandwidth information of the N virtual machines when performing the X rounds of testing on the target software.

5. The method according to claim 3, characterized in that: According to the type of the software fault, adjusting the configuration parameters of the target software includes: Determining a software plug-in related to the software failure according to the type of the software failure; Updating the version and code corresponding to the software plug-in until the software plug-in can run normally and independently; The configuration parameters of the target software are adjusted according to the updated software plug-in.

6. The method according to claim 1, characterized in that After the configuration parameters of the virtual machine and / or the configuration parameters of the target software are adjusted, resetting the system states of the N virtual machines according to the latest configuration parameters of the virtual machine includes: Deleting temporary files generated in the N virtual machines when performing the X rounds of testing on the target software; After determining that the temporary file is deleted successfully, the system states of the N virtual machines are reset according to the latest configuration parameters of the virtual machines, wherein the system states of the N virtual machines after the reset are the same.

7. The method according to claim 1, characterized in that Deploy N virtual machines, including: When the test process of the target software involves testing the data communication function of the target software based on different devices, the N virtual machines are grouped and deployed, wherein each group includes at least two virtual machines, and different virtual machines in each group can communicate and interact with each other; When the target software testing process does not involve testing the data communication function of the target software based on different devices, network isolation is set for different virtual machines among the N virtual machines.

8. The method according to claim 7, characterized in that The method further comprises: When the N virtual machines are deployed in groups, network isolation is set between virtual machines in different groups.

9. A software testing device based on a virtual machine, characterized in that: include: A first processing unit deploys N virtual machines, where N is an integer greater than 1, and the initial system states of the N virtual machines are the same; A testing unit, performing X rounds of testing on the target software on the N virtual machines, and recording the test results of each round of testing, where X is an integer greater than or equal to 1; A second processing unit, adjusting the configuration parameters of the virtual machine and / or adjusting the configuration parameters of the target software according to the test results of each round of testing; The third processing unit, after completing the adjustment of the configuration parameters of the virtual machine and / or the configuration parameters of the target software, resets the system states of the N virtual machines according to the latest configuration parameters of the virtual machine, and performs Y rounds of testing on the target software according to the latest configuration parameters of the target software on the N virtual machines that have been successfully reset, where Y is an integer greater than or equal to 1.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located executes the software testing method based on a virtual machine according to any one of claims 1 to 8.

11. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the virtual machine-based software testing method as described in any one of claims 1 to 8.