A system function test method, device, equipment and medium
By obtaining functional description interfaces from automated scripts and using a matching bus to find the optimal interface, the problem of low testing efficiency caused by compatibility differences between different testing tools is solved. This enables efficient selection and encapsulation adaptation of automated testing tools, thereby improving testing efficiency and system development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2022-05-31
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, the compatibility differences between different tools in automated testing systems require test engineers to spend a lot of energy on selecting and packaging tools for adaptation, making it difficult for them to focus on the system's own business logic and reducing testing efficiency and effectiveness.
The function description interface is obtained from the matching bus automation script. The function information of the function to be tested is determined by the matching bus. Based on the function information and the matching information defined in the preset function set, the optimal interface is matched from all the tool description interfaces. The automated testing tool corresponding to the optimal interface is used to perform the test and return the test results.
The elimination of the need for manual packaging and tool adaptation improves testing efficiency, allowing developers to focus more on performance analysis, optimization, and in-depth vulnerability discovery, thereby enhancing both testing and system development efficiency.
Smart Images

Figure CN114996133B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of system testing, and in particular to a system function testing method, apparatus, equipment, and medium. Background Technology
[0002] A complex automated testing system may include various test types, such as API (Application Program Interface) performance testing, hardware performance testing, and fault testing, each relying on different testing tools. Due to the wide variety of testing tools, their differing functionalities, and significant variations in command formats and configuration methods, even different versions of the same testing tool can exhibit substantial differences, posing challenges to the development of automated scripts. For the same business scenario, changing or upgrading testing tools can lead to incompatibility issues with existing automated scripts. This forces test engineers to spend considerable time on the selection, encapsulation, and adaptation of testing tools, making it difficult to focus on the system's core business logic and ultimately reducing testing efficiency and effectiveness.
[0003] As can be seen from the above, in the process of testing automated testing systems, how to avoid the situation where the system's functions under test are incompatible with the testing tools, resulting in low system testing efficiency, is a problem that needs to be solved in this field. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a system function testing method, apparatus, device, and medium that can automatically match the corresponding testing tools according to the function under test, without the need for manual packaging and adaptation of tools one by one, thus greatly improving testing efficiency. The specific solution is as follows:
[0005] Firstly, this application discloses a system function testing method, including:
[0006] Obtain the function description interface from the preset automation script, and send the function description interface to the matching bus;
[0007] The matching bus is used to determine the functional information of the function to be tested in the functional description interface, and based on the functional information and the matching information defined in the preset functional set, the optimal interface is matched from all the current tool description interfaces.
[0008] The function to be tested is tested using the automated testing tool corresponding to the optimal interface, and the test results are returned to the automated script.
[0009] Optionally, determining the functional information of the function to be tested in the functional description interface includes:
[0010] Determine the function type, function name, running parameters, environment configuration parameters, indicator requirements, and matching options of the function to be tested in the function description interface.
[0011] Optionally, the matching of the optimal interface from all current tool description interfaces based on the functional information and the matching information defined in the preset functional set includes:
[0012] Based on the function type of the function to be tested, match the first tool interface set from all current tool description interfaces;
[0013] Based on the matching information between the function name of the function to be tested and the preset function set, the second tool interface set is determined from the first tool interface set.
[0014] The optimal interface is determined from the second set of tool interfaces using a preset optimal matching method.
[0015] Optionally, determining the first tool interface set from all current tool description interfaces based on the function type in the function information includes:
[0016] Traverse all current tool description interfaces to determine the testable function type corresponding to the current tool description interface from the function tree in each tool description interface;
[0017] The testable function types corresponding to each of the tool description interfaces are matched with the function type of the function to be tested to determine a first tool interface set based on all the current tool description interfaces; wherein, the testable function types corresponding to the tool description interfaces in the first tool interface set all contain the function type of the function to be tested.
[0018] Optionally, determining the second tool interface set from the first tool interface set based on the matching information corresponding to the function name of the function to be tested within a preset function set includes:
[0019] Determine the matching information between the preset function set and the function name of the function to be tested; wherein, the matching information includes the running parameters, environment configuration parameters and performance indicators corresponding to the function type of the function to be tested;
[0020] The matching information is used to match the corresponding information in each tool description interface of the first tool interface set, and the tool description interfaces with inconsistent matching results are removed from the first tool interface set to generate a second tool interface set.
[0021] Optionally, determining the optimal interface from the second tool interface set using a preset optimal matching method includes:
[0022] Determine the number of interfaces in the second tool interface set;
[0023] If the number of interfaces in the second tool interface set is greater than 1, then the preset matching options are compared with the corresponding matching options in each of the second tool interface sets to determine the optimal interface from the second tool interface set.
[0024] If the number of interfaces in the second tool interface set is 1, then the corresponding tool description interface in the second tool interface set is determined as the optimal interface.
[0025] Optionally, testing the function under test using the automated testing tool corresponding to the optimal interface includes:
[0026] The function to be tested is tested using the pre-configured configuration and execution methods in the automated testing tool corresponding to the optimal interface.
[0027] Secondly, this application discloses a system function testing device, comprising:
[0028] The function description interface acquisition module is used to acquire the function description interface from the preset automation script and send the function description interface to the matching bus;
[0029] The tool description interface matching module is used to determine the functional information of the function to be tested in the functional description interface using the matching bus, and to match the optimal interface from all the current tool description interfaces based on the functional information and the matching information defined in the preset functional set.
[0030] The functional testing module is used to test the function under test using the automated testing tool corresponding to the optimal interface, and return the test results to the automated script.
[0031] Thirdly, this application discloses an electronic device, including:
[0032] Memory, used to store computer programs;
[0033] A processor is used to execute the computer program to implement the aforementioned system function testing method.
[0034] Fourthly, this application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed system function testing method.
[0035] This application first obtains the function description interface from a preset automation script and sends the function description interface to a matching bus. Then, the matching bus is used to determine the function information of the function to be tested in the function description interface. Based on the function information and the matching information defined in the preset function set, the optimal interface is matched from all the current tool description interfaces. Finally, the automated testing tool corresponding to the optimal interface is used to test the function to be tested, and the test result is returned to the automation script. In this way, this application uses the matching bus to automatically match the optimal tool description interface based on the function information of the function to be tested in the function description interface of the automation script, so as to complete the test of the function to be tested according to the automated testing tool corresponding to the optimal tool description interface, and finally return the test result to the automation script. In the system function testing method of this application, developers only need to follow the information provided in the function set to write the function information of the function to be tested into the function description interface in the automated script, and they can directly obtain the test results in the script. When there are multiple different types of functions to be tested, there is no need to manually encapsulate and adapt tools one by one, which greatly reduces the time for selecting and encapsulating test tools in functional testing, thereby improving testing efficiency and allowing developers to devote more energy to performance analysis, optimization, and in-depth vulnerability discovery. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0037] Figure 1 A flowchart of a system function testing method provided in this application;
[0038] Figure 2 A system framework diagram provided for this application;
[0039] Figure 3 A flowchart of a specific system function testing method provided in this application;
[0040] Figure 4 A schematic diagram of a tool matching process provided in this application;
[0041] Figure 5 A schematic diagram of a system function testing device provided in this application;
[0042] Figure 6 This application provides a structural diagram of an electronic device. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] In existing technologies, for the same business scenario, changing testing tools or upgrading existing versions of testing tools often leads to incompatibility issues with existing automated scripts. This forces test engineers to spend considerable time on selecting, packaging, and adapting testing tools, making it difficult for them to focus on the system's own business logic and reducing testing efficiency and effectiveness. This application addresses this by automatically matching the appropriate testing tool to the function under test, eliminating the need for manual packaging and adaptation of each tool, thus significantly improving testing efficiency.
[0045] This invention discloses a system function testing method, see [link to relevant documentation]. Figure 1 The method includes:
[0046] Step S11: Obtain the function description interface from the preset automation script and send the function description interface to the matching bus.
[0047] In this embodiment, the function description interface is provided by the automation script, and the function description interface can describe the functions, capabilities, and metrics required by the test command from the perspective of business requirements. Through the function description interface, the automation script can complete the required test content without paying attention to specific automation testing tools and command formats.
[0048] The functional description interface described in this embodiment may include the following information:
[0049] 1. Function Type. The function type specifies the category of the test function to be implemented, such as network testing, hard disk testing, memory testing, API performance testing, fault testing, etc. This is a required information item.
[0050] 2. Function Name. The function name specifies the specific test function to be implemented, such as network latency test, network jitter test, network packet loss test, hard disk read / write test, etc. This is a required information item.
[0051] 3. Runtime Parameters. Runtime parameters are used to specify the parameters required to implement this function, such as the destination IP (Internet Protocol Address) and port number for network latency testing. This is an optional information item.
[0052] 4. Environment Configuration Parameters. Environment configuration parameters describe the operating environment required to implement this function, such as network configuration. This is an optional information item.
[0053] 5. Metric Requirements. Metric requirements specify the necessary metrics and their range for implementing this function, such as the execution efficiency of automated testing tools. This is an optional information item.
[0054] 6. Matching Options. Matching options describe how to select the optimal automated testing tool when multiple tools simultaneously meet the requirements. This can be done by ranking the tools based on one or more metrics, or by directly specifying the name and version of the automated testing tool. This is an optional information item.
[0055] Step S12: Use the matching bus to determine the function information of the function to be tested in the function description interface, and based on the function information and the matching information defined in the preset function set, match the optimal interface from all the current tool description interfaces.
[0056] Understandably, in this step, the matching bus will use the functional information of the function under test defined in the functional description interface, and combine it with the functional information in the function set to determine the optimal interface from all the current tool description interfaces, so as to use the automated testing tool corresponding to the optimal interface to test the function under test in the future.
[0057] In this embodiment, determining the functional information of the function to be tested in the functional description interface may include: determining the functional type, functional name, operating parameters, environment configuration parameters, indicator requirements, and matching options of the function to be tested in the functional description interface. It should be noted that the functional type and functional name of the function to be tested are mandatory in this embodiment, while other items are optional. Furthermore, it should be noted that the functional information of the function to be tested in the functional description interface in this embodiment includes, but is not limited to, the above-mentioned information, and is not limited thereto.
[0058] In this embodiment, the tool description interface corresponds one-to-one with the automated testing tool. It is responsible for describing the functions provided by the tool, namely the capabilities and metrics corresponding to each function, as well as the execution and configuration methods of each function. In a specific implementation, the tool description interface may include:
[0059] 1. Basic Tool Information. Basic tool information may include the tool's name, version, supported operating environments, and other dependent software.
[0060] 2. Configuration Information. Configuration information includes the tool's installation path, relevant environment variables, etc.
[0061] 3. Function Tree. The tool description interface is divided according to function type, forming a tree structure of all the functions the tool can provide. Each leaf node in the function tree describes a specific function, and each leaf node contains the following information: (1) Function Name: Specifies the specific test function that the current leaf node can implement, such as network latency test, hard disk read / write test, etc.; (2) Supported Running Parameters: Specifies which parameters can be flexibly configured and their configuration range when implementing the corresponding function; (3) Environment Configuration Parameters: Specifies the supported operating environment when implementing the corresponding function; (4) Performance Metrics: Specifies the various performance metrics corresponding to the corresponding function; (5) Execution Method: Encapsulates the automated testing tool, specifically responsible for converting the information in the function description interface into a set of commands and parameters that the automated testing tool can recognize; (6) Configuration Method: Configures the environment and tool using the configuration method when the operating environment of the function changes.
[0062] In this embodiment, the function set provides a standardized and extensible set of description interfaces. The description information in both the function description interfaces and the tool descriptions follows the definition of the function set. In a specific implementation, the tool set defines which specific functions are included under each function type, which runtime parameters, environment configuration parameters, and performance indicators each function may include, as well as the data type and parsing method of each parameter and indicator (e.g., string, integer, floating-point, IP address, etc.). It also specifies the execution method and configuration method for each function.
[0063] The matching bus described in this embodiment is the core of the system function test in this application. Specifically, it is responsible for automatically selecting the appropriate automated testing tool and version to test the function to be tested of the system under test based on the function description interface in the automated script and the function description interface provided by the automated testing tool.
[0064] like Figure 2 The system framework diagram provided in this application shows the structural relationship between automation scripts, function description interfaces, matching buses, tool description interfaces, automation tool pools, and function sets. It can be seen that the function description interfaces are provided by automation scripts, the tool description interfaces correspond one-to-one with the automated test tools in the automation tool pool, and the matching bus performs corresponding matching based on the predefined function sets and the function description interfaces and tool description interfaces to complete the testing of the function under test.
[0065] It is understood that the automated scripts and function description interfaces described in this embodiment are for the user-facing function testing side, while the tool description interfaces and automated testing tools are for the testing tool side. The matching bus is used to automatically match functions with tools, thereby improving the efficiency and accuracy of system function testing.
[0066] Step S13: Use the automated testing tool corresponding to the optimal interface to test the function to be tested, and return the test results to the automated script.
[0067] In this embodiment, testing the function under test using the automated testing tool corresponding to the optimal interface may include: determining the automated testing tool corresponding to the optimal interface from the automated tool pool, and using the automated testing tool corresponding to the optimal interface to test the function under test. It is understood that the automated testing tool in this embodiment may be limited to those stored in the automated tool pool, and the automated testing tools include, but are not limited to, Chaosblade, JMeter, and NetPerf; no specific limitation is made here.
[0068] In one specific implementation, after the matching bus starts, it first parses the tool description interfaces registered by each automated testing tool. It then integrates the functional information from the function tree of each automated testing tool according to its functional type, facilitating rapid matching between the functional description interfaces and the automated testing tools. When the automated script starts running, it submits its functional description interface to the system bus. The matching bus then uses the functional information in the functional description interface to automatically match a suitable automated testing tool. The automated testing tool then utilizes its configuration and execution methods to complete the testing of the function under test and finally returns the test results to the automated script.
[0069] In this embodiment, a function description interface is first obtained from a preset automation script and sent to a matching bus. Then, the matching bus is used to determine the function information of the function under test within the function description interface. Based on this function information and matching information defined in a preset function set, the optimal interface is matched from all available tool description interfaces. Finally, the automated testing tool corresponding to the optimal interface tests the function under test, and the test results are returned to the automation script. In this way, this application utilizes a matching bus to automatically match the optimal tool description interface based on the function information of the function under test in the function description interface of the automation script. The automated testing tool corresponding to the optimal tool description interface then completes the testing of the function under test, and finally, the test results are returned to the automation script. In the system functional testing method of this application, developers only need to follow the information provided in the function set to write the functional information of the function to be tested into the function description interface in the automated script, and they can directly obtain the test results in the script. When there are multiple different types of functions to be tested, there is no need to manually encapsulate and adapt tools one by one, which greatly reduces the time spent on selecting and encapsulating and adapting test tools in functional testing. This frees developers from the heavy work of tool research and adaptation, allowing them to devote more energy to performance analysis, optimization, and in-depth vulnerability discovery, thereby improving testing efficiency and system development efficiency.
[0070] Figure 3 A flowchart illustrating a specific system function testing method provided in this application embodiment. See also... Figure 3 As shown, the method includes:
[0071] Step S21: Obtain the function description interface from the preset automation script and send the function description interface to the matching bus.
[0072] For a more detailed description of the process of step S21, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0073] Step S22: Use the matching bus to determine the function type, function name, operating parameters, environment configuration parameters, indicator requirements, and matching options of the function to be tested in the function description interface. Based on the function type of the function to be tested, match the first tool interface set from all the current tool description interfaces. Then, based on the matching information corresponding to the function name of the function to be tested in the preset function set, determine the second tool interface set from the first tool interface set. Finally, use the preset optimal matching method to determine the optimal interface from the second tool interface set.
[0074] Understandably, in this embodiment, after determining the function type and function name of the function under test in the function description interface, the matching bus will match the corresponding interface from all current tool description interfaces based on the function type. This matching may result in multiple interfaces, which will be recorded in the first tool interface set. Then, based on the matching information corresponding to the function name of the function under test in the preset function set, the matching bus will again determine the interface from the first tool interface set. This may also result in multiple interfaces, which will be recorded in the second tool interface set. Finally, the matching bus will use a preset optimal matching method to determine the optimal interface from the second tool interface set. The automated testing tool corresponding to this optimal interface is the testing tool that best matches the function under test described in the function description interface.
[0075] In this embodiment, determining the first tool interface set from all current tool description interfaces based on the function type in the function information may include: traversing all current tool description interfaces to determine the testable function type corresponding to the current tool description interface from the function tree in each tool description interface; matching the testable function type corresponding to each tool description interface with the function type of the function to be tested to determine the first tool interface set based on all current tool description interfaces; wherein, the testable function types corresponding to the tool description interfaces in the first tool interface set all contain the function type of the function to be tested.
[0076] It is understood that, in this embodiment, the matching bus determines the first tool interface set based on the function type in the function information of the function description interface. Specifically, the matching bus first traverses the function tree in the tool description interface to determine all currently available testable function types that can provide test services. Then, it determines whether the testable function type corresponding to each tool description interface contains the function type of the function to be tested. If it does, the corresponding tool description interface is recorded in the first tool interface set. After traversing all tool description interfaces, the first tool interface set can be determined.
[0077] In this embodiment, determining the second tool interface set from the first tool interface set based on the matching information corresponding to the function name of the function to be tested in the preset function set may include: determining the matching information corresponding to the function name of the function to be tested in the preset function set; wherein, the matching information includes the running parameters, environment configuration parameters and performance indicators corresponding to the function type of the function to be tested; matching the matching information with the corresponding information in each tool description interface in the first tool interface set, and removing tool description interfaces with inconsistent matching results from the first tool interface set to generate the second tool interface set.
[0078] In this embodiment, after determining the first set of interfaces, interfaces that do not meet the requirements are removed from the first set of tool interfaces based on the matching information corresponding to the function name of the function to be tested in the preset set of functions, so as to generate the second set of tool interfaces.
[0079] In this embodiment, determining the optimal interface from the second tool interface set using a preset optimal matching method may include: determining the number of interfaces in the second tool interface set; if the number of interfaces in the second tool interface set is greater than 1, comparing the preset matching options with the corresponding matching options in each of the second tool interface sets to determine the optimal interface from the second tool interface set; if the number of interfaces in the second tool interface set is 1, determining the corresponding tool description interface in the second tool interface set as the optimal interface.
[0080] In this embodiment, when the number of the second tool interface set is greater than 1, the preset matching option will be compared with the matching option corresponding to each of the second tool interface sets to determine the optimal matching interface from the second tool interface set.
[0081] Step S23: Use the pre-configured configuration method and execution method in the automated testing tool corresponding to the optimal interface to test the function to be tested, and return the test results to the automated script.
[0082] In this embodiment, after determining the optimal interface, the corresponding automated testing tool is determined based on the optimal interface. Then, the configuration method and execution method in the automated testing tool are automatically called to test the function under test. Finally, the test results are returned to the automated script for display.
[0083] like Figure 4The diagram illustrates a tool matching process proposed in this embodiment. After the matching bus obtains the function description interface, it iterates through all current tool description interfaces based on the function type defined in the function description interface. If no tool description interface matches the function type, a matching error message is returned directly in the automation script. If a tool description interface matches the function type, a first tool interface set is generated based on these interfaces. Then, based on the parsed running parameters, environment configuration parameters, and corresponding metrics defined in the function set, each interface in the first tool interface set is compared. If the corresponding parameters and metrics in a tool description interface do not match, the mismatched interface is removed from the first tool interface set. After comparing each interface in the first tool interface set, a corresponding second tool interface set is generated. If no interface exists in the second tool interface set, the matching error message will be returned directly in the automation script. If multiple interfaces exist in the second tool interface set, the optimal interface will be selected according to the matching options. If only one interface exists in the second tool interface set, the current interface will be directly determined as the optimal interface. After determining the optimal interface, the configuration method and execution method in the automation test tool corresponding to the optimal interface will be called to test the function under test, and the final test result will be returned to the automation script.
[0084] In this embodiment, a function description interface is first obtained from a preset automated script and sent to a matching bus. Then, the matching bus determines the function type, function name, operating parameters, environment configuration parameters, indicator requirements, and matching options of the function to be tested within the function description interface. Based on the function type of the function to be tested, a first set of tool interfaces is matched from all current tool description interfaces. Then, based on the matching information corresponding to the function name of the function to be tested within the preset function set, a second set of tool interfaces is determined from the first set of tool interfaces. Finally, a preset optimal matching method is used to determine the optimal interface from the second set of tool interfaces. Finally, the function to be tested is tested using the pre-configured configuration and execution methods in the automated testing tool corresponding to the optimal interface, and the test results are returned to the automated script. This embodiment proposes a matching bus process for matching functions to be tested with automated testing tools. Using the method proposed in this application, developers do not need to manually package and adapt tools one by one, greatly reducing the time spent on selecting and adapting testing tools during functional testing, thereby improving testing efficiency and allowing developers to focus more on performance analysis, optimization, and deep vulnerability discovery.
[0085] See Figure 5 As shown in the figure, this application discloses a system function testing device, which may specifically include:
[0086] The function description interface acquisition module 11 is used to acquire the function description interface from the preset automation script and send the function description interface to the matching bus;
[0087] The tool description interface matching module 12 is used to determine the functional information of the function to be tested in the functional description interface using the matching bus, and to match the optimal interface from all the current tool description interfaces based on the functional information and the matching information defined in the preset functional set.
[0088] The functional testing module 13 is used to test the function to be tested using the automated testing tool corresponding to the optimal interface, and return the test results to the automated script.
[0089] This application first obtains the function description interface from a preset automation script and sends the function description interface to a matching bus. Then, the matching bus is used to determine the function information of the function to be tested in the function description interface. Based on the function information and the matching information defined in the preset function set, the optimal interface is matched from all the current tool description interfaces. Finally, the automated testing tool corresponding to the optimal interface is used to test the function to be tested, and the test result is returned to the automation script. In this way, this application uses the matching bus to automatically match the optimal tool description interface based on the function information of the function to be tested in the function description interface of the automation script, so as to complete the test of the function to be tested according to the automated testing tool corresponding to the optimal tool description interface, and finally return the test result to the automation script. In the system function testing method of this application, developers only need to follow the information provided in the function set to write the function information of the function to be tested into the function description interface in the automated script, and they can directly obtain the test results in the script. When there are multiple different types of functions to be tested, there is no need to manually encapsulate and adapt tools one by one, which greatly reduces the time for selecting and encapsulating test tools in functional testing, thereby improving testing efficiency and allowing developers to devote more energy to performance analysis, optimization, and in-depth vulnerability discovery.
[0090] In some specific embodiments, the tool description interface matching module 12 may include:
[0091] The information determination unit is used to determine the function type, function name, operating parameters, environment configuration parameters, indicator requirements, and matching options of the function to be tested in the function description interface.
[0092] In some specific embodiments, the tool description interface matching module 12 may include:
[0093] The first interface set determination unit is used to match the first tool interface set from all current tool description interfaces based on the function type of the function to be tested.
[0094] The second interface set determination unit is used to determine the second tool interface set from the first tool interface set based on the matching information corresponding to the function name of the function to be tested in the preset function set.
[0095] The optimal interface determination unit is used to determine the optimal interface from the second tool interface set using a preset optimal matching method.
[0096] In some specific embodiments, the first interface set determination unit includes:
[0097] The interface traversal unit is used to traverse all current tool description interfaces to determine the testable function type corresponding to the current tool description interface from the function tree in each tool description interface;
[0098] A type matching unit is used to match the testable function type corresponding to each of the tool description interfaces with the function type of the function to be tested, so as to determine a first tool interface set based on all the current tool description interfaces; wherein, the testable function types corresponding to the tool description interfaces in the first tool interface set all contain the function type of the function to be tested.
[0099] In some specific embodiments, the second interface set determination unit includes:
[0100] A matching information determination unit is used to determine the matching information corresponding to the function name of the function to be tested in a preset function set; wherein, the matching information includes the operating parameters, environment configuration parameters and performance indicators corresponding to the function type of the function to be tested;
[0101] The information matching unit is used to match the matching information with the corresponding information in each tool description interface in the first tool interface set, and to remove the tool description interfaces with inconsistent matching results from the first tool interface set to generate a second tool interface set.
[0102] In some specific embodiments, the optimal interface determination unit includes:
[0103] An interface quantity determination unit is used to determine the number of interfaces in the second tool interface set;
[0104] The first optimal interface determination unit is used to determine the optimal interface from the second tool interface set by comparing the preset matching options with the corresponding matching options in each of the second tool interface sets if the number of interfaces in the second tool interface set is greater than 1.
[0105] The first optimal interface determination unit is used to determine the corresponding tool description interface in the second tool interface set as the optimal interface if the number of interfaces in the second tool interface set is 1.
[0106] In some specific embodiments, the functional testing module 13 includes:
[0107] The testing tool application unit uses the pre-configured configuration method and execution method in the automated testing tool corresponding to the optimal interface to test the function under test.
[0108] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of use of this application.
[0109] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a display screen 24, an input / output interface 25, a communication interface 26, and a communication bus 27. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the system function testing method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0110] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 26 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0111] Furthermore, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it can include an operating system 221, computer programs 222, and virtual machine data 223, etc. The virtual machine data 223 can include various types of data. The storage method can be temporary storage or permanent storage.
[0112] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the system function testing method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0113] Furthermore, this application also discloses a computer-readable storage medium, which includes random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, magnetic disks, optical disks, or any other form of storage medium known in the art. The computer program, when executed by a processor, implements the aforementioned disclosed system function testing method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0114] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatuses disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section. Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0115] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0116] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0117] The system function testing method, apparatus, equipment, and storage medium provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A system function testing method, characterized in that, include: Obtain the function description interface from the preset automation script, and send the function description interface to the matching bus; The matching bus is used to determine the functional information of the function to be tested in the functional description interface, and based on the functional information and the matching information defined in the preset functional set, the optimal interface is matched from all the current tool description interfaces. The function to be tested is tested using the automated testing tool corresponding to the optimal interface, and the test results are returned to the automated script. The step of determining the functional information of the function to be tested in the functional description interface includes: The function description interface defines the function type, function name, runtime parameters, environment configuration parameters, performance requirements, and matching options for the function to be tested. The function type specifies the category of the required test function; the function name specifies the specific test function to be implemented; runtime parameters specify the parameters required to implement the function; environment configuration parameters describe the runtime environment required to implement the function; performance requirements specify the required performance indicators and their ranges; and matching options describe how to select the optimal automated testing tool when multiple automated testing tools simultaneously meet the requirements. The matching of the optimal interface from all current tool description interfaces, based on the functional information and the matching information defined in the preset functional set, includes: Based on the function type of the function to be tested, match the first tool interface set from all current tool description interfaces; Based on the matching information between the function name of the function to be tested and the preset function set, the second tool interface set is determined from the first tool interface set. The optimal interface is determined from the second set of tool interfaces using a preset optimal matching method; The tool description interface includes basic tool information, configuration information, and a function tree. The basic tool information includes the tool's name, version, supported operating environments, and dependent software. The configuration information includes the tool's installation path and related environment variables. Each leaf node in the function tree describes a function, and each leaf node contains the following information: function name, specifying the specific test function that the current leaf node can implement, including network latency testing and hard disk read / write testing; supported operating parameters, specifying the flexibly configurable parameters and their configuration ranges when implementing the corresponding function; environment configuration parameters, specifying the supported operating environments when implementing the corresponding function; performance metrics, specifying the various performance metrics corresponding to the corresponding function; execution method, used to encapsulate the automated testing tool, responsible for converting the information in the function description interface into a set of commands and parameters that the automated testing tool can recognize; and configuration method, used to configure the environment and tool when the function's operating environment changes.
2. The system function testing method according to claim 1, characterized in that, The step of determining the first tool interface set from all current tool description interfaces based on the function type in the function information includes: Traverse all current tool description interfaces to determine the testable function type corresponding to the current tool description interface from the function tree in each tool description interface; The testable function types corresponding to each of the tool description interfaces are matched with the function type of the function to be tested to determine a first tool interface set based on all the current tool description interfaces; wherein, the testable function types corresponding to the tool description interfaces in the first tool interface set all contain the function type of the function to be tested.
3. The system function testing method according to claim 1, characterized in that, The determination of the second tool interface set from the first tool interface set based on the matching information corresponding to the function name of the function to be tested in the preset function set includes: Determine the matching information between the preset function set and the function name of the function to be tested; wherein, the matching information includes the running parameters, environment configuration parameters and performance indicators corresponding to the function type of the function to be tested; The matching information is used to match the corresponding information in each tool description interface of the first tool interface set, and the tool description interfaces with inconsistent matching results are removed from the first tool interface set to generate a second tool interface set.
4. The system function testing method according to claim 1, characterized in that, The step of determining the optimal interface from the second tool interface set using a preset optimal matching method includes: Determine the number of interfaces in the second tool interface set; If the number of interfaces in the second tool interface set is greater than 1, then the preset matching options are compared with the corresponding matching options in each of the second tool interface sets to determine the optimal interface from the second tool interface set. If the number of interfaces in the second tool interface set is 1, then the corresponding tool description interface in the second tool interface set is determined as the optimal interface.
5. The system function testing method according to any one of claims 1 to 4, characterized in that, The step of testing the function under test using the automated testing tool corresponding to the optimal interface includes: The function to be tested is tested using the pre-configured configuration and execution methods in the automated testing tool corresponding to the optimal interface.
6. A system function testing device, characterized in that, include: The function description interface acquisition module is used to acquire the function description interface from the preset automation script and send the function description interface to the matching bus; The tool description interface matching module is used to determine the functional information of the function to be tested in the functional description interface using the matching bus, and to match the optimal interface from all the current tool description interfaces based on the functional information and the matching information defined in the preset functional set. The functional testing module is used to test the function under test using the automated testing tool corresponding to the optimal interface, and return the test results to the automated script. The tool description interface matching module includes: The information determination unit is used to determine the function type, function name, operating parameters, environment configuration parameters, indicator requirements, and matching options of the function to be tested in the function description interface. The function type is used to specify the category to which the test function to be implemented belongs; the function name is used to specify the specific test function to be implemented; the operating parameters are used to specify the parameters required to implement the function; the environment configuration parameters are used to describe the operating environment required to implement the function; the indicator requirements are used to specify the indicators that must be met and their range when the function is implemented; and the matching options are used to describe how to select the optimal automated testing tool when multiple automated testing tools meet the requirements simultaneously. The tool description interface matching module includes: The first interface set determination unit is used to match the first tool interface set from all current tool description interfaces based on the function type of the function to be tested. The second interface set determination unit is used to determine the second tool interface set from the first tool interface set based on the matching information corresponding to the function name of the function to be tested in the preset function set. The optimal interface determination unit is used to determine the optimal interface from the second tool interface set using a preset optimal matching method; The tool description interface includes basic tool information, configuration information, and a function tree. The basic tool information includes the tool's name, version, supported operating environments, and dependent software. The configuration information includes the tool's installation path and related environment variables. Each leaf node in the function tree describes a function, and each leaf node contains the following information: function name, specifying the specific test function that the current leaf node can implement, including network latency testing and hard disk read / write testing; supported operating parameters, specifying the flexibly configurable parameters and their configuration ranges when implementing the corresponding function; environment configuration parameters, specifying the supported operating environments when implementing the corresponding function; performance metrics, specifying the various performance metrics corresponding to the corresponding function; execution method, used to encapsulate the automated testing tool, responsible for converting the information in the function description interface into a set of commands and parameters that the automated testing tool can recognize; and configuration method, used to configure the environment and tool when the function's operating environment changes.
7. An electronic device, characterized in that, It includes a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the system function testing method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the system function testing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Automatic testing device and method incorporating a variety of testing tools
CN101212362A
Integrated test method, apparatus, computer device and storage medium
CN109144799A