Measurement terminal software test method, system and program product

Through the establishment of a virtual environment in the intelligent energy test terminal software test, automatically extract functional information and generate test cases, solve the problem of low efficiency of existing test methods, and achieve more efficient test coverage and performance evaluation.

CN119377105APending Publication Date: 2025-01-28ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411382030.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The testing efficiency of intelligent measurement terminal software is low, and existing testing methods cannot effectively solve their special needs in system architecture, software environment and work environment.

Method used

Provide a measurement method and system for measuring terminal software. By establishing a virtual environment, traversing the software work manual extraction function name and calling relationship, generating function call trees, automatic constructing test cases, and sending control instructions through the virtual main station for testing, evaluating performance.

Benefits of technology

Improving the efficiency of the testing of the end software of the intelligent energy, the generated case coverage rate is high, and the test results can better reflect the performance of the software in the actual environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377105A_ABST
    Figure CN119377105A_ABST
Patent Text Reader

Abstract

The invention relates to a measuring terminal software testing method and system and a computer program product. The method comprises the following steps: traversing a work manual of measurement terminal software, and extracting a function name and a calling relationship of the measurement terminal software; performing tree generation processing based on the function name and the calling relation to obtain a function calling tree; performing test case generation processing according to the tree structure of the function call tree to obtain a test case; generating a measurement program control instruction and a virtual device control instruction based on the test case, and sending the instructions to the measurement terminal software and the virtual device so as to realize function test; and finally, evaluating the performance of the application program to obtain a test result of the measurement terminal software. According to the method, the function description is automatically extracted from the work manual and is represented as the tree structure, and the corresponding test case is generated, so that the application test processing of the measurement terminal software is completed, and the test efficiency of the intelligent measurement terminal software is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a measurement terminal software testing method, system and program product. Background Art

[0002] With the development of computer technology and electrical technology, intelligent measurement technology has emerged. Intelligent measurement terminals can collect electrical parameters such as voltage, current, power factor, frequency, harmonics, etc. of the power grid in real time, and can upload these data to the power grid dispatching center or cloud platform through the communication interface. At the same time, it can also process and analyze the collected data, and provide evaluation, prediction and alarm functions for the operation status of the power grid. In addition, the intelligent measurement terminal also has a remote control function, which can receive instructions from the upper system to realize remote control and optimization of power grid equipment. This function makes power grid management more convenient and efficient, and improves the safety and reliability of the power grid.

[0003] However, the software applications of the intelligent measurement terminals need to be tested before they are put on the shelves. Compared with conventional software testing, the application testing on the intelligent measurement terminal is different in terms of system architecture, software environment and working environment. The efficiency of testing the measurement terminal software through conventional software testing methods is low. Summary of the invention

[0004] Based on this, it is necessary to provide a measurement terminal software testing method, system, computer device, computer readable storage medium and computer program product that can improve the efficiency of intelligent measurement terminal software testing in response to the above technical problems.

[0005] In a first aspect, the present application provides a software testing system for a measurement terminal, the measurement terminal software testing system comprising a virtual master station, a virtual uplink interface, a virtual measurement terminal, a virtual downlink interface, and a plurality of virtual devices connected to the virtual downlink interface in sequence, wherein the measurement terminal software to be tested runs on the virtual measurement terminal;

[0006] The method comprises:

[0007] Traversing the work manual of the measurement terminal software, extracting the function names and calling relationships of the measurement terminal software;

[0008] Perform tree generation processing based on the function name and the call relationship to obtain a function call tree;

[0009] Perform test case generation processing according to the tree structure of the function call tree to obtain a test case for the measurement terminal software;

[0010] Generate a measurement program control instruction and a virtual device control instruction based on the test case, send the measurement program control instruction to the measurement terminal software on the virtual measurement terminal through the virtual master station, and send the virtual device control instruction to the virtual device through the virtual master station, so as to measure and process the device output data of the virtual device through the measurement terminal software;

[0011] Based on the running status of the virtual main station, the running status of the measurement terminal software and the running status of the virtual device, application performance evaluation processing is performed to obtain the test result of the measurement terminal software.

[0012] In one embodiment, the method further comprises:

[0013] Obtaining software function description information of the measurement terminal software and device-generated data description information;

[0014] Based on preset keywords and preset grammars, the software function description information and the device generated data description information are parsed and processed respectively to obtain parsed texts;

[0015] The parsed texts are summarized to generate a work manual for the measurement terminal software.

[0016] In one embodiment, performing tree generation processing based on the function name and the call relationship to obtain a function call tree includes:

[0017] Establish a root node corresponding to software startup;

[0018] Establishing sub-nodes of each layer corresponding to the software function based on the function name and the calling relationship, and filling the function description and input generation method description corresponding to the function name into the corresponding sub-node;

[0019] A function call tree is generated according to the root node and the child nodes.

[0020] In one embodiment, the test case generation process is performed according to the tree structure of the function call tree to obtain the test case of the measurement terminal software, including:

[0021] Get test path range information and historical test information;

[0022] Traversing the tree structure of the function call tree to generate a test path;

[0023] Screening the generated test paths according to the test path range information and the historical test information to obtain target test paths that are within the test path range and have not been tested;

[0024] Generate a test case corresponding to the target test path.

[0025] In one embodiment, the method further comprises:

[0026] Obtaining a functional input description and a device output description of the test case;

