Testing method, testing device and testing system
By automatically determining the target testing software running on the computing device and selecting suitable testing tools, the problem of low testing accuracy in the prior art is solved, and a higher level of testing accuracy and automation is achieved.
Patent Information
- Application Number
- CN202410112150.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-25
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2044-01-25
AI Technical Summary
In the existing testing methods, there may be limitations in the testers' understanding of the test objects, which makes the selected testing tools unable to accurately simulate the load of the test objects, thereby reducing the accuracy of the test.
By determining the target testing software running on the computing device, the appropriate target testing tool is automatically selected from multiple test tools, and the target testing software is tested through the target testing tool, which avoids test tool selection errors caused by insufficient experience of testers.
Improve the accuracy of the selection of test tools, thereby improving the accuracy of the test, improving the degree of automation of the test equipment, and reducing the errors of manual intervention.
Smart Images

Figure CN118012753B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of servers, and in particular, to a testing method, a testing device, and a testing system. Background Art
[0002] Testing tools can be used to simulate the load of a test object. For example, the testing tool can be a stress testing tool (JMeter), or a command-line program (Apache Bench), etc., and the test object can be an operating system, or an application software, etc. When a testing device runs a testing tool, it can test the test object. For example, the testing device can be a server.
[0003] Currently, testers can select a corresponding testing tool for the test object according to experience, so as to simulate the load of the test object through the selected testing tool. However, the understanding of the test object by the testers may be limited, and the testing tool selected by the testers may not accurately simulate the load of the test object, resulting in low testing accuracy. Summary of the Invention
[0004] Embodiments of this application provide a testing method, a testing device, and a testing system to solve the technical problem of low testing accuracy.
[0005] In a first aspect, embodiments of this application provide a testing method, including:
[0006] Determine the target testing software running on the computing device; where the target testing software is the software to be stress-tested;
[0007] According to the target testing software, determine the target testing tool from multiple testing tools; where the target testing tool is the testing tool used to perform stress testing on the target testing software;
[0008] Test the target testing software through the target testing tool.
[0009] In the above solution, the testing device can automatically determine the target testing tool according to the target testing software, without the need for a tester to determine the target testing tool, avoiding the selection error of the testing tool caused by the lack of experience of the tester. Through the above solution, the selection accuracy of the testing tool can be improved, and thus the testing accuracy can be improved.
[0010] In a possible implementation, determining the target testing software running on the computing device includes:
[0011] Obtain the resource occupancy of multiple processes running on the computing device;
[0012] Determine the target testing software according to the resource occupancy of the multiple processes.
[0013] In the above solution, the target test software can be determined according to the resource occupation amounts of multiple processes running on the computing device, achieving the purpose of automatically determining the target test software.
[0014] In a possible implementation manner, determining the target test software according to the resource occupation amounts of multiple processes includes:
[0015] Determining multiple target processes among the multiple processes according to the resource occupation amounts of the multiple processes, where the resource occupation amounts of the multiple target processes are greater than or equal to a preset threshold;
[0016] Determining the target test software according to the multiple target processes.
[0017] In the above solution, the target test software can be determined according to the target processes with larger resource occupation amounts, achieving the purpose of automatically determining the target test software.
[0018] In a possible implementation manner, determining the target test software according to the multiple target processes includes:
[0019] Determining at least one process set among the multiple target processes, where the target processes in each process set are processes initiated for the same test object;
[0020] Determining the target test software according to the at least one process set and the corresponding relationship between the process set and the test object.
[0021] In the above solution, the process set can be determined according to the target processes, and the target test software can be determined according to the process set, achieving the purpose of automatically determining the target test software.
[0022] In a possible implementation manner, obtaining the resource occupation amounts of multiple processes running on the computing device includes:
[0023] Receiving the resource occupation amounts of the multiple processes sent by the computing device.
[0024] In the above solution, the resource occupation amounts of the multiple processes can be obtained from the computing device, achieving the purpose of obtaining the resource occupation amounts of the multiple processes.
[0025] In a possible implementation manner, testing the target test software through a target test tool includes:
[0026] Determining the running parameters of the target test tool;
[0027] Obtaining the first parameter value corresponding to the running parameters in the computing device, and generating a running configuration file for the target test tool according to the first parameter value;
[0028] Running the target test tool according to the running configuration file to test the target test software.
[0029] In the above solution, the first parameter value can be determined according to the running parameters of the target test tool, a running configuration file can be generated according to the first parameter value, and the target test tool can be run according to the running configuration file to test the target test software.
[0030] In a possible implementation, obtaining the first parameter value corresponding to the running parameter in the computing device and generating a running configuration file for the target test tool according to the first parameter value includes:
[0031] In the current running cycle, obtaining the first parameter value of the computing device in the previous running cycle;
[0032] If there is no existing running configuration file, generating a running configuration file according to the first parameter value;
[0033] If there is an existing running configuration file, updating the existing running configuration file according to the first parameter value to obtain a running configuration file.
[0034] In the above solution, the running configuration file can be dynamically updated according to the first parameter value. If the first parameter value changes, the test device can timely adjust the running parameters of the target test tool in the running configuration file, so that the target test tool can more accurately simulate the load of the target test software, improving the simulation accuracy of the target test tool, and further improving the test accuracy.
[0035] In a possible implementation, the method further includes:
[0036] Obtaining installation packages corresponding to multiple test tools, where the number of installation packages is less than the number of test tools;
[0037] Installing multiple test tools in the test device according to the installation packages.
[0038] In the above solution, the test device can install more test tools with fewer installation times, making the installation efficiency of the test tools higher.
[0039] In a second aspect, an embodiment of the present application provides a test device, including a determination module and a test module, where
[0040] The determination module is used to determine the target test software running on the computing device;
[0041] The determination module is further used to determine the target test tool from multiple test tools according to the target test software;
[0042] The test module is used to test the target test software through the target test tool.
[0043] In the above solution, the determination module can automatically determine the target test tool according to the target test software, without the need for testers to determine the target test tool, avoiding the selection error of the test tool caused by insufficient experience of testers. Through the above solution, the selection accuracy of the test tool can be improved, and thus the test accuracy can be improved.
[0044] In a possible implementation, the determination module is specifically used for
[0045] obtaining the resource occupancy of multiple processes running on the computing device;
[0046] determining the target test software according to the resource occupancy of the multiple processes.
[0047] In the above solution, the determination module can determine the target test software according to the resource occupancy of multiple processes running on the computing device, achieving the purpose of automatically determining the target test software.
[0048] In a possible implementation, the determination module is specifically used for
[0049] determining multiple target processes among the multiple processes according to the resource occupancy, where the resource occupancy of the multiple target processes is greater than or equal to a preset threshold;
[0050] determining the target test software according to the multiple target processes.
[0051] In the above solution, the determination module can determine the target test software according to the target processes with larger resource occupancy, achieving the purpose of automatically determining the target test software.
[0052] In a possible implementation, the determination module is specifically used for
[0053] determining at least one process set among the multiple target processes, where the target processes in each process set are processes initiated for the same test object;
[0054] determining the target test software according to the at least one process set and the corresponding relationship between the process set and the test object.
[0055] In the above solution, the determination module can determine the process set according to the target processes and can determine the target test software according to the process set, achieving the purpose of automatically determining the target test software.
[0056] In a possible implementation, the determination module is specifically used for
[0057] receiving the resource occupancy of multiple processes sent by the computing device.
[0058] In the above solution, the determination module can obtain the resource occupancy of multiple processes from a computing device, achieving the purpose of obtaining the resource occupancy of multiple processes.
[0059] In a possible implementation, the testing module is specifically used for
[0060] determining the running parameters of the target testing tool;
[0061] obtaining the first parameter value corresponding to the running parameters in the computing device, and generating a running configuration file for the target testing tool according to the first parameter value;
[0062] running the target testing tool according to the running configuration file to test the target testing software.
[0063] In the above solution, the testing module can determine the first parameter value according to the running parameters of the target testing tool, generate a running configuration file according to the first parameter value, and run the target testing tool according to the running configuration file to test the target testing software.
[0064] In a possible implementation, the testing module is specifically used for
[0065] obtaining the first parameter value of the computing device in the previous running cycle during the current running cycle;
[0066] if there is no existing running configuration file, generating a running configuration file according to the first parameter value;
[0067] if there is an existing running configuration file, updating the existing running configuration file according to the first parameter value to obtain the running configuration file.
[0068] In the above solution, the testing module can dynamically update the running configuration file according to the first parameter value. If the first parameter value changes, the testing device can timely adjust the running parameters of the target testing tool in the running configuration file, enabling the target testing tool to more accurately simulate the load of the target testing software, improving the simulation accuracy of the target testing tool, and further improving the testing accuracy.
[0069] In a possible implementation, the device further includes an installation module, and the installation module is used for
[0070] obtaining installation packages corresponding to multiple testing tools, and the number of installation packages is less than the number of testing tools;
[0071] installing multiple testing tools in the testing device according to the installation packages.
[0072] In the above solution, the testing device can install more testing tools with fewer installation times, resulting in a higher installation efficiency of the testing tools.
[0073] In a third aspect, an embodiment of the present application provides a test device, including a memory and a processor;
[0074] The memory and the processor are coupled;
[0075] The memory is used to store program instructions;
[0076] The processor is used to call the program instructions to execute the test method steps according to any one of the first aspects of the claims.
[0077] In the above solution, the test device can automatically determine the target test tool according to the target test software, without the tester determining the target test tool, avoiding the selection error of the test tool caused by the lack of experience of the tester. Through the above solution, the selection accuracy of the test tool can be improved, and thus the test accuracy can be improved.
[0078] In a fourth aspect, an embodiment of the present application provides a test system. The test system includes a computing device and the test device according to the third aspect, wherein the computing device is communicatively connected to the test device; the test device is used to perform load simulation on the computing device.
[0079] In the above solution, the test device can automatically determine the target test tool according to the target test software running on the computing device, without the tester determining the target test tool, avoiding the selection error of the test tool caused by the lack of experience of the tester. Through the above solution, the selection accuracy of the test tool can be improved, and thus the test accuracy can be improved.
[0080] For the test method, test device and test system provided by the embodiments of the present application, the test device can determine the target test software running on the computing device; can determine the target test tool from multiple test tools according to the target test software; and can test the target test software through the target test tool. In the above method, the test device can automatically determine the target test tool, without the tester determining the target test tool, avoiding the selection error of the test tool caused by the lack of experience of the tester. Through the above method, the selection accuracy of the test tool can be improved, and thus the test accuracy can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0082] Figure 1A schematic diagram of an application scenario provided by an embodiment of the present application;
[0083] Figure 2 A schematic structural diagram of a test system provided by an embodiment of the present application;
[0084] Figure 3 A schematic flowchart of a test method provided by an embodiment of the present application;
[0085] Figure 4 A schematic flowchart of another test method provided by an embodiment of the present application;
[0086] Figure 5 A schematic flowchart of yet another test method provided by an embodiment of the present application;
[0087] Figure 6 A schematic structural diagram of a test device provided by an embodiment of the present application;
[0088] Figure 7 A schematic structural diagram of another test device provided by an embodiment of the present application;
[0089] Figure 8 A schematic hardware structure diagram of a test device provided by an embodiment of the present application. Detailed implementation manners
[0090] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the embodiments of the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.
[0091] For ease of understanding, first, the technical terms related to the embodiments of the present application will be explained.
[0092] Pressure load: It refers to the degree of the workload borne by the system, that is, the demand and usage of system resources. The pressure load includes the utilization rate of the central processing unit (CPU), the occupancy rate of memory, the activities of disks and networks, etc. The level of the pressure load can reflect the load situation of the system. For system administrators, understanding the pressure load can help them monitor and optimize system performance.
[0093] World Wide Web (Web) applications: Services can be provided through the Hypertext Transfer Protocol (HTTP) or the HTTP over Secure Socket Layer (HTTPS) protocol for security purposes. Web applications are mainly used for websites, e-commerce platforms, blogs, etc. Web applications usually have functions such as user interfaces, database access, request processing, and responses.
[0094] Database applications: Mainly used for data storage and management. Database applications can be, for example, relational databases, non-relational databases (NoSQL), and data warehouses. For example, relational databases can be relational database management systems (such as MySQL) or free object-relational database servers (such as PostgreSQL); non-relational databases can be distributed document storage databases (such as MongoDB) or remote dictionary servers (Redis). Database applications can provide operations for adding, deleting, modifying, and querying data and support functions such as transaction processing.
[0095] Enterprise applications: Applications that serve the internal operation and management needs of enterprises. For example, enterprise applications can be enterprise resource planning (ERP) systems, customer relationship management (CRM) systems, or supply chain management systems. Enterprise applications usually involve functions such as cross-departmental collaboration, business process management, data sharing, and permission control.
[0096] Scientific computing and simulation applications: Applications used in fields such as scientific research, engineering simulation, or data analysis. For example, scientific computing and simulation applications can be weather prediction models or molecular dynamics simulations. Scientific computing and simulation applications usually require a large amount of computing resources and memory and run complex computing algorithms.
[0097] Big data applications: Applications used to process large amounts of structured and unstructured data. For example, data analysis, batch processing, real-time stream data processing, etc. Big data applications usually rely on distributed computing frameworks (such as Hadoop or Spark) or stream processing platforms (such as Kafka or Flink).
[0098] For ease of understanding, the application scenarios involved in the embodiments of the present application will be described below in conjunction with Figure 1 .
[0099] Figure 1 FIG. is a schematic diagram of an application scenario provided by an embodiment of the present application. Please refer to Figure 1 . In the test device, test tools can be installed. For example, the test device can be a computer, a server, etc., and the test tools can be JMeter, ApacheBench, Load Runner, or open source test tools (stress-ng), etc.
[0100] It should be noted that the number of test tools in the test device can be one or more. Figure 1 Taking the number of test tools in the test device being one as an example for illustration does not limit the technical solutions provided by the embodiments of the present application. Herein, "multiple" means two or more.
[0101] The test device can test the test object through the test tool. For example, the test object can be an operating system, an application software, etc.
[0102] Specifically, the test tool can be used to simulate the load of the test object. The test device can set the initial load amount of the test tool and can run the test tool after setting the initial load amount to test the performance, reliability, or stability, etc. of the test object.
[0103] It should be understood that the load types simulated by different test tools may be different. For any one test tool, there may be loads that cannot be simulated.
[0104] Exemplarily, stress-ng can be used to simulate various types of loads such as CPU, memory, disk, and network, but stress-ng cannot simulate the loads of web applications and databases, etc. LoadRunner can be used to simulate the loads of databases, web applications, and system applications and products (SPA), etc., but LoadRunner cannot simulate the loads of CPU, memory, disk, and network cards, etc. JMeter can be used to simulate the loads of web applications and databases, etc., but JMeter cannot simulate loads such as a large number of concurrent users.
[0105] Currently, testers can, based on experience, select corresponding test tools for the test object and run the test tools through the test equipment to test the test object. However, the understanding of the test object by testers may have limitations, and the test tools selected by testers may not accurately simulate the load of the test object, resulting in low test accuracy.
[0106] In view of this, embodiments of the present application provide a test method to solve the technical problem of low test accuracy.
[0107] In the test method provided by the embodiments of the present application, multiple test tools can be installed on the test equipment. The test equipment can select the test tool for testing the test object from multiple test tools according to the test object. In the above method, the test equipment can automatically select the test tool without the need for testers to select the test tool, avoiding the selection error of the test tool caused by the lack of experience of testers, improving the selection accuracy of the test tool, and thus improving the test accuracy.
[0108] In addition, in the test method provided by the embodiments of the present application, there is no need for manual selection of the test tool, and the test equipment can automatically select the test tool, making the selection efficiency of the test tool relatively high, and thus improving the test efficiency.
[0109] The technical solutions of the embodiments of the present application will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0110] For ease of understanding, first, in combination with Figure 2 , the test system involved in the embodiments of the present application will be described.
[0111] Figure 2 It is a schematic structural diagram of a test system provided by an embodiment of the present application. Please refer to Figure 2 , the test system may include a computing device and a test device. The computing device can be communicatively connected to the test device. The test device can be used to simulate the load on the computing device.
[0112] The computing device can be an electronic device in a production environment, and a target test software can run on the computing device.
[0113] The target test software can be the test software object to be tested. For example, the target test software can be the operating system to be tested, or the application software to be tested, etc.
[0114] The test device can be an electronic device in a test environment, and multiple test tools can be installed on the test device. For example, the multiple test tools can be Test Tool 1, Test Tool 2, ……, and Test Tool n, where n can be an integer greater than or equal to 2.
[0115] Both the computing device and the test device can be a computer, a server, or a server cluster, etc.
[0116] In one example, the computing device can be a server, and the test device can also be a server.
[0117] In this example, the test device can be used to simulate the load of the target test software on the computing device through the test tool to perform a stress test on the target test software. When testing the target test software, the load of the test device is consistent with the load of the computing device.
[0118] In this example, the target test software can be tested by a server, which reduces the test cost.
[0119] In another example, the computing device can be a server cluster, and the test device can be a server cluster. For the convenience of description below, the server cluster corresponding to the computing device is denoted as Server Cluster 1, and the server cluster corresponding to the test device is denoted as Server Cluster 2.
[0120] In this example, Server Cluster 2 can be used to simulate the load of the target test software on Server Cluster 1 through the test tools in Server Cluster 2 to test the target test software. When testing the target test software, it can be ensured that the total load of Server Cluster 2 is consistent with the total load of Server Cluster 1, without the need to ensure that the load of any server in Server Cluster 2 is consistent with the load of the corresponding server in Server Cluster 1, which provides higher test flexibility.
[0121] For example, assume that Server Cluster 2 includes Server 21, Server 22, and Server 23, and Server Cluster 1 includes Server 11, Server 12, and Server 13. When testing the target test software, it can be ensured that the total load of Server 21, Server 22, and Server 23 is consistent with the total load of Server 11, Server 12, and Server 13, without the need to ensure that the load of any server in Server Cluster 2 is consistent with the load of the corresponding server in Server Cluster 1.
[0122] Next, in combination with Figure 3 , the test method provided by the embodiments of the present application will be described.
[0123] Figure 3The flowchart of a test method provided by an embodiment of this application. The execution subject of this method can be a test device. Specifically, each step of this method can be executed by a processor in the test device. Please refer to Figure 3 , this method may include:
[0124] S301. Determine the target test software running on the computing device.
[0125] The target test software can be the test object to be tested. For example, the target test software can be the operating system to be tested, or the application software to be tested, etc.
[0126] The computing device can be an electronic device used to run the target test software in the production environment. For example, the computing device can be the computing device in the test system shown in Figure 2 .
[0127] In an implementable manner, the test device can obtain the resource occupancy of multiple processes running on the computing device; and determine the target test software according to the resource occupancy of the multiple processes.
[0128] The resource occupancy can be the CPU occupancy, or the memory occupancy, etc.
[0129] The process can be a system process of the computing device, or a process initiated by the target test software running on the computing device.
[0130] It should be noted that when the object type of the test object is different, the processes initiated by the test object are different. That is to say, when the object type of the target test software running on the computing device is different, the processes running on the computing device are different. Among them, for any test object, the number of processes initiated by the test object can be one or more.
[0131] The object type of the test object can be Web application type, database application type, enterprise application type, scientific computing and simulation application type, and big data application type, etc.
[0132] It should be understood that if the object type of the test object is Web application type, the test object can be a Web application; if the object type of the test object is database application type, the test object can be a database application; if the object type of the test object is enterprise application type, the test object can be an enterprise application; if the object type of the test object is scientific computing and simulation application type, the test object can be a scientific computing and simulation application; if the object type of the test object is big data application type, the test object can be a big data application.
[0133] The process can be an Apache (apache HTTP server, apache) process, the main program of the Hypertext Transfer Protocol server (httpd) process, or the Hypertext Transfer Protocol and reverse proxy Web server (nginx) process, etc.
[0134] Exemplarily, assuming that the target test software running on the computing device is a Web application, the processes running on the computing device can include an apache process, an httpd process, and an nginx process, etc.
[0135] It should be noted that the resource occupancy of the system processes of the computing device is less, and the resource occupancy of the processes initiated by the target test software is greater.
[0136] Exemplarily, the test device can obtain the resource occupancies of M processes running on the computing device, can determine N processes with greater resource occupancies according to the resource occupancies of the M processes, and can determine the target test software according to the N processes with greater resource occupancies, where M≥N.
[0137] Specifically, the test object corresponding to the process with greater resource occupancy can be determined as the target test software.
[0138] S302. Determine a target test tool from multiple test tools according to the target test software.
[0139] In this embodiment, multiple test tools can be installed in the test device. For example, the test tools can be JMeter, LoadRunner, Apache Bench, and stress-ng, etc. Different test tools can be used to simulate the loads of different test objects. For example, Apache Bench can be used to simulate the load of a Web application.
[0140] In this embodiment, the target test software can run on the computing device in the production environment, and the target test tool can be installed on the test device in the test environment. The test device can simulate the load of the target test software through the target test tool and can run the target test tool to test the target test software.
[0141] In this embodiment, the mapping relationship between the test object and the test tool can be preset, and the target test tool can be determined according to the mapping relationship between the test object and the test tool and the target test software.
[0142] The mapping relationship between the test object and the test tool can include multiple test objects and the test tool corresponding to each test object.
[0143] Exemplarily, the mapping relationship between the test object and the test tool can be as shown in Table 1:
[0144] Table 1
[0145] Test Object Test Tool Web Application Apache Bench Database Application LoadRunner …… ……
[0146] In the specific implementation process, the target test software can be searched in the mapping relationship between the test object and the test tool, and the test tool corresponding to the target object can be determined as the target test tool. For example, if the target test software is a Web application and the mapping relationship between the test object and the test tool is as shown in Table 1, the test device can determine that the target test tool is Apache Bench.
[0147] Optionally, in this embodiment, the test device can also obtain installation packages corresponding to multiple test tools, and the number of installation packages is less than the number of test tools; and install multiple test tools in the test device according to the installation packages.
[0148] Specifically, in this embodiment, multiple test tools can be integrated so that the number of installation packages corresponding to the multiple test tools is less than the number of test tools. The test device can install more test tools with fewer installation times, resulting in a higher installation efficiency of the test tools.
[0149] Optionally, multiple test tools can be integrated so that the number of installation packages corresponding to the multiple test tools is one. The test device can install multiple test tools through one installation, resulting in a higher installation efficiency of the test tools.
[0150] S303. Test the target test software through the target test tool.
[0151] In this embodiment, after the test device determines the target test tool, it can run the target test tool to test the target test software.
[0152] For the test method provided in this embodiment, the test device can determine the target test software running on the computing device; can determine the target test tool from multiple test tools according to the target test software; and can test the target test software through the target test tool. In the above method, the test device can automatically determine the target test tool without the tester determining the target test tool, avoiding the selection error of the test tool caused by the lack of experience of the tester. Through the above method, the selection accuracy of the test tool can be improved, and thus the test accuracy can be improved.
[0153] Based on the above embodiment, the test device can also generate a running configuration file of the target test tool according to the running parameter value of the target test software in the production environment, so as to run the target test tool according to the running configuration file. Next, in combination with Figure 4, the test method provided by the embodiments of the present application will be further described.
[0154] Figure 4 It is a schematic flowchart of another test method provided by the embodiments of the present application. The execution subject of this method can be a test device. Specifically, each step of this method can be executed by a processor in the test device. Please refer to Figure 4 , this method may include:
[0155] S401. Obtain the resource occupancy of multiple processes running on the computing device.
[0156] In this embodiment, the test device and the computing device can be communicatively connected. The test device can receive the resource occupancy of multiple processes sent by the computing device.
[0157] Specifically, the computing device can collect the resource occupancy of multiple processes running on the computing device, and can send the resource occupancy of multiple processes to the test device, so that the test device can obtain the resource occupancy of multiple processes running on the computing device.
[0158] S402. Determine multiple target processes among the multiple processes according to the resource occupancy of the multiple processes.
[0159] The resource occupancy of the multiple target processes is greater than or equal to a preset threshold.
[0160] The preset threshold can be set according to actual needs, and this embodiment does not limit this.
[0161] In this embodiment, after the test device obtains the resource occupancy of multiple processes running on the computing device, it can determine the processes with resource occupancy greater than or equal to the preset threshold as target processes.
[0162] S403. Determine the target test software according to the multiple target processes.
[0163] In this embodiment, the test device can determine at least one process set among the multiple target processes, and the target processes in each process set are processes initiated by the same test object; according to the at least one process set and the corresponding relationship between the process set and the test object, determine the target test software.
[0164] The corresponding relationship between the process set and the test object may include multiple test objects and the process set corresponding to each test object.
[0165] Exemplarily, the corresponding relationship between the process set and the test object can be as shown in Table 2:
[0166] Table 2
[0167] Test Object Process Set Test Object 1 Process Set 1 Test Object 2 Process Set 2 …… …… Test Object m Process Set m
[0168] As shown in Table 2, the process set corresponding to Test Object 1 can be Process Set 1, the process set corresponding to Test Object 2 can be Process Set 2, …, and the process set corresponding to Test Object m can be Process Set m.
[0169] Specifically, multiple target processes can be grouped, so that the target processes initiated by the same target test software are grouped into the same process set; the process set obtained by the grouping process can be searched in the correspondence between the process set and the test object; and the test object corresponding to the process set obtained by the grouping process in the correspondence between the process set and the test object can be determined as the target test software.
[0170] Exemplarily, assuming that the correspondence between the process set and the test object is as shown in Table 2, and assuming that the test device can obtain Process Set 1 by grouping multiple target processes, the test device can determine the target test software as Test Object 1.
[0171] It should be noted that if multiple process sets are obtained by grouping multiple target processes, a target test software can be determined according to each process set, and multiple target test softwares can be obtained. Among them, multiple can be two or more.
[0172] S404. Determine a target test tool from multiple test tools in the test device according to the target test software.
[0173] It should be noted that the specific implementation manner of S404 can refer to S302, which will not be elaborated here.
[0174] S405. Determine the running parameters of the target test tool.
[0175] It should be noted that the running parameters of different test tools are different. For example, the running parameter of Test Tool 1 can be the number of business requests, and the running parameters of Test Tool 2 can be the number of network requests and the number of concurrent requests.
[0176] In this embodiment, the correspondence between the test tool and the running parameters can be set in advance. In the specific implementation process, the target test tool can be searched in the correspondence between the test tool and the running parameters, and the running parameters corresponding to the target test tool in the correspondence between the test tool and the running parameters can be determined as the running parameters of the target test tool.
[0177] S406. Obtain the first parameter value corresponding to the running parameter from the computing device, and generate a running configuration file for the target test tool according to the first parameter value.
[0178] The first parameter value can be the parameter value corresponding to the running parameter of the target test software in the computing device. For example, if the running parameter is the number of business requests, the first parameter value can be the specific value of the number of business requests in the computing device.
[0179] The running configuration file can include the running parameters of the target test tool and the parameter values corresponding to the running parameters.
[0180] In this embodiment, the test device can periodically obtain the first parameter value corresponding to the running parameter, and can generate or update the running configuration file according to the first parameter value.
[0181] Specifically, the test device can obtain the first parameter value of the computing device in the previous running cycle in the current running cycle; if there is no existing running configuration file, generate a running configuration file according to the first parameter value; if there is an existing running configuration file, update the existing running configuration file according to the first parameter value to obtain the running configuration file. It should be understood that the number of running parameters can be one or more, and this embodiment does not limit this. If the number of running parameters is multiple, the test device can obtain the first parameter value corresponding to each running parameter of the computing device in the previous running cycle in the current running cycle.
[0182] In this embodiment, there may or may not be an existing running configuration file in the test device. According to the above different situations, generating the running configuration file of the target test tool according to the first parameter value can include the following two situations:
[0183] Situation 1: There is no existing running configuration file in the test device.
[0184] The existing running configuration file can be the generated running configuration file.
[0185] In this case, the currently obtained first parameter value can be the initial parameter value, and the test device can generate the running configuration file of the target test tool according to the first parameter value.
[0186] Specifically, the test device can generate a running configuration file and can set the parameter value corresponding to the running parameter in the running configuration file to be the same as the first parameter value.
[0187] Situation 2: There is an existing running configuration file in the test device.
[0188] In this case, the currently obtained first parameter value is a non-initial parameter value, and the test device can update the existing running configuration file according to the first parameter value to obtain the running configuration file.
[0189] Specifically, the test device can compare the first parameter value with the parameter value corresponding to the operating parameter in the existing operating configuration file.
[0190] If the first parameter value is the same as the parameter value corresponding to the operating parameter in the existing operating configuration file, the test device may not modify the parameter value corresponding to the operating parameter in the existing operating configuration file. The operating configuration file can be the same as the existing operating configuration file.
[0191] If the first parameter value is different from the parameter value corresponding to the operating parameter in the existing operating configuration file, the test device can update the parameter value corresponding to the operating parameter in the existing operating configuration file to the first parameter value to obtain the operating configuration file.
[0192] In the specific implementation process, if the first parameter value is less than the parameter value corresponding to the operating parameter in the existing operating configuration file, the test device can reduce the parameter value corresponding to the operating parameter in the operating configuration file so that the parameter value corresponding to the operating parameter in the operating configuration file is equal to the first parameter value. If the first parameter value is greater than the parameter value corresponding to the operating parameter in the existing operating configuration file, the test device can increase the parameter value corresponding to the operating parameter in the operating configuration file so that the parameter value corresponding to the operating parameter in the operating configuration file is equal to the first parameter value; or, the test device can add a new process through the target test tool to increase the parameter value corresponding to the operating parameter in the operating configuration file, so that the parameter value corresponding to the operating parameter in the operating configuration file is equal to the first parameter value.
[0193] In this embodiment, the test device can dynamically update the operating configuration file of the target test tool. If the first parameter value of the target test software changes, the test device can timely adjust the operating parameters of the target test tool, so that the target test tool can more accurately simulate the load of the target test software, improving the simulation accuracy of the target test tool, and thus improving the test accuracy.
[0194] S407. Run the target test tool according to the operating configuration file to test the target test software.
[0195] In this embodiment, the test device can run the target test tool according to the operating configuration file according to the test duration to test the target test software.
[0196] The test duration can be set according to actual needs, and this embodiment does not limit the test duration.
[0197] In the test method provided in this embodiment, the test device can obtain the resource occupancy of multiple processes running on the computing device; it can determine multiple target processes among the multiple processes according to the resource occupancy of the multiple processes; it can determine the target test software according to the multiple target processes; it can determine the target test tool among multiple test tools in the test device according to the target test software; it can determine the running parameters of the target test tool; it can obtain the first parameter value corresponding to the running parameters from the computing device and generate a running configuration file for the target test tool according to the first parameter value; it can run the target test tool according to the running configuration file to test the target test software. In the above method, the test device can automatically determine the target test tool according to the resource occupancy of multiple processes, without the need for testers to determine the target test tool, avoiding the selection error of the test tool caused by insufficient experience of testers, improving the selection accuracy of the test tool, and further improving the test accuracy. In addition, in the above method, the test device can dynamically update the running configuration file of the target test tool to timely adjust the running parameters of the target test tool, so that the target test tool can more accurately simulate the load of the target test software, improving the simulation accuracy of the target test tool and further improving the test accuracy.
[0198] An embodiment of the present application further provides a test system. The test system may include a computing device and a test device, where
[0199] The computing device can be used to collect the resource occupancy of multiple processes running on the computing device and send the resource occupancy of the multiple processes to the test device;
[0200] The test device can be used to execute the test method provided in any of the above method embodiments to test the target test software.
[0201] The test system provided in this embodiment can be used to execute the test method shown in the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0202] Next, in combination with Figure 5 , a method for testing the above test system will be described.
[0203] Figure 5 It is a schematic flowchart of another test method provided in an embodiment of the present application. Please refer to Figure 5 , this method may include:
[0204] S501. The computing device collects the resource occupancy of multiple processes running on the computing device.
[0205] In this embodiment, a collection module may be set on the computing device, and the collection module can be used to collect the resource occupancy of multiple processes.
[0206] The acquisition module can be a system activity reporter (SAR) tool, a virtual memory statistics (vmstat) tool, a resource monitoring (top) tool, or a third-party performance monitoring tool, etc.
[0207] Optionally, after the acquisition module acquires the resource occupation amounts of multiple processes, it can store the resource occupation amounts of the multiple processes. For example, the acquisition module can store the resource occupation amounts of multiple processes into a preset file or a preset database.
[0208] S502. The computing device sends the resource occupation amounts of multiple processes to the test device.
[0209] In this embodiment, a sending module can also be set on the computing device. The computing device can send the resource occupation amounts of multiple processes to the test device through the sending module.
[0210] S503. The test device determines multiple target processes among the multiple processes according to the resource occupation amounts of the multiple processes.
[0211] S504. The test device determines a target test software according to the multiple target processes.
[0212] S505. The test device determines a target test tool from multiple test tools according to the target test software.
[0213] S506. The test device determines the running parameters of the target test tool.
[0214] It should be noted that the specific implementation manners of S503 - S506 can refer to S402 - S405, which will not be elaborated here.
[0215] S507. The test device sends the running parameters to the computing device.
[0216] In this embodiment, after the test device determines the running parameters of the target test tool, it can send the running parameters to the computing device so that the computing device can collect data according to the running parameters.
[0217] S508. The computing device collects the first parameter value corresponding to the running parameter in the computing device.
[0218] In this embodiment, the computing device can also collect the first parameter value corresponding to the running parameter through the acquisition module. Specifically, the computing device can periodically collect the first parameter value according to a preset period.
[0219] The preset period can be the acquisition period pre-set by the user. Optionally, the computing device can include a command-line interface, and the acquisition period set by the user can be obtained through the command-line interface.
[0220] S509. The computing device sends the first parameter value to the test device.
[0221] S510. The test device generates a running configuration file for the target test tool according to the first parameter value.
[0222] S511. The test device runs the target test tool according to the running configuration file to test the target test software.
[0223] It should be noted that the specific implementation manners of S510 - S511 can refer to S406 - S407, which will not be elaborated here.
[0224] In the test method provided in this embodiment, the computing device can collect the resource occupation amounts of multiple processes running on the computing device, and send the resource occupation amounts of the multiple processes to the test device. The test device can determine the target test software according to the resource occupation amounts of the multiple processes, can determine the target test tool according to the target test software, can determine the running parameters according to the target test tool, and can send the running parameters to the computing device. The computing device can periodically collect the first parameter value corresponding to the running parameters according to the running parameters, and send the first parameter value to the test device. The test device can generate a running configuration file according to the first parameter value, and can run the target test tool according to the running configuration file to test the target test software. Through the above method, the test device can automatically determine the target test tool, and can dynamically update the running configuration file of the target test tool, so that the target test tool can more accurately simulate the load of the target test software, improving the simulation accuracy of the target test tool and further improving the test accuracy.
[0225] Figure 6 It is a structural diagram of a test device provided in an embodiment of the present application. The test device 10 can include a determination module 11 and a test module 12, where,
[0226] The determination module 11 is used to determine the target test software running on the computing device;
[0227] The determination module 11 is further used to determine the target test tool from multiple test tools according to the target test software;
[0228] The test module 12 is used to test the target test software through the target test tool.
[0229] The test device provided in this embodiment can be used to execute the test method shown in the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0230] In a possible implementation, the determining module 11 is specifically configured to,
[0231] Obtain the resource occupancy of multiple processes running on the computing device;
[0232] Determine the target test software according to the resource occupancy of the multiple processes.
[0233] In a possible implementation, the determining module 11 is specifically configured to,
[0234] Determine multiple target processes among the multiple processes according to the resource occupancy of the multiple processes, where the resource occupancy of the multiple target processes is greater than or equal to a preset threshold;
[0235] Determine the target test software according to the multiple target processes.
[0236] In a possible implementation, the determining module 11 is specifically configured to,
[0237] Determine at least one process set among the multiple target processes, where the target processes in each process set are processes initiated for the same test object;
[0238] Determine the target test software according to the at least one process set and the corresponding relationship between the process set and the test object.
[0239] In a possible implementation, the determining module 11 is specifically configured to,
[0240] Receive the resource occupancy of multiple processes sent by the computing device.
[0241] In a possible implementation, the testing module 12 is specifically configured to,
[0242] Determine the running parameters of the target test tool;
[0243] Obtain the first parameter value corresponding to the running parameters in the computing device, and generate a running configuration file for the target test tool according to the first parameter value;
[0244] Run the target test tool according to the running configuration file to test the target test software.
[0245] In a possible implementation, the testing module 12 is specifically configured to,
[0246] Obtain the first parameter value of the computing device in the previous running cycle during the current running cycle;
[0247] If there is no existing running configuration file, generate a running configuration file according to the first parameter value;
[0248] If there is an existing running configuration file, update the existing running configuration file according to the first parameter value to obtain a running configuration file.
[0249] Figure 7 This is the structural intention of another testing device provided by an embodiment of the present application. Figure 6 On this basis, the testing device 10 may include an installation module 13, and the installation module 13 is used to
[0250] Obtain installation packages corresponding to multiple testing tools, and the number of installation packages is less than the number of testing tools;
[0251] Install multiple testing tools in the testing device according to the installation packages.
[0252] The testing device provided in this embodiment can be used to execute the testing method shown in the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0253] Figure 8 This is a schematic hardware structure diagram of a testing device provided by an embodiment of the present application. Please refer to Figure 8 , the testing device 20 includes a memory 21 and a processor 22;
[0254] The memory 21 and the processor 22 are coupled;
[0255] The memory 21 is used to store program instructions;
[0256] The processor 22 is used to call the program instructions to execute the steps of the testing method in any of the above method embodiments.
[0257] Exemplarily, the processor 22 and the memory 21 communicate through a bus 23, the memory 21 is used to store computer execution instructions, and the processor 22 is used to call the computer execution instructions in the memory 21 to execute the testing method shown in any of the above method embodiments.
[0258] Optionally, the testing device 20 may further include a communication interface, and the communication interface may include a transmitter and / or a receiver.
[0259] Optionally, the above-mentioned processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in conjunction with the present application may be directly embodied as being executed and completed by a hardware processor, or may be executed and completed by a combination of hardware and software modules in the processor.
[0260] The test device provided in this embodiment can be used to execute the test method shown in the above method embodiment. The implementation principle and technical effect are similar and will not be elaborated here.
[0261] The embodiment of the present application also provides a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When the computer-executable instructions are executed by a processing chip, they can be used to execute the test method shown in the above method embodiment. The implementation principle and technical effect are similar and will not be elaborated here.
[0262] All or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a readable memory. When the program is executed, it executes the steps including the above method embodiments; and the foregoing memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.
[0263] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable terminal device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable terminal device generate a device for implementing the specified function in one process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0264] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one or more processes and / or blocks Figure 1 in one or more processes and / or blocks Figure 1 specified in one or more blocks.
[0265] These computer program instructions can also be loaded onto a computer or other programmable terminal device, such that a series of operation steps are performed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes and / or blocks Figure 1 in one or more processes and / or blocks Figure 1 specified in one or more blocks.
[0266] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of the embodiments of this application. Thus, if these modifications and variations of the embodiments of this application fall within the scope of the claims of this application and their equivalent technologies, the embodiments of this application are also intended to include these modifications and variations.
[0267] In the embodiments of this application, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, article or device comprising such element. The term "or" and its variants may refer to "and / or". In the embodiments of this application, terms such as "first", "second", etc. are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In the embodiments of this application, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0268] Other embodiments of the present application will be readily contemplated by those skilled in the art after considering the specification and the invention disclosed in practice. The embodiments of the present application are intended to cover any variations, uses, or adaptations of the embodiments of the present application, which follow the general principles of the embodiments of the present application and include the common general knowledge or conventional technical means in the technical field not disclosed in the embodiments of the present application.
Claims
1. A testing method, characterized in that: include: receiving resource usage of multiple processes sent by a computing device; Determine a plurality of target processes from the plurality of processes according to the resource occupation amounts of the plurality of processes, wherein the resource occupation amounts of the plurality of target processes are greater than or equal to a preset threshold; Determine at least one process set among the multiple target processes, wherein the target processes in each process set are processes initiated by the same test object; Determine the target test software running on the computing device according to the at least one process set and the correspondence between the process set and the test object; wherein the target test software is the software to be stress tested; According to the target test software, determining a target test tool from a plurality of test tools; wherein the target test tool is a test tool used to perform stress testing on the target test software; Determining operating parameters of the target test tool; In the current operation cycle, obtaining a first parameter value corresponding to the operation parameter of the computing device in the previous operation cycle; if there is no existing operation configuration file, generating the operation configuration file according to the first parameter value; if there is an existing operation configuration file, updating the existing operation configuration file according to the first parameter value to obtain the operation configuration file; The target test tool is run according to the run configuration file to test the target test software.
2. The method according to claim 1, characterized in that The method further comprises: Obtain installation packages corresponding to the multiple test tools, the number of the installation packages being less than the number of the test tools; The plurality of test tools are installed in a test device according to the installation package.
3. A testing device, characterized in that: including memory and processor; The memory is coupled to the processor; The memory is used to store program instructions; The processor is used to call the program instructions to execute the test method steps as described in any one of claims 1-2.
4. A testing system, characterized in that: The test system comprises a computing device and a test device as claimed in claim 3, wherein the computing device is communicatively connected to the test device; and the test device is used to perform load simulation on the computing device.
Citation Information
Patent Citations
An automatic testing method for monitoring and judging that the CPU occupation of an application process is too high and giving an alarm
CN109982144A
Test software framework building method and device, equipment and storage medium
CN114356767A
Test management method, platform, medium and equipment
CN117056218A