A hardware automated testing method, device and computer device
By building an abstract test model and using instructions in JSON format, the problem of flexibility and adaptability of hardware automated testing is solved, efficient and standardized test processes and report generation are achieved, and test efficiency and data reliability are improved.
Patent Information
- Application Number
- CN202410741236.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing hardware automated testing lacks flexibility and adaptability, and is difficult to adapt to complex hardware interfaces and diverse hardware configurations, resulting in testing that is difficult to maintain and inefficient.
By creating an abstract test model, it is divided into model layer, module layer, interface layer, status layer and indicator layer, using JSON format to write test instructions and status instructions, and combining prompt pictures and text to realize the mounting of instructions and prompts. Simplify the test operation process and generate test report templates to improve testing efficiency.
It improves the flexibility and adaptability of automated testing, simplifies the testing operation process, saves testing time, and enhances the reliability of data and the standardization of reports.
Smart Images

Figure CN118312371B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of hardware automation testing, and in particular to a hardware automation testing method, device and computer device. Background Art
[0002] Automated testing of hardware devices refers to the use of software tools and automated equipment to perform testing activities to verify the functions, performance, and stability of hardware devices without human intervention. This type of testing usually involves the integration of physical hardware devices and test systems to simulate real usage scenarios and environments. In the automated testing of hardware devices, testers use various automated testing tools and frameworks to execute test cases and collect and analyze test results. These tools and frameworks can be used for testing various types of hardware devices, including electronic devices, network devices, embedded systems, etc. In the field of hardware automated testing, although there are many mature methods and tools, there are still situations such as customized hardware devices, complex hardware interfaces and communication protocols, diverse hardware configurations and environments, and rapidly changing hardware technologies and standards, which may lead to problems such as lack of high flexibility and difficulty in maintenance of automated testing. Therefore, how to build a universally applicable hardware automated testing is a problem that needs to be considered at present. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a hardware automated testing method, device and computer device to improve the flexibility and adaptability of automated testing.
[0004] The present invention adopts the following technical solutions to achieve the above-mentioned purpose. In a first aspect, the present invention provides a hardware automation testing method, comprising:
[0005] S1. Create indicators;
[0006] When creating an indicator, first select the test device for the indicator, then create a command under the test device. This command is different from the test and status commands and is used to classify different types of indicators under the same device and as the target for mounting the test command. Finally, create the indicator at the next level of the command.
[0007] S2, build a test model;
[0008] The test object is abstracted into a test model, which is composed of a model layer, a module layer, an interface layer, a state layer and an indicator layer in a top-down tree structure. The model layer is used to distinguish different test objects, the module layer is used to distinguish the system modules of the test object, the interface layer is used to distinguish different physical interfaces of the test object, the state layer is used to distinguish different signal output states under the same interface or the working state of the test object, and the indicator layer is used to create all indicators that need to be tested under the corresponding state of the interface, and is used to mount test instructions and prompts. When the indicator is created, a unique label is automatically generated;
[0009] S3, write instructions and prompts;
[0010] The instructions include test instructions and status instructions. Test instructions are used to set various parameters of the device and replace manual control of the device to test various indicators. Status instructions are used to set the working state of the object under test and adjust the working state of the object under test to the state to be tested. Both instructions are written in JSON format;
[0011] The status prompt is used to remind the tester to perform wiring or switch control test preparation during the test. It consists of prompt pictures and prompt text. The prompt picture is created under the corresponding model and displays the test wiring method in the form of an image.
[0012] S4, mount;
[0013] Instructions and status prompts are associated with the model through mounting. Status instructions are mounted on the status layer of the test model, and test instructions and prompts are mounted on indicators.
[0014] S5. Create test items and test groups;
[0015] Test items are created under test models. The indicators that need to be tested are combined into an indicator set as the test content of the test item. A test group consists of multiple test items and is created under the model classification of the corresponding test type. Test types include maintenance tests, key point tests, and custom tests.
[0016] Furthermore, the method further comprises:
[0017] S6. Prepare and upload the test report template;
[0018] Corresponding test report templates are created for test items and test groups, and the test report templates are pre-uploaded to the test system in a set format. The values of each test data in the template are represented by indicator labels. After the test is completed, the test result values will cover the labels in the report template to generate a result report.
[0019] Furthermore, in S1, the indicator refers to the target returned by the test results, which is divided into two categories: dynamic indicators and composite indicators. Each dynamic indicator has its corresponding identifier, and the test results are returned to the indicator of the corresponding identifier; if the composite indicator does not have a corresponding identifier, the result value is calculated by checking the dynamic indicator or the created composite indicator in its properties and combining the corresponding formula.
[0020] Furthermore, in S3, the prompt part is composed of a model layer, a prompt package layer, and a prompt layer in a top-down tree structure. The model list in the model layer displays the models that have been created; according to the different chassis structures and wiring methods of different test systems, a prompt package layer is created to classify the prompts based on the test system chassis type; the prompt layer is used to edit specific prompt content, quote prompt pictures, and use text to describe the prompt content.
[0021] In a second aspect, the present invention provides a hardware automated testing device for implementing the above-mentioned hardware automated testing method, the automated testing device comprising:
[0022] The indicator creation module is used to create indicators. When creating an indicator, first select the test device of the indicator, then create an instruction under the test device. This instruction is different from the test and status instructions. It is used to classify different types of indicators under the same device and as the target of the test instruction. Finally, create the indicator at the next level of the instruction.
[0023] The test model construction module abstracts the test object into a test model. The test model is composed of a model layer, a module layer, an interface layer, a state layer and an indicator layer in a top-down tree structure. The model layer is used to distinguish different test objects, the module layer is used to distinguish the system modules of the test object, the interface layer is used to distinguish the different physical interfaces of the test object, the state layer is used to distinguish the different signal output states or the working states of the test object under the same interface, and the indicator layer is used to create all the indicators that need to be tested under the corresponding state of the interface, and is used to mount test instructions and prompts. When the indicator is created, a unique label is automatically generated;
[0024] The instruction and prompt module is used to write instructions and prompts. The instructions include test instructions and status instructions. Test instructions are used to set various parameters of the equipment and replace manual control equipment to test various indicators. Status instructions are used to set the working state of the object under test and adjust the working state of the object under test to the state to be tested. Both instructions are written in JSON format;
[0025] The status prompt is used to remind the tester to perform wiring or switch control test preparation during the test. It consists of prompt pictures and prompt text. The prompt picture is created under the corresponding model and displays the test wiring method in the form of an image.
[0026] The mounting module is used for mounting instructions and prompts. Instructions and status prompts are associated with the model through mounting. Status instructions are mounted on the status layer of the test model, and test instructions and prompts are mounted on indicators.
[0027] The test creation module is used to create test items and test groups. Test items are created under the test model. The indicators to be tested are combined into an indicator set as the test content of the test item. A test group consists of multiple test items and is created under the model classification of the corresponding test type. Test types include maintenance tests, key point tests, and custom tests.
[0028] Furthermore, the device also includes a reporting module, which is used to prepare corresponding test report templates for test items and test groups, and upload the test report templates to the test system in a set format in advance. The value of each test data in the template is represented by an indicator label. After the test is completed, the test result value will cover the label in the report template to generate a result report.
[0029] Furthermore, the indicators created by the indicator creation module refer to the targets returned by the test results, which are divided into two categories: dynamic indicators and composite indicators. Each dynamic indicator has its corresponding identifier, and the test results are returned to the indicators of the corresponding identifier; if the composite indicator does not have a corresponding identifier, the result value is calculated by checking the dynamic indicator or the created composite indicator in its properties and combining the corresponding formula.
[0030] Furthermore, the instruction and prompt module is specifically used to create the prompt part, which is composed of a model layer, a prompt package layer, and a prompt layer in a top-down tree structure. The model list in the model layer displays the models that have been created; according to the different chassis structures of different test systems and the differences in wiring methods, a prompt package layer is created to classify the prompts based on the test system chassis type; the prompt layer is used to edit specific prompt content, quote prompt pictures and use text to describe the prompt content.
[0031] In a third aspect, the present invention provides a computer device, including a memory, wherein the memory stores program instructions, and when the program instructions are executed, the hardware automation testing method as described above is executed.
[0032] The beneficial effects of the present invention are:
[0033] The present invention simplifies the test operation process, splits the hardware automation test into multiple components such as models, instructions, prompts, mounting, and report templates, and combines adaptive test models for different test objects, which has extremely high flexibility, maintainability, and adaptability. At the same time, the present invention includes the generation function of test prompts and reports, which improves the test efficiency while ensuring the standardization of the test report.
[0034] During the test process of the present invention, the tester does not need to perform other operations except the necessary wiring operations, thereby greatly saving the test time, standardizing the test process, and increasing the reliability of the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 The present invention provides a flowchart of a hardware automation testing method. DETAILED DESCRIPTION
[0036] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0037] like Figure 1 As shown, the present invention provides a hardware automation testing method, first, creating test indicators; then, abstracting the test object into a test model, filling the test indicators in the test model; then, writing test instructions, status instructions and test prompts; finally, mounting the instructions and prompts on the model, creating test items and test types, and generating a test result report.
[0038] Create indicators: Indicators are the targets returned by test results, and are divided into two categories: dynamic indicators and composite indicators. Each dynamic indicator has its corresponding identifier, and the test results are returned to the indicator of the corresponding identifier. Composite indicators do not have corresponding identifiers and cannot be automatically assigned values like dynamic indicators. You need to check the dynamic indicators or the composite indicators that have been created in their properties and calculate the result value based on the formula. When creating an indicator, first select the test device for the indicator, then create a command under the test device (this command is different from the test and status commands, and is used to classify different types of indicators under the same device, and as the target for mounting test commands), and finally create the indicator at the next level of the command.
[0039] Model construction: The test method of the present invention abstracts the test object into a test model, which is composed of five layers from top to bottom in a tree-like structure: model layer, module layer, interface layer, state layer, and indicator layer. The model layer is used to distinguish different test objects, the module layer is used to distinguish the system modules of the test object, the interface layer is used to distinguish the different physical interfaces of the test object, the state layer is used to distinguish the different signal output states or working states of the test object under the same interface, and the indicator layer is used to create all the indicators that need to be tested under the corresponding state of the interface, and is used for the mounting of test instructions and prompts. When the indicator is created, a unique label is automatically generated.
[0040] Specifically, first, create the indicators that need to be tested in the indicator management. Note that when creating indicators, the indicators should be created under the corresponding instruction package; then, divide the test object into different modules according to the composition. The composition can be divided according to the test object structure or the test content. Then create each interface under each module, and create a test state under the interface, that is, the signal type that the test object needs to output or the working state to be maintained during the test. Finally, create the indicators that need to be tested under the corresponding test state.
[0041] Writing instructions and tips: Test instructions are used to set various parameters of the device and replace manual control of the device to test various indicators. Status instructions are used to set the working state of the object under test and adjust the working state of the object under test to the state to be tested. Both instructions are written in JSON format.
[0042] Specifically, first, create an instruction package under the test device model to be controlled. The instruction package is used to include the same type of instructions under the test device model; then, create specific instructions under the instruction package. The contents of both instructions include two parts: property settings and function functions. The general instruction content flow is to first open the test device, then configure the property parameters that need to be set during the test, and finally call the function function to notify the test device to perform the test.
[0043] Prompts are used to remind testers to perform test preparations such as wiring or switch control during the test. They are composed of prompt pictures and prompt text. Prompt pictures are created under the corresponding model and show the test wiring method in the form of images. The prompt part consists of three layers from top to bottom: model layer, prompt package layer, and prompt layer. The model list shows the created models. Due to the different chassis structures of different test systems and the differences in wiring methods, the prompt package layer is created to classify prompts based on the test system chassis type. The prompt layer is used to edit specific prompt content, and prompt pictures can be referenced and text can be used to describe the prompt content.
[0044] Specifically, first create a prompt image and upload it to the model used for testing, then add a prompt package to the corresponding model in the prompt management. The prompt package is used to distinguish the wiring prompts of the same model in different test systems (chassis). Finally, create specific prompts at the next level of the prompt package. The prompt is used to inform the user of the wiring relationship between the test object and the test equipment. The content of a prompt is divided into two parts: prompt content for prompt generation (before testing) and prompt content for prompt cancellation (end of testing).
[0045] Mounting: Instructions and prompts are associated with the model through mounting. Status instructions are mounted on the status layer of the model, and test instructions and prompts are mounted on indicators.
[0046] Specifically, first, select the model of the test device, then select the target model to be mounted at the next level of the device model, and finally find the location of the indicator that needs to be tested by the test instruction in the model, or the location of the state that needs to be set by the state setting instruction, and select the "Add Parameter" mounting instruction.
[0047] The prompt mounting is very similar to the mounting of the test instruction. First select the model of the test device, then select the target model to be mounted at the next level of the device model, and finally select the "Add parameter" mounting prompt at the corresponding indicator position in the model.
[0048] Test item and test group creation: Test items are created under the model. By checking the indicators to be tested, they are combined into an indicator set as the test content of the test item. A test group consists of several test items and is created under the model classification of the corresponding test type. The test types are divided into three types: maintenance test, key point test, and custom test.
[0049] Test report template creation: The present invention can create corresponding test report templates for test items and test groups, and upload the test report templates to the test system in advance in docx format. The values of each test data in the template are represented by indicator labels. After the test is completed, the test result value will cover the label in the report template to generate a result report.
[0050] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not deviate from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.
Claims
1. A hardware automated testing method, characterized in that: include: S1. Create indicators; The indicator refers to the target returned by the test result, which is divided into two categories: dynamic indicators and composite indicators. Each dynamic indicator has its corresponding identifier, and the test result is returned to the indicator of the corresponding identifier; if the composite indicator does not have a corresponding identifier, the result value can be calculated by checking the dynamic indicator or the created composite indicator in its properties and combining the corresponding formula; When creating an indicator, first select the test device for the indicator, then create a command under the test device. This command is different from the test and status commands and is used to classify different types of indicators under the same device and as the target for mounting the test command. Finally, create the indicator at the next level of the command. S2, build a test model; The test object is abstracted into a test model, which is composed of a model layer, a module layer, an interface layer, a state layer and an indicator layer in a top-down tree structure. The model layer is used to distinguish different test objects, the module layer is used to distinguish the system modules of the test object, the interface layer is used to distinguish different physical interfaces of the test object, the state layer is used to distinguish different signal output states under the same interface or the working state of the test object, and the indicator layer is used to create all indicators that need to be tested under the corresponding state of the interface, and is used to mount test instructions and prompts. When the indicator is created, a unique label is automatically generated; S3, write instructions and prompts; The instructions include test instructions and status instructions. The test instructions are used to set various parameters of the device and replace manual control of the device to test various indicators. The status instructions are used to set the working state of the object under test and adjust the working state of the object under test to the state to be tested. Both instructions are written in JSON format; Prompts are used to remind testers to perform wiring or switch control test preparation during the test. They are composed of prompt pictures and prompt texts. Prompt pictures are created under the corresponding model and display the test wiring method in the form of images. S4, mount; Instructions and prompts are associated with the model through mounting. Status instructions are mounted on the status layer of the test model, and test instructions and prompts are mounted on indicators. S5. Create test items and test groups; Test items are created under test models. The indicators that need to be tested are combined into an indicator set as the test content of the test item. A test group consists of multiple test items and is created under the model classification of the corresponding test type. Test types include maintenance tests, key point tests, and custom tests.
2. The hardware automated testing method according to claim 1, characterized in that: The method further includes: S6. Prepare and upload the test report template; Corresponding test report templates are created for test items and test groups, and the test report templates are pre-uploaded to the test system in a set format. The values of each test data in the template are represented by indicator labels. After the test is completed, the test result values will cover the labels in the report template to generate a result report.
3. The hardware automation testing method according to claim 1, characterized in that: In S3, prompts are composed of a model layer, a prompt package layer, and a prompt layer in a top-down tree structure. The model list in the model layer displays the models that have been created. According to the different chassis structures and wiring methods of different test systems, a prompt package layer is created to classify prompts based on the test system chassis type. The prompt layer is used to edit specific prompt content, quote prompt images, and use text to describe the prompt content.
4. A hardware automated testing device, used to implement the hardware automated testing method according to any one of claims 1 to 3, characterized in that: include: The indicator creation module is used to create indicators. The indicators refer to the targets returned by the test results, which are divided into dynamic indicators and composite indicators. Each dynamic indicator has its corresponding identifier, and the test results are returned to the indicators of the corresponding identifiers. If the composite indicator does not have a corresponding identifier, the result value is calculated by checking the dynamic indicator or the created composite indicator in its properties and combining the corresponding formula. When creating an indicator, first select the test device for the indicator, then create a command under the test device. This command is different from the test and status commands and is used to classify different types of indicators under the same device and as the target for mounting the test command. Finally, create the indicator at the next level of the command. The test model construction module abstracts the test object into a test model. The test model is composed of a model layer, a module layer, an interface layer, a state layer and an indicator layer in a top-down tree structure. The model layer is used to distinguish different test objects, the module layer is used to distinguish the system modules of the test object, the interface layer is used to distinguish the different physical interfaces of the test object, the state layer is used to distinguish the different signal output states or the working states of the test object under the same interface, and the indicator layer is used to create all the indicators that need to be tested under the corresponding state of the interface, and is used to mount test instructions and prompts. When the indicator is created, a unique label is automatically generated; The instruction and prompt module is used to write instructions and prompts. The instructions include test instructions and status instructions. The test instructions are used to set various parameters of the equipment and replace manual control of the equipment to test various indicators. The status instructions are used to set the working state of the object under test and adjust the working state of the object under test to the state to be tested. Both instructions are written in JSON format; Prompts are used to remind testers to perform wiring or switch control test preparation during the test. They are composed of prompt pictures and prompt texts. Prompt pictures are created under the corresponding model and display the test wiring method in the form of images. The mounting module is used to mount instructions and prompts. Instructions and prompts are associated with the model through mounting. Status instructions are mounted on the status layer of the test model, and test instructions and prompts are mounted on indicators. The test creation module is used to create test items and test groups. Test items are created under the test model. The indicators to be tested are combined into an indicator set as the test content of the test item. A test group consists of multiple test items and is created under the model classification of the corresponding test type. Test types include maintenance tests, key point tests, and custom tests.
5. The hardware automated testing device according to claim 4, characterized in that: The device also includes a reporting module, which is used to prepare corresponding test report templates for test items and test groups, and upload the test report templates to the test system in a set format in advance. The values of each test data in the template are represented by indicator labels. After the test is completed, the test result values will cover the labels in the report template to generate a result report.
6. The hardware automated testing device according to claim 4, characterized in that: The instruction and prompt module is specifically used to create prompts. The prompts are composed of a model layer, a prompt package layer, and a prompt layer in a top-down tree structure. The model list in the model layer displays the models that have been created. According to the different chassis structures and wiring methods of different test systems, a prompt package layer is created to classify prompts based on the test system chassis type. The prompt layer is used to edit specific prompt content, quote prompt images, and use text to describe the prompt content.
7. A computer device comprising a memory, wherein the memory stores program instructions, characterized in that: When the program instructions are executed, the hardware automation testing method according to any one of claims 1 to 3 is executed.