[0027] Based on the function input description and the device output description, data buffers corresponding to different data names are created. The virtual device control instructions are used to control the virtual device to generate corresponding test data, place the test data into the data buffer, and send the test data from the data buffer to the measurement terminal software on the virtual measurement terminal.

[0028] In one embodiment, the method further comprises:

[0029] Based on the test results of the measurement terminal software, various performances of the measurement terminal software are evaluated to obtain performance evaluation results;

[0030] The performance evaluation results are summarized to generate a test report for the measurement terminal software.

[0031] In a second aspect, the present application further provides a measurement terminal software testing system, the measurement terminal software testing system comprising a virtual master station, a virtual uplink interface, a virtual measurement terminal, a virtual downlink interface, and a plurality of virtual devices connected to the virtual downlink interface in sequence, the measurement terminal software to be tested is run on the virtual measurement terminal, as well as a work manual parsing module, a tree structure generation module, a function sequence generation module, and a performance evaluation module;

[0032] The work manual parsing module is used to traverse the work manual of the measurement terminal software and extract the function names and calling relationships of the measurement terminal software;

[0033] The tree structure generation module is used to perform tree generation processing based on the function name and the call relationship to obtain a function call tree;

[0034] The function sequence generation module is used to perform test case generation processing according to the tree structure of the function call tree to obtain the test case of the measurement terminal software;

[0035] The virtual master station is used to generate a measurement program control instruction and a virtual device control instruction based on the test case, and send the measurement program control instruction to the measurement terminal software on the virtual measurement terminal, and send the virtual device control instruction to the virtual device through the virtual master station, so as to measure and process the device output data of the virtual device through the measurement terminal software;

[0036] The performance evaluation module is used to perform application performance evaluation processing based on the operating status of the virtual master station, the operating status of the measurement terminal software and the operating status of the virtual device to obtain the test result of the measurement terminal software.

[0037] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0038] Traversing the work manual of the measurement terminal software, extracting the function names and calling relationships of the measurement terminal software;

[0039] Perform tree generation processing based on the function name and the call relationship to obtain a function call tree;

[0040] Perform test case generation processing according to the tree structure of the function call tree to obtain a test case for the measurement terminal software;

[0041] Generate a measurement program control instruction and a virtual device control instruction based on the test case, send the measurement program control instruction to the measurement terminal software on the virtual measurement terminal through the virtual master station, and send the virtual device control instruction to the virtual device through the virtual master station, so as to measure and process the device output data of the virtual device through the measurement terminal software;

[0042] Based on the running status of the virtual main station, the running status of the measurement terminal software and the running status of the virtual device, application performance evaluation processing is performed to obtain the test result of the measurement terminal software.

[0043] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0044] Traversing the work manual of the measurement terminal software, extracting the function names and calling relationships of the measurement terminal software;

[0045] Perform tree generation processing based on the function name and the call relationship to obtain a function call tree;

[0046] Perform test case generation processing according to the tree structure of the function call tree to obtain a test case for the measurement terminal software;

[0047] Generate a measurement program control instruction and a virtual device control instruction based on the test case, send the measurement program control instruction to the measurement terminal software on the virtual measurement terminal through the virtual master station, and send the virtual device control instruction to the virtual device through the virtual master station, so as to measure and process the device output data of the virtual device through the measurement terminal software;

[0048] Based on the running status of the virtual main station, the running status of the measurement terminal software and the running status of the virtual device, application performance evaluation processing is performed to obtain the test result of the measurement terminal software.

[0049] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0050] Traversing the work manual of the measurement terminal software, extracting the function names and calling relationships of the measurement terminal software;

[0051] Perform tree generation processing based on the function name and the call relationship to obtain a function call tree;

[0052] Perform test case generation processing according to the tree structure of the function call tree to obtain a test case for the measurement terminal software;

[0053] Generate a measurement program control instruction and a virtual device control instruction based on the test case, send the measurement program control instruction to the measurement terminal software on the virtual measurement terminal through the virtual master station, and send the virtual device control instruction to the virtual device through the virtual master station, so as to measure and process the device output data of the virtual device through the measurement terminal software;

[0054] Based on the running status of the virtual main station, the running status of the measurement terminal software and the running status of the virtual device, application performance evaluation processing is performed to obtain the test result of the measurement terminal software.

[0055] The measurement terminal software testing method, system, computer device, computer-readable storage medium and computer program product described above, during the measurement terminal software testing process, traverse the measurement terminal software work manual to extract the function name and call relationship of the measurement terminal software; perform tree generation processing based on the function name and call relationship to obtain a function call tree; perform test case generation processing according to the tree structure of the function call tree to obtain a test case of the measurement terminal software; generate measurement program control instructions and virtual device control instructions based on the test case, send the measurement program control instructions to the measurement terminal software on the virtual measurement terminal through the virtual main station, and send the virtual device control instructions to the virtual device through the virtual main station, so as to perform measurement processing on the device output data of the virtual device through the measurement terminal software; perform application performance evaluation processing based on the running status of the virtual main station, the running status of the measurement terminal software and the running status of the virtual device to obtain the test result of the measurement terminal software. This application establishes a virtual environment that simulates the special software and hardware of the measurement terminal, so that the measurement terminal software is tested in an environment close to the actual environment. The evaluation results can better reflect the performance of the software in reality. At the same time, the function description is automatically extracted from the work manual and represented as a tree structure. The corresponding test cases are generated according to the tree structure, thereby completing the application test processing of the measurement terminal software, effectively reducing the workload of the test case generation process, and effectively improving the testing efficiency of the intelligent measurement terminal software. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0057] FIG1 is a diagram showing an application environment of a measurement terminal software testing method according to an embodiment;

