Universal test system based on scripts
By designing a general script-based test system, the existing dedicated test system has been solved, and an efficient, accurate and reliable test process that meets various test needs is achieved.
Patent Information
- Application Number
- CN202411108543.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-10-27
- Filing Date
- 2024-08-13
- Publication Date
- 2025-02-07
AI Technical Summary
The existing dedicated testing systems are poor in flexibility, difficult to adapt to different testing needs, and difficult to maintain, which cannot meet the high requirements of modern testing for accuracy and efficiency.
A general script-based testing system was designed, including instrument configuration subsystem, test script development subsystem, test script execution subsystem and test record management subsystem. Through these subsystems, the configuration of test instruments and the development of test scripts is realized. and execution, data collection and analysis can adapt to various testing needs.
It improves testing efficiency, accuracy and reliability, realizes customized testing processes for different test tasks, reduces the probability of repeated development, and improves test development efficiency.
Smart Images

Figure CN119396704A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automated testing, and in particular to a script-based universal testing system. Background Art
[0002] Dedicated test systems are customized for specific test objects and test requirements, so they can only be used for specific test occasions and cannot be used for other test requirements. In addition, due to the customized design, different test requirements require redesign or purchase of new equipment, which has poor flexibility and low development efficiency. At the same time, since it is a dedicated equipment, when the equipment fails, it is difficult to find suitable personnel for repair, which will affect the progress and quality of the test. With the development of science and technology, both military equipment and industrial equipment have put forward higher requirements for test accuracy and efficiency, and dedicated test systems can no longer meet current test needs.
[0003] Therefore, it is of great significance to study a universal, extensible and customizable testing software architecture. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a script-based universal testing system to solve the above problems.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0006] A script-based general testing system, including:
[0007] An instrument configuration subsystem configures the test instrument information for the test case and generates an instrument configuration information file;
[0008] The test script development subsystem is used for secondary development of test processes that can complete specific test requirements and generate test script files;
[0009] The test script execution subsystem is used to execute the test script file, parse the script test process into actual actions, and apply them to the instrument so that the instrument executes the actions according to the subsystem command;
[0010] Test record management subsystem, used to replay or delete historical test data.
[0011] Furthermore, the above-mentioned script-based universal test system includes the following steps:
[0012] S1: Requirements analysis: Analyze the test requirements and determine whether the current system hardware resources meet the test requirements;
[0013] If it meets the test requirements, enter the instrument configuration subsystem;
[0014] If it does not meet the test requirements, expand the hardware resources and develop subsystems;
[0015] S2: Subsystem development: After determining the required hardware instruments, start test strategy development and enter the test script development subsystem;
[0016] S3: Subsystem execution: After the development and design of the test script is completed, the test script execution subsystem is entered. This subsystem executes specific test steps by sequentially parsing the commands and parameters in the execution script file;
[0017] S4: Subsystem parsing: After executing the script, the system starts parsing the script commands;
[0018] If the current script command does not match or the parameter format is wrong, the script execution program will be terminated and the test will exit;
[0019] If the match is successful, the corresponding steps are executed. After parsing the UI command, a test interface will be dynamically generated, and the process of operating the script command will be operated through the test interface;
[0020] S5: Instrument execution: Executes instrument operation related commands, calls related instrument drivers according to the relevant contents of the instrument information configuration file, opens and configures the hardware instrument, and collects the signal output by the test object to obtain the collected data;
[0021] S6: Enter the test record management subsystem, where you can view / delete test records. When waveform data is saved in a test record, you can display the waveform data by executing commands.
[0022] Furthermore, the instrument configuration subsystem configures the test instruments as required and stores the configurations in a configuration file.
[0023] Furthermore, the script file is written by a script editor.
[0024] Furthermore, the test script execution subsystem includes generating a specific test interface, starting and completing instrument configuration according to the instrument configuration information file, controlling the excitation source to output an excitation signal to the test object, collecting the output signal of the test object, performing data processing and analysis, and including data display storage and report generation.
[0025] Further, in S1, the expansion method is: if the driver of the expanded hardware already exists in the system, it is only necessary to connect the hardware device to the system;
[0026] If the driver does not exist in the system, the developer needs to expand the driver library, redevelop the subsystem, and then connect it to the system.
[0027] Further, in S2, the steps of subsystem development are: opening the command registration interface, selecting the target dynamic link library, designing the user command and parameter format, adding the command into the system command set after completing the registration, and directly entering the secondary development interface if there is no special processing function, combining commands and writing parameters according to a certain test logic, and finally generating a test script;
[0028] The commands are divided into five groups:
[0029] ①Instrument operation command group: used to control hardware instruments;
[0030] ②Database operation command group: used to provide some basic operations of the database;
[0031] ③Data processing command group: used to perform calculations on the collected data, such as calculating the average value, calculating the phase difference between two sets of data, etc.;
[0032] ④UI command group: used for custom design of test interface. The generated test interface is generated by executing this group of test commands;
[0033] ⑤Process control command group: used to control the test process.
[0034] Furthermore, in S5, the collected data is processed by parsing data processing related commands to obtain test results, and the test results are automatically written into reports, and key data groups are saved into the database by parsing database related commands.
[0035] The present invention provides a script-based universal testing system, which has the following beneficial effects:
[0036] In the present invention, the subsystem architecture of this test system has the characteristics of scalability, high efficiency, flexibility, visualization and automation, can improve test efficiency, accuracy and reliability, adapt to various test needs, and realize the customization of exclusive test processes and execution of tests for different test tasks, thereby reducing the probability of repeated development and improving test development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a system flow diagram of the script universal testing system in the present invention;
[0038] Figure 2 It is a schematic diagram of the secondary development interface in the present invention;
[0039] Figure 3 This is a display diagram of the amplitude-frequency characteristics of the test interface in the present invention when testing the low-pass filter circuit;
[0040] Figure 4 It is a schematic diagram of the control in the present invention. DETAILED DESCRIPTION
[0041] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thoroughly understood.
[0042] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only and do not represent the only implementation method.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0044] See also Figure 1-4 The present invention provides a technical solution:
[0045] A script-based general testing system, including:
[0046] The instrument configuration subsystem configures the test instrument information for the test case and generates the instrument configuration information file. In this subsystem, the user needs to set the required test instrument configuration, including device model, test channel, measurement parameters, etc. The system stores these configurations in a configuration file so that the test script execution subsystem can read and use them;
[0047] The test script development subsystem is used for secondary development of test processes that can complete specific test requirements and generate test script files; a test script is a set of instructions used to describe each step, implementation, and condition in the test process. In the test script development subsystem, users can use the script editor to write test scripts, such as Figure 2As shown in: The script editor includes a configuration display interface, an editing interface, a command display interface, and a command parameter prompt interface, wherein the configuration display interface is used to display the hardware configuration content of the test task, the editing interface is used to select commands and parameters / manually input parameters, the command display interface is used to edit the completed commands and display parameters, and the command parameter prompt interface is used to select a command and prompt the command description and parameter format;
[0048] A test script execution subsystem is used to execute the test script file, parse the script test process into actual actions, and apply it to the instrument, so that the instrument executes actions according to the subsystem command, including generating a specific test interface, including starting and completing the instrument configuration according to the instrument configuration information file, including controlling the excitation source to output the excitation signal to the test object, including collecting the test object output signal, including data processing and analysis, including data display storage and report generation; completing the instrument configuration according to the instrument configuration information, controlling the excitation source to output the excitation signal to the test object, the test object executes actions according to the subsystem command, collecting the test object output signal, performing data processing and analysis, data display storage and report generation and other operations; automatically outputting the test report according to the test result, and comparing it with the previous test result to determine whether the test result meets the expectation, and automatically outputting the test report according to the test result, and comparing it with the previous test result to determine whether the test result meets the expectation;
[0049] The test record management subsystem is used to replay or delete historical test data. During the test process, all test data will be stored in the system, including the data collected and processed during the test process, as well as the generated test report. Users can use the test record management subsystem to view and replay historical test data, or delete unnecessary test data to free up storage space and improve system performance.
[0050] The advantages of the above solution are: the subsystem architecture of this test system is scalable, efficient, flexible, visualized and automated, which can improve test efficiency, accuracy and reliability, adapt to various test needs, and realize the customization of exclusive test processes and execution of tests for different test tasks, reducing the probability of repeated development and improving test development efficiency.
[0051] In this embodiment, after obtaining the test script task, the workflow of this solution is as follows:
[0052] S1: Demand analysis: Analyze the test requirements and determine whether the current system hardware resources (referring to the ad acquisition module and IO control module) meet the test requirements;
[0053] Includes a test hardware resource description file, which includes a test resource description, a test channel configuration description, and a bus and interface description;
[0054] Test resource description: This includes all test-related hardware resources, such as AD acquisition modules and IO control modules. It is necessary to describe the type, model, quantity and other information of these hardware resources, as well as their location and connection method in the system;
[0055] Test channel configuration description: For AD data acquisition instruments, the configuration information of each channel needs to be described. This includes the number of channels, the signal name of the channel access, the sampling rate, the sampling point, etc. For IO control instruments, the configuration information of each port needs to be described, including the number of ports and the input and output directions of the ports;
[0056] Bus and interface description: If the bus and interface between the instrument and the system are involved, their types, protocols, connection methods, etc. need to be described in detail. For example, the bus type (such as USB, Ethernet, etc.) and device address of the instrument can be described, as well as the interface for communicating with the system.
[0057] If it meets the test requirements, enter the instrument configuration subsystem. The configured instruments include AD data acquisition instruments, which describe the configuration information including instrument bus type, device address, number of channels, signal name of channel access, sampling rate, sampling point, sampling signal type (voltage / current), maximum value, and minimum value; IO control instruments, which describe the configuration information including instrument bus, instrument address, number of ports, port input and output direction, and finally generate an instrument information configuration file (.xml);
[0058] If it does not meet the test requirements, the hardware resources are expanded. The expansion method is as follows: if the driver of the expanded hardware already exists in the system, it is only necessary to connect the hardware device to the system;
[0059] If the driver does not exist in the system, the developer needs to expand the driver library, redevelop the subsystem, and then connect it to the system.
[0060] S2: Subsystem development: After determining the required hardware instruments, start test strategy development and enter the test script development subsystem;
[0061] The steps are:
[0062] Open the command registration interface, select the target dynamic link library, design the user command and parameter format, and add the command to the system command set after registration. If there is no special processing function, directly enter the secondary development interface, combine commands according to certain test logic and write parameters, and finally generate a test script;
[0063] The commands are divided into five groups:
[0064] ①Instrument operation command group: used to control hardware instruments;
[0065] ②Database operation command group: used to provide some basic operations of the database;
[0066] ③Data processing command group: used to perform calculations on the collected data, such as calculating the average value, calculating the phase difference between two sets of data, etc.;
[0067] ④UI command group: used for custom design of test interface. The generated test interface is generated by executing this group of test commands;
[0068] ⑤Process control command group: used to control the test process, such as looping certain test steps, jumping to certain test steps, etc.);
[0069] If you need to perform special data processing algorithms, you can expand the user commands yourself, provided that you write the data processing function in C / C++ language in advance and generate a dynamic link library;
[0070] S3: Subsystem execution: After the development and design of the test script is completed, enter the test script execution subsystem; this subsystem executes specific test steps by sequentially parsing the commands and parameters in the execution script file.
[0071] It should be noted that the prerequisite for executing the script is that the hardware instruments and the object to be tested required for the test have been connected. For example, to test the amplitude-frequency characteristics of a circuit board, you need an AD data acquisition instrument with more than one channel and a signal generator. Connect the output of the signal generator to the input of the circuit board through a connecting line and an adapter, and connect the output of the circuit board to the input of the AD data acquisition instrument.
[0072] S4: After executing the script, the system starts parsing the script commands;
[0073] If the current script command does not match or the parameter format is wrong, the script execution program will be terminated and the test will exit;
[0074] If the match is successful, the corresponding steps are executed. After parsing the UI command, a test interface will be dynamically generated. Some basic controls in the test interface (such as the start test button, etc.) are fixed. Other contents, such as the number and display content of the oscilloscope (waveform display box), buttons and some other combined controls, are generated according to the script command;
[0075] In step S4: the test interface includes:
[0076] Dynamic display: During the script execution, the displayed content or waveform will change in real time;
[0077] Static display: During script execution, the content will not change after it is displayed;
[0078] like Figure 3 and Figure 4 As shown in: This embodiment provides a test interface for testing the amplitude-frequency characteristics of a low-pass filter circuit. The test interface of this example is introduced as follows:
[0079] This experiment only collects one signal after filtering. The test interface is as follows: Figure 3 As shown in:
[0080] There is only one waveform display box in the figure, which is used to display one waveform signal;
[0081] Area ① is used to display the signal name set in the command. There is only one signal in this test case, and the waveform in the box represents the waveform of this signal.
[0082] If there are multiple signals, they will be distinguished by different colors, and up to 16 signals can be displayed.
[0083] Area ② is used for numerical display. There is no relevant numerical display in this test case, so it is blank. If it is set in the command, a similar Figure 4 This form of control.
[0084] Area ③ is fixed and cannot be changed.
[0085] Area ④ is the custom control area, which generates different controls according to the commands;
[0086] Area ⑤ is used to display commands that have been executed or are being executed.
[0087] How to dynamically generate the test interface: Except for area ③ (i.e. basic controls) and the unmarked areas, controls can be added through commands;
[0088] S5: Executes instrument operation related commands, calls related instrument drivers according to the related contents of the instrument information configuration file, opens and configures the hardware instrument, and collects the signal output by the test object to obtain the collected data, or controls the signal generator to output a fixed signal to the test object, etc. For the collected data, the data is processed by parsing the data processing related commands to obtain the test results, and the test results are automatically written into the report, and the key data groups are saved into the database by parsing the database related commands.
[0089] S6: Enter the test record management subsystem, you can delete the expired test records, and you can also view the test data of the historical test records. When a test record contains waveform data, you can display the waveform data by executing commands.
[0090] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A script-based universal testing system, characterized by: include: An instrument configuration subsystem configures the test instrument information for the test case and generates an instrument configuration information file; The test script development subsystem is used for secondary development of test processes that can complete specific test requirements and generate test script files; The test script execution subsystem is used to execute the test script file, parse the script test process into actual actions, and apply them to the instrument so that the instrument executes the actions according to the subsystem command; Test record management subsystem, used to replay or delete historical test data.
2. A script-based universal test system as claimed in claim 1, characterized in that: The workflow includes the following steps: S1: Requirements analysis: Analyze the test requirements and determine whether the current system hardware resources meet the test requirements; If it meets the test requirements, enter the instrument configuration subsystem; If it does not meet the test requirements, expand the hardware resources and develop subsystems; S2: Subsystem development: After determining the required hardware instruments, start test strategy development and enter the test script development subsystem; S3: Subsystem execution: After the development and design of the test script is completed, the test script execution subsystem is entered. This subsystem executes specific test steps by sequentially parsing the commands and parameters in the execution script file; S4: Subsystem parsing: After executing the script, the system starts parsing the script commands; If the current script command does not match or the parameter format is wrong, the script execution program will be terminated and the test will exit; If the match is successful, the corresponding steps are executed. After parsing the UI command, a test interface will be dynamically generated, and the process of operating the script command will be operated through the test interface; S5: Instrument execution: Executes instrument operation related commands, calls related instrument drivers according to the relevant contents of the instrument information configuration file, opens and configures the hardware instrument, and collects the signal output by the test object to obtain the collected data; S6: Enter the test record management subsystem, where you can view / delete test records. When waveform data is saved in a test record, you can display the waveform data by executing commands.
3. A script-based universal test system as claimed in claim 1, characterized in that: The instrument configuration subsystem configures the test instruments according to the requirements and stores the configurations in a configuration file.
4. A script-based universal test system as claimed in claim 1, characterized in that: The script file is written by a script editor.
5. A script-based universal test system as claimed in claim 4, characterized in that: The script editor includes a configuration display interface, an editing interface, a command display interface and a command parameter prompt interface. The configuration display interface is used to display the hardware configuration content of the test task, the editing interface is used to select commands and parameters / manually enter parameters, the command display interface is used to edit the completed commands and parameters, and the command parameter prompt interface is used to prompt the command description and parameter format when a command is selected.
6. A script-based universal test system as claimed in claim 1, characterized in that: The test script execution subsystem includes generating a specific test interface, starting and completing instrument configuration according to the instrument configuration information file, controlling the excitation source to output an excitation signal to the test object, collecting the output signal of the test object, performing data processing and analysis, and displaying, storing and generating reports.
7. A script-based universal test system as claimed in claim 2, characterized in that: In S1, the expansion method is: if the driver of the expanded hardware already exists in the system, it is only necessary to connect the hardware device to the system; If the driver does not exist in the system, the developer needs to expand the driver library, redevelop the subsystem, and then connect it to the system.
8. A script-based universal test system as claimed in claim 2, characterized in that: In S2, the steps of subsystem development are: open the command registration interface, select the target dynamic link library, design the user command and parameter format, add the command to the system command set after registration, and directly enter the secondary development interface if there is no special processing function, combine commands according to certain test logic and write parameters, and finally generate a test script; The commands are divided into five groups: ①Instrument operation command group: used to control hardware instruments; ②Database operation command group: used to provide some basic operations of the database; ③Data processing command group: used to perform calculations on the collected data, such as calculating the average value, calculating the phase difference between two sets of data, etc.; ④UI command group: used for custom design of test interface. The generated test interface is generated by executing this group of test commands; ⑤Process control command group: used to control the test process.
9. A script-based universal test system as claimed in claim 2, characterized in that: In S5, the data is collected, and data processing is performed by parsing data processing related commands to obtain test results, and the test results are automatically written into reports, and key data groups are saved into the database by parsing database related commands.
10. A script-based universal test system as claimed in claim 2, characterized in that: In S4, the test interface includes dynamic display and static display. Dynamic display means that the displayed content or waveform will change in real time during the script execution; static display means that the content will not change after being displayed during the script execution.
Citation Information
Patent Citations
Automatic detection system of embedded type system based on testing script technique
CN101833498A
Automated test platform implemented by means of Python
CN107992428A