[0058] FIG2 is a schematic diagram of a flow chart of a method for testing software of a measurement terminal in one embodiment;

[0059] FIG3 is a schematic diagram of a flow chart of a call tree generation step in one embodiment;

[0060] FIG4 is a schematic diagram of a flow chart of a method for testing software of a measurement terminal in another embodiment;

[0061] FIG5 is a structural block diagram of a measurement terminal software testing system in one embodiment;

[0062] FIG. 6 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0064] The measurement terminal software testing method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 is equipped with a measurement terminal software testing system, which can be used to test the measurement terminal software. The server can test the measurement terminal software by establishing a virtual environment that simulates the special software and hardware of the measurement terminal. The measurement terminal software testing system includes a virtual main station, a virtual uplink interface, a virtual measurement terminal, a virtual downlink interface, and a plurality of virtual devices connected to the virtual downlink interface, and the measurement terminal software to be tested is running on the virtual measurement terminal. When testing is required, the test staff can submit a test request to the server 104 through the terminal 102. The server 104 establishes a virtual environment for software and hardware testing according to the test request, and loads virtual devices such as a virtual main station, a virtual uplink interface, a virtual measurement terminal, a virtual downlink interface, and a virtual device in the environment. Based on the test information of the test request, the work manual of the measurement terminal software is traversed to extract the function name and call relationship of the measurement terminal software; tree generation processing is performed based on the function name and call relationship to obtain a function call tree; test case generation processing is performed according to the tree structure of the function call tree to obtain a test case of the measurement terminal software; measurement program control instructions and virtual device control instructions are generated based on the test case, and the measurement program control instructions are sent to the measurement terminal software on the virtual measurement terminal through the virtual main station, and the virtual device control instructions are sent to the virtual device through the virtual main station, so that the device output data of the virtual device is measured and processed through the measurement terminal software; application performance evaluation processing is performed based on the running status of the virtual main station, the running status of the measurement terminal software and the running status of the virtual device to obtain the test result of the measurement terminal software. Finally, the test result is returned to the terminal 102. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. The portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device may be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0065] In an exemplary embodiment, as shown in FIG2 , a measurement terminal software testing method is provided, which is described by taking the method applied to a measurement terminal software testing system established on the server 104 in FIG1 as an example, and includes the following steps 201 to 209. Among them:

[0066] The measurement terminal software test system includes a virtual main station, a virtual uplink interface, a virtual measurement terminal, a virtual downlink interface, and a plurality of virtual devices connected to the virtual downlink interface, and the measurement terminal software to be tested runs on the virtual measurement terminal.

[0067] Among them, the virtual master station is used to simulate various functions involving the intelligent measurement terminal in the actual master station; the virtual uplink interface is used to simulate the communication interface between the intelligent measurement terminal and the master station in the actual system, so that instructions and data can be transmitted between the virtual measurement terminal and the virtual master station at a certain rate and specification; the virtual measurement terminal is used to simulate the operating environment of the application in the actual intelligent measurement terminal; the virtual downlink interface is used to simulate the communication interface between the intelligent measurement terminal and the equipment in the actual system, so that instructions and data can be transmitted between the virtual measurement terminal and the virtual setting at a certain rate and specification; the virtual device is used to simulate various devices controlled by the intelligent measurement terminal in the actual system, and can perform corresponding actions or return corresponding data according to the instructions sent by the intelligent measurement terminal.

[0068] The methods specifically include:

[0069] Step 201 , traverse the work manual of the measurement terminal software to extract the function names and calling relationships of the measurement terminal software.

[0070] Among them, the measurement terminal software is the target application tested by the present application method. The work manual refers to a text file that is pre-written based on the functions of the measurement terminal software to be tested, and specifically includes a description of each function of the intelligent measurement terminal software and a description of the data generated by each device.

[0071] Exemplarily, in the process of measuring terminal software testing, it is necessary to complete the writing of test cases first. However, the current manual testing manually writes and executes test cases and evaluates the test results, which has the disadvantages of high testing cost, long testing cycle, low coverage, and high requirements for programming language of testers, and it is difficult to meet the needs of rapid software updates and iterations. Therefore, the solution of this application proposes a solution for efficiently constructing test cases based on functional analysis of the measurement terminal software in view of the particularity of the measurement terminal software. Therefore, when testing the measurement terminal software, it is necessary to first traverse the work manual of the measurement terminal software, extract the function names of the measured terminal software being tested and the calling relationships between the functions, as the basic data for subsequent analysis.

[0072] Step 203: Perform tree generation processing based on the function name and the call relationship to obtain a function call tree.

[0073] Step 205 , performing test case generation processing according to the tree structure of the function call tree to obtain test cases for the measurement terminal software.

[0074] Among them, the function call tree is used to represent the specific functions and function connections of the measurement terminal software in a tree structure, wherein the root node of the tree is the software startup, and each of the remaining nodes corresponds to a function of the software, and the parent node of each node corresponds to the upper layer function that calls the function corresponding to the node, and the child node corresponds to the lower layer function called by the function corresponding to the node. Test case refers to the description of the test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document. Simply put, a test case is a set of test inputs, execution conditions and expected results compiled for a special goal, which is used to verify whether a specific software requirement is met. For the scheme of this application, the test steps in the test case are embodied by a series of functional sequences.

[0075] Exemplarily, after obtaining the function name and the call relationship, a tree generation process can be performed based on the function name and the call relationship to obtain a function call tree. The function call tree can more intuitively display the relevant information of the function and the call relationship between the functions. By scanning the function call tree, a test case generation process can be performed according to the tree structure of the function call tree to obtain a test case for the measurement terminal software. For example, in one of the embodiments, by scanning the tree structure of the function call tree, a test path is determined to be software startup->A->C as an example, and the generated function sequence is: {software startup, A, C}, and the current operation is initialized as software startup. Then, the test case generation work can be completed based on this function sequence that needs to be implemented, and a test case that can be used to test functions A, C, and A->C can be obtained.

[0076] Step 207, generating measurement program control instructions and virtual device control instructions based on the test case, sending the measurement program control instructions to the measurement terminal software on the virtual measurement terminal through the virtual master station, and sending the virtual device control instructions to the virtual device through the virtual master station, so as to measure and process the device output data of the virtual device through the measurement terminal software.

[0077] Step 209: Perform application performance evaluation based on the running status of the virtual master station, the running status of the measurement terminal software, and the running status of the virtual device to obtain the test result of the measurement terminal software.

[0078] Among them, the measurement program control instructions refer to the instructions used to control the measurement terminal software on the virtual measurement terminal to perform corresponding measurement processing, while the virtual device control instructions are the instructions used to control the virtual device to generate device output data, thereby effectively simulating the data input and output of the measurement process.

[0079] Exemplarily, after generating the test cases, the test processing of the measurement terminal software can be performed through these test cases. During the test process, the measurement program control instructions and virtual device control instructions can be generated according to the functional sequence based on the test cases. Each instruction issued is used to control the measurement terminal software to implement a test of a function. After the previous function test is completed, the relevant instructions for the next function test are generated. For the specific test process, it is necessary to perform it in the measurement terminal software test system that simulates the specific measurement environment. The measurement program control instructions and virtual device control instructions for testing can be generated on the virtual master station, and then the virtual master station can send the execution function instructions to the application to be tested in the virtual measurement terminal in the order of the function sequence through the virtual uplink interface. The application performs the corresponding operation according to the instruction. When it is necessary to read the device parameters, the instruction is sent to the virtual device through the virtual downlink interface. The virtual device generates the corresponding data according to the device output data description obtained by the work manual parsing module and sends it to the application to be tested through the virtual downlink interface. Until all functions are tested, the final test results can be obtained. For the final evaluation process, the application performance evaluation can be directly performed based on the running status of the virtual master station, the running status of the measurement terminal software and the running status of the virtual device to obtain the test results of the measurement terminal software. For this evaluation process, the various functions of the measurement terminal software can be evaluated from the perspectives of the execution effect of the software function, the execution efficiency of the software function, and the measurement accuracy during the test process to obtain the final test results.

[0080] The above-mentioned measurement terminal software testing method, during the measurement terminal software testing process, traverses the measurement terminal software work manual to extract the function name and call relationship of the measurement terminal software; performs tree generation processing based on the function name and call relationship to obtain a function call tree; performs test case generation processing according to the tree structure of the function call tree to obtain a test case of the measurement terminal software; generates measurement program control instructions and virtual device control instructions based on the test case, sends the measurement program control instructions to the measurement terminal software on the virtual measurement terminal through the virtual main station, and sends the virtual device control instructions to the virtual device through the virtual main station, so as to measure the device output data of the virtual device through the measurement terminal software; performs application performance evaluation processing based on the running status of the virtual main station, the running status of the measurement terminal software and the running status of the virtual device to obtain the test result of the measurement terminal software. This application establishes a virtual environment that simulates the special software and hardware of the measurement terminal, so that the measurement terminal software is tested in an environment close to the actual environment. The evaluation results can better reflect the performance of the software in reality. At the same time, the function description is automatically extracted from the work manual and represented as a tree structure. The corresponding test cases are generated according to the tree structure, thereby completing the application test processing of the measurement terminal software, effectively reducing the workload of the test case generation process, and effectively improving the testing efficiency of the intelligent measurement terminal software.

[0081] In an exemplary embodiment, the method also includes: obtaining software function description information and device-generated data description information of the measurement terminal software; parsing the software function description information and the device-generated data description information based on preset keywords and preset grammar to obtain parsed text; summarizing the parsed text to generate a work manual for the measurement terminal software.

[0082] The preset keywords and preset syntaxes correspond to the measurement terminal software to be tested, and the preset keywords may include but are not limited to: "function name", "upper-layer function", "lower-layer function", "input", "output", "data name", "data type", "data area size", "value range", "reach mode", "reach intensity", "device name". The preset syntax is from after each "function name", "data name", "device name" to before the next of the above keywords. The content corresponding to other keywords belongs to the above functions, data or devices, and the format is: keyword + ":" + value.

[0083] For example, before the test case generation process is performed, the work manual of the measurement terminal software needs to be written in advance. The work manual contains the description of each function in the intelligent measurement terminal software and the description of the data generated by each device, so it is necessary to first obtain the software function description information and the device data generation description information of the measurement terminal software. After that, based on the preset keywords and preset grammar, the software function description information and the device data generation description information are parsed and processed respectively to obtain the parsed text; and the parsed text is summarized to generate the work manual of the measurement terminal software.

[0084] In one embodiment, the description of each function of the software in the work manual includes:

[0085] Name: The name of the function

[0086] Upper function: Enter the upper function of this function

[0087] Lower level functions: Lower level functions that can be accessed

[0088] Input: The name of the input required by this function

[0089] Output: The name of the output produced by this function

[0090] The description of the input of each function and the output data of each device includes: data name, data source, data type, data area size, probability distribution, distribution parameters, arrival method, and arrival intensity. The above data source is simulation or external input. The above arrival methods include single, uniform sampling and Poisson distribution. When the arrival method is uniform sampling or Poisson distribution, the above arrival intensity is the sampling frequency or Poisson distribution index. The output description of each function includes: data name, data type, data area size, arrival method, and arrival intensity. In this embodiment, the measurement terminal software to be tested has 3 functions, of which function A and function B are parallel functions of the same level, function C is the next level function called by function A, and has a device D controlled by the application to be tested, and is written using preset keywords and syntax, and the work manual summarized is as follows:

[0091] Function name: A

[0092] Upper layer function: software startup

[0093] Lower level function: C

[0094] Input: Function A input

[0095] Output: Function A output

[0096] Data name: Function A input

[0097] Data source: Simulation

[0098] Data type: int

[0099] Data area size: 1

[0100] Probability distribution: Uniform distribution

[0101] Distribution parameters: (-10.0, 10.0)

[0102] Arrival method: Single

[0103] Reach Strength: -

[0104] Data name: Function A output

[0105] Data type: int

[0106] Data area size: 1

[0107] Arrival method: Single

[0108] Reach Strength: -

[0109] Function name: B

[0110] Upper layer function: software startup

[0111] Lower level function: None

[0112] Input: None

[0113] Output: None

[0114] Function name: C

[0115] Upper function: A

[0116] Lower level function: None

[0117] Input: None

[0118] Output: None

[0119] Device Name: D

[0120] Data source: External input

[0121] Data type: float

[0122] Data area size: 10

[0123] Probability Distribution:-

[0124] Distribution Parameters:-

[0125] Arrival method: Uniform sampling

[0126] Reach intensity: 1kHz

[0127] In this embodiment, the work manual is generated by parsing and summarizing the software function description information and the device generated data description information, thereby ensuring that the work manual can completely record the description of each function in the intelligent measurement terminal software and the description information of the data generated by each device, ensuring the efficiency of the subsequent software testing process and improving the test coverage.

[0128] In one embodiment, as shown in FIG3 , step 203 includes:

[0129] Step 302, establishing a root node corresponding to software startup.

[0130] Step 304: establish sub-nodes of each layer corresponding to the software functions based on the function names and the calling relationships, and fill the function descriptions and input generation method descriptions corresponding to the function names into the corresponding sub-nodes.

[0131] Step 306: Generate a function call tree according to the root node and the child nodes.

[0132] Exemplarily, when generating the function call tree structure, it is necessary to establish the various levels of the function call tree structure based on the various functions possessed by the measurement terminal software. First, it is necessary to create a root node corresponding to the software startup. Only after the software startup is completed, other functions possessed by the software can be executed. For specific functions, the child nodes of each layer corresponding to the software function can be established based on the function name and the call relationship, and the function description and input generation method description corresponding to the function name are filled into the corresponding child node, and finally the function call tree is obtained through the constructed nodes. Thus, the root node of the function call tree is the software startup, and each of the remaining nodes corresponds to a function of the software. The parent node of each node corresponds to the upper layer function that calls the function corresponding to the node, and the child node corresponds to the next layer function called by the function corresponding to the node. And record the generation method of each function input. At the same time, extract the description of the output data of the device controlled by the application. For the above-mentioned measurement terminal software, there are 3 functions, among which function A and function B are parallel functions of the same level, and function C is the next level function called by function A, and there is an embodiment in which the application to be detected controls 1 device D. When generating a function call tree, you can first traverse the work manual and obtain the number N1 of the first-level functions of the software through keyword retrieval. Use "function name" as the keyword to traverse the work manual of the measurement terminal software, calculate the number of functions whose "upper-level function" is "software startup", and obtain the number N1 = 2 of the first-level functions of the software. Establish the root node of the tree, corresponding to the software startup. Establish N1 child nodes of the root node, corresponding to the N1 first-level functions respectively. According to the preset keywords and grammar, extract the description of the above-mentioned first-level functions and their corresponding input generation method descriptions, and fill in the corresponding child nodes. In the above embodiment, a root node and two child nodes of the root node are established, corresponding to the two functions of the first layer: A and B, respectively. For each child node, a corresponding data structure is established and memory space is applied for. According to the preset keywords and grammar, the description of the above-mentioned first-level functions and their corresponding input generation method descriptions are extracted and filled in the above-mentioned data structure. Taking function A as an example, the following data structure is established to save the description of the function:

[0133] struct FUNCTION {

[0134] char * name;

[0135] char *upperLevel;

[0136] char * lowerLevel;

[0137] char * inputName;

[0138] char * outputName;

[0139] };

[0140] Retrieve the value of "input" "Function A input" and get that function A has 1 input. Create a data structure as follows to store the description of how the input is generated:

[0141] struct INPUT {

[0142] char * name;

[0143] int sourceType;

[0144] int inputType;

[0145] int inputsize;

[0146] int distrinbution;

[0147] char * parameter;

[0148] int arrivalType;

[0149] int intensity;

[0150] };

[0151] Retrieve the value of "output" "Function A output" and find that function A has 1 output. Create a data structure as follows to store the output generation method:

[0152] struct INPUT {

[0153] char * name;

[0154] int sourceType;

[0155] int inputType;

[0156] int inputsize;

[0157] int arrivalType;

[0158] int intensity;

[0159] };

[0160] Afterwards, for the jth node of the i-th layer of the tree structure, when the lower-level function in the corresponding function description is empty, no new child node is created, otherwise Nij child nodes are created, corresponding to the Nij lower-level functions that the corresponding function of the above node can enter. According to the name, preset keywords and grammar of the above lower-level function, the description of the above lower-level function and its corresponding input generation method description are extracted in the work manual, and the corresponding child nodes are filled in. In the above embodiment, for the first node of the first layer of the tree structure, the corresponding lower-level function is 1, named "C", that is, N11=1, then 1 child node is created. Search for the function with the function name "C" in the work manual, and the corresponding data structure can be established and memory space can be applied according to the method of the above steps. According to the preset keywords and grammar, the description of the function and its corresponding input generation method description are extracted and filled in the above data structure. The lower-level function of node C of the second layer of the tree structure is "none", so no new child node is created. In this embodiment, the function call tree is constructed by creating a root node and child nodes of various levels corresponding to the application function, and then filling the application-related information into the node. This ensures the accuracy and effectiveness of test case generation. By automatically extracting the function description from the work manual and expressing it as a tree structure, the corresponding test cases are generated based on the tree structure. Compared with traditional methods, this automated process reduces the workload of manually writing test cases and improves the efficiency of generating operation sequences.

[0161] In an exemplary embodiment, step 205 includes: obtaining test path range information and historical test information; traversing the tree structure of the function call tree to generate a test path; screening the generated test path according to the test path range information and historical test information to obtain a target test path that is within the test path range and has not been tested; and generating a test case corresponding to the target test path.

[0162] Exemplarily, for the test case generation process, the test case needs to cover all functions possessed by the measurement terminal software, but some functions are not necessarily within the scope of the current test. Therefore, before generating the test case, it is necessary to first obtain the test path range information and historical test information corresponding to the current test process to determine the coverage of the current test process, and at the same time determine which test paths have been tested to avoid the problem of reduced efficiency caused by repeated testing. The test path range information can be specifically determined based on the test option information set by the test staff. In addition, the test option information can also include: the number of tests and normal / abnormal data tests. According to the test path range information and historical test information, the generated test path is screened to obtain the target test path within the test path range and not tested, and the target test path can be specifically a set of function sequences recorded in the function call tree. For example, for the above-mentioned embodiment, a path within the test path range that has not been detected and has a test option can be selected. Taking the path software startup->A->C as an example, the generated function sequence is: {software startup, A, C}, and the current operation is initialized as software startup. In this embodiment, test cases that are within the test scope and have not been tested are generated based on the test path range information and historical test information, thereby effectively ensuring the efficiency and accuracy of the test process. By traversing the tree structure, it is easy to achieve full coverage testing of software functions, effectively improving the comprehensiveness and coverage of the test.

[0163] In an exemplary embodiment, the method also includes: obtaining a functional input description and a device output description of a test case; creating data buffers corresponding to different data names based on the functional input description and the device output description, the virtual device control instructions are used to control the virtual device to generate corresponding test data, and place the test data into the data buffer, and send the test data from the data buffer to the measurement terminal software on the virtual measurement terminal.

[0164] For example, for a specific test process, the input data of each function or the output data of each device is generated, and these input and output data can be stored in a data buffer. Specifically, according to the description of the input data of the current function or the output data of the device, a data buffer can be established for each data name, and its data type is the data type corresponding to the above output noun, and its size is equal to the data area size corresponding to the above data name. For example, a data buffer of int size can be established for "function A input", and a data buffer containing 10 floats can be established for the output data of device D.

[0165] In addition, for different types of data, the way of putting them into the data buffer is also different. If the data source corresponding to a certain data name is external input, a predetermined method is used to obtain data of the data area size from outside the software and fill it into the data buffer; if the data source corresponding to a certain data name is simulation, random data of the input data area size is generated and filled into the data buffer according to the data type, data area size, probability distribution, distribution parameter, arrival mode, arrival intensity and the test option setting in step S3. In the above embodiment, for the input of function A, its data source is "simulation", and the input data is generated by simulation. Because the data area size is 1 and the arrival mode is single, when the test option is normal data test, according to the probability distribution and distribution parameter, a random number between -10.0 and 10.0 is generated and put into the data buffer. When the test option is abnormal data test, data outside the interval [-10.0, 10.0] is randomly generated and put into the data buffer. For the output of device D, its data source is "external input", and the test data prepared in advance is put into the data buffer, and device D sends it to the application program through the virtual downstream interface at a uniform sampling rate of 1kHz. In this embodiment, a data buffer is created according to the function input description and the device output description, and then the data transmission processing of the test process is realized based on the data buffer, which effectively ensures the efficiency and accuracy of the test data processing of the test process. By establishing a virtual environment that simulates the special software and hardware of the measurement terminal, the measurement terminal application is tested in an environment close to the actual environment, and the evaluation results can better reflect the performance of the application in reality.

[0166] In an exemplary embodiment, the method further includes: based on the test results of the measurement terminal software, evaluating various performances of the measurement terminal software to obtain performance evaluation results; summarizing the performance evaluation results to generate a test report for the measurement terminal software.

[0167] Exemplarily, for the specific process of obtaining the test results, it is necessary to first evaluate the various performances of the measurement terminal software based on the test results of the measurement terminal software to obtain the performance evaluation results. The test results specifically include the monitored application, virtual main station, virtual device memory usage, port and API calls, input and output, program operation abnormalities (including program crashes, deadlocks, memory out of bounds, port abnormal access, program return value abnormalities, system and hardware API conflicts, etc.) and other information. These test results will be recorded in the test log. And through these test results, the running status of the application, virtual main station, and virtual device is determined, so as to evaluate the various performances of the measurement terminal software, obtain the performance evaluation results, evaluate the functional and non-functional performance of the measurement terminal software, and form a final test report. In this embodiment, the various performances of the measurement terminal software are evaluated through the test results to obtain the performance evaluation results, thereby forming a final test report. The test report can more intuitively and effectively display the test results of the measurement terminal software.

[0168] In one embodiment, the specific process of the measurement terminal software testing method of the present application is shown in FIG4, including: step 401, using preset keywords and syntax to write a work manual. Step 403, traverse the work manual, extract the names and call relationships of all functions, and represent them as a tree structure. Step 405, set the test options. Step 407, select a path on the above tree structure that has not been tested and is within the test path range of the test option, generate a set of function sequences and send them to the virtual master station. Step 409, the virtual master station sends an instruction to execute the function to the application to be tested in the virtual measurement terminal through the virtual uplink interface in the order of the function sequence, and the application performs the corresponding operation according to the instruction. When it is necessary to read the device parameters, the instruction is sent to the virtual device through the virtual downlink interface. The virtual device generates corresponding data according to the device output data description obtained by the work manual parsing module and sends it to the application to be tested through the virtual downlink interface. Step 411, the performance evaluation module monitors and records the running status of the application, virtual master station, and virtual device. Step 413, is there any function in the function sequence that has not been executed? If yes, go to step 415, if not, go to step 417. Step 415, execute the next function in the function sequence in order. Step 417, is the simulation finished? If yes, proceed to step 419, if not, return to step 407. Step 419, the performance evaluation module evaluates the performance of the application according to the running status of the application, the virtual host station, and the virtual device.

[0169] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0170] Based on the same inventive concept, the embodiment of the present application also provides a measurement terminal software testing system for implementing the measurement terminal software testing method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more measurement terminal software testing system embodiments provided below can refer to the limitations of the measurement terminal software testing method above, and will not be repeated here.

[0171] In an exemplary embodiment, as shown in FIG5 , a measurement terminal software testing system is provided, including: a virtual main station 502, a virtual uplink interface 504, a virtual measurement terminal 506, a virtual downlink interface 508, a virtual device 510, a work manual parsing module 512, a tree structure generating module 514, a function sequence generating module 516, and a performance evaluation module 518. The virtual main station 502, the virtual uplink interface 504, the virtual measurement terminal 506, and the virtual downlink interface 508 are connected in sequence, the virtual downlink interface 508 is connected to a plurality of virtual devices 510, and the measurement terminal software to be tested is run on the virtual measurement terminal 506, wherein:

[0172] The work manual parsing module 512 is used to traverse the work manual of the measurement terminal software and extract the function names and calling relationships of the measurement terminal software.

[0173] The tree structure generation module 514 is used to perform tree generation processing based on the function name and the call relationship to obtain a function call tree.

[0174] The function sequence generation module 516 is used to perform test case generation processing according to the tree structure of the function call tree to obtain test cases for the measurement terminal software.

[0175] The virtual master station 502 is used to generate measurement program control instructions and virtual device control instructions based on test cases, and send the measurement program control instructions to the measurement terminal software on the virtual measurement terminal 506, and send the virtual device control instructions to the virtual device 510 through the virtual master station 502, so as to measure and process the device output data of the virtual device 510 through the measurement terminal software.

[0176] The performance evaluation module 518 is used to perform application performance evaluation based on the running status of the virtual master station, the running status of the measurement terminal software and the running status of the virtual device to obtain the test result of the measurement terminal software.

[0177] In one embodiment, it also includes a work manual generation module, which is used to: obtain software function description information and device generated data description information of the measurement terminal software; based on preset keywords and preset grammar, parse and process the software function description information and the device generated data description information respectively to obtain parsed text; summarize the parsed text to generate a work manual for the measurement terminal software.

[0178] In one embodiment, the tree structure generation module 514 is specifically used to: establish a root node corresponding to the software startup; establish each layer of child nodes corresponding to the software function based on the function name and the calling relationship, and fill the function description and input generation method description corresponding to the function name into the corresponding child node; generate a function call tree based on the root node and the child nodes.

[0179] In one embodiment, the function sequence generation module 516 is specifically used to: obtain test path range information and historical test information; traverse the tree structure of the function call tree to generate a test path; filter the generated test path according to the test path range information and historical test information to obtain a target test path that is within the test path range and has not been tested; and generate a test case corresponding to the target test path.

[0180] In one embodiment, as shown in Figure 5, it also includes an input data generation module, which is used to: obtain the functional input description and device output description of the test case; create data buffers corresponding to different data names based on the functional input description and device output description, and the virtual device control instructions are used to control the virtual device to generate corresponding test data, and place the test data into the data buffer, and send the test data from the data buffer to the measurement terminal software on the virtual measurement terminal.

[0181] In one embodiment, a report generation module is further included, which is used to: evaluate various performances of the measurement terminal software based on the test results of the measurement terminal software to obtain performance evaluation results; summarize the performance evaluation results and generate a test report for the measurement terminal software.

[0182] Each module in the above-mentioned measurement terminal software test system can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.

[0183] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data of the measurement terminal software test 1. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a measurement terminal software testing method is implemented.

[0184] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0185] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0186] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0187] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0188] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0189] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0190] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0191] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A measurement terminal software testing method, applied to a measurement terminal software testing system, characterized in that: The measurement terminal software testing system comprises a virtual main station, a virtual uplink interface, a virtual measurement terminal, a virtual downlink interface, and a plurality of virtual devices connected to the virtual downlink interface, wherein the measurement terminal software to be tested runs on the virtual measurement terminal; The method comprises: Traversing the work manual of the measurement terminal software, extracting the function names and calling relationships of the measurement terminal software; Perform tree generation processing based on the function name and the call relationship to obtain a function call tree; Perform test case generation processing according to the tree structure of the function call tree to obtain a test case for the measurement terminal software; Generate a measurement program control instruction and a virtual device control instruction based on the test case, send the measurement program control instruction to the measurement terminal software on the virtual measurement terminal through the virtual master station, and send the virtual device control instruction to the virtual device through the virtual master station, so as to measure and process the device output data of the virtual device through the measurement terminal software; Based on the running status of the virtual main station, the running status of the measurement terminal software and the running status of the virtual device, application program performance evaluation processing is performed to obtain the test result of the measurement terminal software.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining software function description information of the measurement terminal software and device-generated data description information; Based on preset keywords and preset grammars, the software function description information and the device generated data description information are parsed and processed respectively to obtain parsed texts; The parsed texts are summarized to generate a work manual for the measurement terminal software.

3. The method according to claim 1, characterized in that: The tree generation process is performed based on the function name and the call relationship to obtain the function call tree, which includes: Establish a root node corresponding to software startup; Establishing sub-nodes of each layer corresponding to the software function based on the function name and the calling relationship, and filling the function description and input generation method description corresponding to the function name into the corresponding sub-node; A function call tree is generated according to the root node and the child nodes.

4. The method according to claim 1, characterized in that: The step of performing test case generation processing according to the tree structure of the function call tree to obtain the test case of the measurement terminal software includes: Get test path range information and historical test information; Traversing the tree structure of the function call tree to generate a test path; Screening the generated test paths according to the test path range information and the historical test information to obtain target test paths that are within the test path range and have not been tested; Generate a test case corresponding to the target test path.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Obtaining a functional input description and a device output description of the test case; Based on the function input description and the device output description, data buffers corresponding to different data names are created. The virtual device control instructions are used to control the virtual device to generate corresponding test data, place the test data into the data buffer, and send the test data from the data buffer to the measurement terminal software on the virtual measurement terminal.

6. The method according to claim 1, characterized in that The method further comprises: Based on the test results of the measurement terminal software, various performances of the measurement terminal software are evaluated to obtain performance evaluation results; The performance evaluation results are summarized to generate a test report for the measurement terminal software.

7. A measurement terminal software testing system, characterized in that: The measurement terminal software testing system comprises a virtual main station, a virtual uplink interface, a virtual measurement terminal, a virtual downlink interface, and a plurality of virtual devices connected to the virtual downlink interface in sequence, wherein the measurement terminal software to be tested, a work manual parsing module, a tree structure generating module, a function sequence generating module, and a performance evaluation module are run on the virtual measurement terminal; The work manual parsing module is used to traverse the work manual of the measurement terminal software and extract the function names and calling relationships of the measurement terminal software; The tree structure generation module is used to perform tree generation processing based on the function name and the call relationship to obtain a function call tree; The function sequence generation module is used to perform test case generation processing according to the tree structure of the function call tree to obtain the test case of the measurement terminal software; The virtual master station is used to generate a measurement program control instruction and a virtual device control instruction based on the test case, and send the measurement program control instruction to the measurement terminal software on the virtual measurement terminal, and send the virtual device control instruction to the virtual device through the virtual master station, so as to measure and process the device output data of the virtual device through the measurement terminal software; The performance evaluation module is used to perform application performance evaluation processing based on the operating status of the virtual master station, the operating status of the measurement terminal software and the operating status of the virtual device to obtain the test result of the measurement terminal software.

8. The system according to claim 7, characterized in that The tree structure generation module is specifically used to: establish a root node corresponding to the software startup; establish each layer of sub-nodes corresponding to the software function based on the function name and the calling relationship, and fill the function description and input generation method description corresponding to the function name into the corresponding sub-node; generate a function call tree according to the root node and the sub-nodes.

9. The system according to claim 7, characterized in that The function sequence generation module is specifically used to: obtain test path range information and historical test information; traverse the tree structure of the function call tree to generate a test path; filter the generated test path according to the test path range information and the historical test information to obtain a target test path that is within the test path range and has not been tested; Generate a test case corresponding to the target test path.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.