CN117667692A - Equipment testing method and system - Google Patents
Equipment testing method and system Download PDFInfo
- Publication number
- CN117667692A CN117667692A CN202311647188.4A CN202311647188A CN117667692A CN 117667692 A CN117667692 A CN 117667692A CN 202311647188 A CN202311647188 A CN 202311647188A CN 117667692 A CN117667692 A CN 117667692A
- Authority
- CN
- China
- Prior art keywords
- test
- equipment
- tested
- auxiliary
- type
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 570
- 238000000034 method Methods 0.000 claims abstract description 32
- 238000004891 communication Methods 0.000 claims description 15
- 230000009471 action Effects 0.000 claims description 12
- 238000013507 mapping Methods 0.000 claims description 5
- 238000010276 construction Methods 0.000 claims description 3
- 230000000875 corresponding effect Effects 0.000 description 109
- 230000001276 controlling effect Effects 0.000 description 17
- 230000008569 process Effects 0.000 description 11
- 230000006870 function Effects 0.000 description 5
- 238000013461 design Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Tests Of Electronic Circuits (AREA)
Abstract
The invention provides a device testing method and a system, wherein the method comprises the following steps: according to the type of the equipment to be detected, determining an extensible markup language file corresponding to the type of the equipment to be detected; analyzing the extensible markup language file to obtain equipment information of all auxiliary test equipment required by the type of equipment to be tested, all test cases required by the type of equipment to be tested and test steps of the test cases; for each test case: controlling auxiliary test equipment required by the corresponding test case, and executing test steps of the corresponding test case on the equipment to be tested to obtain test results of the corresponding test case; forming a test report of the equipment to be tested based on the test result of each test case; therefore, the system can automatically test the equipment to be tested, test results are obtained, test standards are unified, and test efficiency is improved.
Description
Technical Field
The invention belongs to the technical field of tool testing systems, and particularly relates to a device testing method and a device testing system.
Background
In the tool test system, one or more auxiliary test devices are required to work cooperatively, however, the control protocols of different auxiliary test devices are different; the test cases required by the equipment to be tested of different models are different; also, each device under test may require tens or even hundreds of test entries to be made in a single test.
At present, a manual mode is adopted in a tool test system for testing, but the manual mode is adopted for testing, so that the problems of excessively complicated test process and non-uniform standard are caused.
Disclosure of Invention
In view of the above, the invention aims to provide a device testing method and a system, which are used for realizing that the system automatically tests the device to be tested to obtain a testing result, unify testing standards and improve testing efficiency.
The first aspect of the application discloses a device testing method, comprising the following steps:
determining an extensible markup language file corresponding to the type of the equipment to be tested according to the type of the equipment to be tested;
analyzing the extensible markup language file to obtain equipment information of all auxiliary test equipment required by the equipment type to be tested, all test cases required by the equipment type to be tested and test steps of the test cases;
for each of the test cases: controlling auxiliary test equipment required by the corresponding test case, and executing test steps of the corresponding test case on the equipment to be tested to obtain test results of the corresponding test case;
and forming a test report of the equipment to be tested based on the test result of each test case.
Optionally, the controlling the auxiliary test device required by the corresponding test case executes the test step of the corresponding test case on the device to be tested to obtain the test result of the corresponding test case, including:
determining auxiliary test equipment required by the test case;
determining auxiliary test equipment corresponding to each test step in the test case from auxiliary test equipment required by the test case;
controlling corresponding auxiliary test equipment to execute actions corresponding to the current test step on corresponding sub-equipment in the equipment to be tested according to the test step;
and obtaining the test result of the corresponding test case.
Optionally, the obtaining the test result of the corresponding test case includes:
if any one of the test steps fails to be executed, generating a state code corresponding to the corresponding test step;
and taking the state code corresponding to each test step with failed execution as the test result of the test case.
Optionally, before determining the extensible markup language file corresponding to the type of the device to be tested according to the type of the device to be tested, the method further includes:
and configuring the extensible markup language file.
Optionally, before determining the extensible markup language file corresponding to the type of the device to be tested according to the type of the device to be tested, the method further includes:
and determining the type of the equipment to be tested.
Optionally, the determining the type of the device under test includes:
and acquiring interface information provided by the equipment to be tested, and determining the type of the equipment to be tested according to the interface information.
Optionally, before determining the extensible markup language file corresponding to the type of the device to be tested according to the type of the device to be tested, the method further includes:
and configuring equipment information of each auxiliary test equipment in an abstract class mode according to a communication mode adopted by the auxiliary test equipment, and completing construction of an auxiliary test equipment set.
Optionally, each test case is executed one by one according to a preset sequence, or at least two test cases are executed simultaneously.
A second aspect of the present application discloses a device testing system comprising:
the mapping module is used for determining an extensible markup language file corresponding to the type of the equipment to be detected according to the type of the equipment to be detected;
the analysis module is used for analyzing the extensible markup language file to obtain equipment information of all auxiliary test equipment required by the equipment type to be tested, all test cases required by the equipment type to be tested and test steps of the test cases;
a test module, configured to, for each of the test cases: controlling auxiliary test equipment required by the corresponding test case, and executing test steps of the corresponding test case on the equipment to be tested to obtain test results of the corresponding test case;
and the report module is used for forming a test report of the equipment to be tested based on the test result of each test case.
Optionally, the test module is configured to control the auxiliary test device required by the corresponding test case, and execute a test step of the corresponding test case on the device to be tested, so as to obtain a test result of the corresponding test case, where the test module is specifically configured to:
determining auxiliary test equipment required by the test case;
determining auxiliary test equipment corresponding to each test step in the test case from auxiliary test equipment required by the test case;
controlling corresponding auxiliary test equipment to execute actions corresponding to the current test step on corresponding sub-equipment in the equipment to be tested according to the test step;
and obtaining the test result of the corresponding test case.
According to the technical scheme, the equipment testing method provided by the invention comprises the steps of determining an extensible markup language file corresponding to the type of equipment to be tested according to the type of the equipment to be tested; analyzing the extensible markup language file to obtain equipment information of all auxiliary test equipment required by the type of equipment to be tested, all test cases required by the type of equipment to be tested and test steps of the test cases; for each test case: controlling auxiliary test equipment required by the corresponding test case, and executing test steps of the corresponding test case on the equipment to be tested to obtain test results of the corresponding test case; forming a test report of the equipment to be tested based on the test result of each test case; therefore, the system can automatically test the equipment to be tested, test results are obtained, test standards are unified, and test efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a device testing method provided by an embodiment of the present invention;
FIG. 2 is another flow chart of a device testing method provided by an embodiment of the present invention;
FIG. 3 is a flow chart of configuration codes involved in a device testing method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a device testing system according to an embodiment of the present invention;
fig. 5 is a schematic diagram of another device testing system according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiment of the application provides a device testing method, which is used for solving the problems that in the prior art, a manual mode is adopted for testing in a tool testing system, but the manual mode is adopted for testing, so that the testing process is too complicated and the standards are not uniform.
Referring to fig. 1, the device testing method includes:
s101, determining an extensible markup language file corresponding to the type of the device to be tested according to the type of the device to be tested.
Different devices under test may be of different types and the tests required by the devices under test may be different, so that the corresponding extensible markup language file, xml (eXtensibleMarkupLanguage) file, may be determined by the type of device under test.
The xml file describes the equipment information, test cases, test steps of the test cases, and the like of the corresponding auxiliary test equipment.
The xml file can be pre-written and stored in a corresponding folder, and when the test is required, the corresponding xml file is matched in the file through the type of the device to be tested. Of course, when the type of the device to be tested cannot be matched with the corresponding xml file, a new xml file can be written through the expansion area, and after writing is completed, the new xml file is stored in the folder.
The above description is stored in a folder manner, and of course, other manners may be adopted, which are not described here in detail, and may be determined according to actual situations, and all are within the protection scope of the present application.
Specifically, the xml file can be determined according to the type of the device to be tested by pre-configuring the corresponding relation between the type of the device to be tested and the xml file. May be implemented by a mapping table or other means, not specifically limited herein.
Or, each xml file may be configured with a corresponding identifier of the type of the device to be tested, and then the xml file configured with the identifier of the type of the device to be tested is searched through the type of the device to be tested and used as the xml file corresponding to the type of the device to be tested.
It should be noted that the number of xml files corresponding to one device type to be tested may be 1 or more, which is not particularly limited herein.
When the number of the xml files corresponding to the type of the device to be tested is multiple, the subsequent analysis and execution can be performed on each xml file at the same time, or can be performed one by one, so that the method is not repeated here, and the method is required to be used according to the actual situation and is within the protection scope of the application.
The xml file is used for writing the test cases, so that the test cases can be conveniently changed.
S102, analyzing the extensible markup language file to obtain equipment information of all auxiliary test equipment required by the type of equipment to be tested, all test cases required by the type of equipment to be tested and test steps of the test cases.
The device information of the auxiliary test device may include: auxiliary test equipment parameters such as the type and name of the equipment. The same kind of auxiliary test equipment can be provided with a plurality of auxiliary test equipment, and the corresponding auxiliary test equipment can be determined by the names of the auxiliary test equipment. The name may be replaced with an identification, and is not particularly limited herein.
The device information may include only the type of the auxiliary test device, and then in the subsequent method, the idle device may be found from the auxiliary test device of the type as the auxiliary test device required for the test. The device information may include only the name of the auxiliary test device, and further directly use the auxiliary test device as the auxiliary test device required by the test. The device information may also include both the type and name of the auxiliary test device, and at least one of the two methods may be used.
Other information may be included in the device information, which is not described in detail herein, and auxiliary test devices required for testing may be determined according to the other information.
A test case is a set of conditions or variables from which a tester determines whether an application or system is working properly. In order to realize the test, each test case has a respective corresponding test step. The test steps of different test cases are different, and the specific differences can be represented by different auxiliary test equipment, different instructions to be executed by the auxiliary test equipment, different actions to be executed by the auxiliary test equipment, and the like.
Only one auxiliary test device may be required for one auxiliary test device to independently complete the test case, or a plurality of auxiliary test devices may be required for a plurality of auxiliary test devices to combine to complete the test case.
The required auxiliary test equipment can be determined by marking the equipment information of the auxiliary test equipment in the test case, and of course, other modes can be adopted, and the details are not repeated here.
A test case may include multiple test steps, such as step 1, step 2, step 3, step 4, etc.
The device information of all auxiliary test devices required by the device type to be tested, all test cases required by the device type to be tested and the test steps of the test cases can be in the form of labels; for example, the xml file is parsed to obtain a tag device, a tag tests and a tag test, and auxiliary test equipment is created according to parameters in the tag device; testing the test cases in the labels Tests one by one; gradually controlling according to the Test steps in the label Test; and finally, outputting a test result and forming a report.
Compared with manual selection of test cases, the method and the device can automatically match the test cases according to the equipment types, and the automatic matching can be realized by adding the corresponding relation between the equipment types to be tested and the test cases, so that the testing efficiency and the accuracy are improved.
S103, aiming at each test case: and controlling auxiliary test equipment required by the corresponding test case, and executing the test steps of the corresponding test case on the equipment to be tested to obtain the test result of the corresponding test case.
That is, the test procedure for each test case may be: and controlling auxiliary test equipment required by the test case to execute the test steps of the test case so as to enable the equipment to be tested to execute corresponding actions, thereby obtaining the test result of the test case.
For example, the procedure for test case 1 may be: and controlling auxiliary test equipment required by the test case 1 to execute the test step of the test case 1 so as to enable the equipment to be tested to execute corresponding actions, thereby obtaining the test result of the test case 1. Other test cases are the same and will not be described in detail here.
Optionally, each test case is executed one by one according to a preset sequence, or at least two test cases are executed simultaneously. That is, there are at least two execution modes, one is that each test case is executed one by one according to a preset sequence, that is, only one test case is executed at the same time; another way is that each test case is executed according to a preset sequence and at least two test cases are executed simultaneously, that is, a plurality of test cases may be executed at the same time. The execution mode of the test cases is not particularly limited herein, so long as each test case can be ensured to accurately complete execution.
After each test case is executed, the test result of the test case is obtained. The test result can indicate what kind of problem exists in the device to be tested, the reason of test failure and the like, and also can indicate that the device to be tested has no problem and the like.
S104, forming a test report of the device to be tested based on the test result of each test case.
According to the above description, each test case has a corresponding test result, and then the test results of each test case can be summarized to obtain a test report of the device to be tested.
The test report may describe problems with the device under test, and other information may also be described, which will not be described in detail herein.
In this embodiment, according to the type of the device to be tested, determining an extensible markup language file corresponding to the type of the device to be tested; analyzing the extensible markup language file to obtain equipment information of all auxiliary test equipment required by the type of equipment to be tested, all test cases required by the type of equipment to be tested and test steps of the test cases; for each test case: controlling auxiliary test equipment required by the corresponding test case, and executing test steps of the corresponding test case on the equipment to be tested to obtain test results of the corresponding test case; forming a test report of the equipment to be tested based on the test result of each test case; therefore, the system can automatically test the equipment to be tested, test results are obtained, test standards are unified, and test efficiency is improved.
Optionally, referring to fig. 2, the step S103 of controlling the auxiliary test device required for the corresponding test case includes executing a test step of the corresponding test case on the device to be tested to obtain a test result of the corresponding test case, where the test result includes:
s201, auxiliary test equipment required by the test case is determined.
Specifically, all auxiliary test equipment required by the test case is placed in a subset of equipment.
S202, determining auxiliary test equipment corresponding to each test step in the test case from auxiliary test equipment required by the test case.
And determining the corresponding relation between each auxiliary test device and the test step from the device subset.
S203, controlling the corresponding auxiliary test equipment to execute the action corresponding to the current test step on the corresponding sub-equipment in the equipment to be tested according to the test step.
It should be noted that the testing step may include the corresponding auxiliary testing device and the actions that the auxiliary testing device needs to perform, so that the corresponding sub-device in the device under test performs the corresponding actions.
The equipment to be tested comprises a plurality of sub-equipment, and the corresponding sub-equipment can be controlled by the auxiliary test equipment to execute corresponding actions so as to realize the test of corresponding test cases on the equipment to be tested.
The number of auxiliary test devices required by a test case may be plural, so that all the auxiliary test devices required by the test case can be determined first, and then, from the auxiliary test devices, what step needs to be executed by each auxiliary test system is determined, thereby realizing the execution of the test case.
S204, obtaining a test result of the corresponding test case.
Each test case has a corresponding test result, and the test results of each piece of sub-equipment or each step of execution results can be summarized to be used as the test result of the test case.
Optionally, the specific process of obtaining the test result of the corresponding test case may include:
if any test step fails to be executed, generating a state code corresponding to the corresponding test step; and taking the state code corresponding to each test step with failed execution as a test result of the test case.
That is, each test step has a corresponding status code, when any test step fails to execute, the status code corresponding to the test step that fails to execute is generated, and each status code is summarized as a test result of the test case, so that a worker can know which step and/or which sub-device has a problem through the status code.
The following illustrates the specific execution of test cases:
the test case code may be:
<?xml version="1.0"?>
<Devices>
<Devicename="RS485_1"type="RS485"Protocol="Modbus-RTU"Com="/dev/ttyUSB0"></Device>
<Devicename="Voltcontrol"type="Power"></Device>
</Devices>
<tests>
<testname="test01"count="10">
<steps>
<controlDeviceName="RS485_1"action="Busoff"DeviceAddr="5"></control>
<control Delay="1000"></control>
<control DeviceName="RS458_1"action="tablecmp"></control>
<controlDeviceName="RS485_1"action="Reset"DeviceAddr="5"></control>
<control Delay="5000"></control>
<control DeviceName="RS458_1"action="tablecmp"></control>
</steps>
</test>
</tests>
in the code, two auxiliary test devices are newly built, namely RS485-1 and VoltControl, voltControl auxiliary test devices are only examples, and have no effect temporarily. The auxiliary test equipment of the RS485-1 is configured according to the configuration parameters in the auxiliary test equipment (Device) table. Such as: the test program creates a corresponding auxiliary test equipment class according to the equipment type (type) attribute; the communication Protocol of the auxiliary test equipment is configured according to the internet switching rule (Protocol) attribute, the currently configured communication Protocol is Modbus-RTU, and the Com attribute is configured to correspond to the serial number. The attributes in the Device tags are all different for different Device types. The test tag contains all test cases, and the code contains only one test case, the name of which is "test01", and the test item needs to be tested repeatedly 10 times. The step of testing the test case is contained in the step label, and the step of testing the codes is as follows:
(1) And controlling the sub-equipment with the equipment address of 5 in the equipment to be tested to disconnect the bus (CAN bus) through the RS485_1 auxiliary test equipment.
(2) Delay for 1s.
(3) And acquiring an auxiliary test equipment table through the RS485_1 auxiliary test equipment, and comparing.
(4) And restarting the device with the address of 5 by using the RS485_1 auxiliary test device.
(5) Delay time 5s.
(6) And acquiring an auxiliary test equipment table through the RS485_1 auxiliary test equipment, and comparing.
Wherein, each step of failure returns different status codes to be stored in the test report, and the tester can know the failure reason of the test item according to the status codes.
It should be noted that, in the tag Devcies, device parameters such as the type, name, etc. of the auxiliary test device are determined. Since the tooling test system may include a plurality of auxiliary test devices of the same type, a name needs to be assigned to each auxiliary test device, and an auxiliary test device to be controlled needs to be assigned in the test case. The label test includes all test cases, and the label test includes specific test steps of each test case.
Optionally, before determining the extensible markup language file corresponding to the type of the device to be tested according to the type of the device to be tested in step S101, the method further includes:
an extensible markup language file is configured.
The test case code may be an example of an extensible markup language file, and the specific contents of the extensible markup language file are not particularly limited herein.
The specific configuration process may be that the xml file input by the user is stored in the corresponding storage unit after being subjected to related processing.
Optionally, before determining the extensible markup language file corresponding to the type of the device to be tested according to the type of the device to be tested in step S101, the method further includes:
and determining the type of the device to be tested.
That is, the type of device under test needs to be determined before the xml file is determined. As the xml file may be determined by the type of device under test. The xml files corresponding to different types of devices to be tested are different.
The specific process of determining the type of the device to be tested may be: and acquiring interface information provided by the equipment to be tested, and determining the type of the equipment to be tested according to the interface information.
That is, the interface information of different types of devices to be tested is different, and thus the type of the devices to be tested can be determined through the interface information, and of course, the type of the devices to be tested can also be determined in other manners, which is not limited herein.
Optionally, before determining the extensible markup language file corresponding to the type of the device to be tested according to the type of the device to be tested in step S101, the method further includes:
and configuring equipment information of each auxiliary test equipment in an abstract class mode according to a communication mode adopted by the auxiliary test equipment, and completing construction of an auxiliary test equipment set.
In the whole test process, a plurality of auxiliary test devices exist, the communication modes of each auxiliary test device are different, and in order to facilitate the later addition of the new type of auxiliary test devices, the control protocol of each auxiliary test device and other information of each auxiliary test device can be realized in an abstract type mode.
Referring to fig. 3, a configuration process is shown.
Wherein GetDevices (type) is identifying the type of auxiliary test equipment and invoking the corresponding factory to create the corresponding instance according to the type of auxiliary test equipment.
Init and control in absthactative device are virtual functions. All auxiliary test equipment needs to have the functions to be implemented.
PCSTestDevice and PowerDevice are for illustration.
The Powerdevice class is prototyped with a three-phase electric simulator, APhaseVoltset for setting the phase difference of phase A.
In the PCSTestDevice, deviceTableGet is used for obtaining a device table stored in the corresponding address device; the deviceReset is used to control software restart of the corresponding address device. DeviceMasterGet is used to obtain the host address. The DeviceInfoGet is used for acquiring the equipment working state stored by the equipment with the corresponding address and judging whether the equipment works normally or not.
That is, the type of the auxiliary test equipment is first identified, and the corresponding factory created instance is invoked according to the type of the auxiliary test equipment. Secondly, parameters of each auxiliary test device are configured according to the abstract class mode, and the parameter configuration can be specifically performed through PCSTestdevice and Powerdevice.
At present, each auxiliary test device needs to perform parameter configuration and relevant control according to test cases, so that two abstract interfaces of init () and control () are extracted to form a base class (abstract class). For example, for auxiliary test equipment using RS485 communication, serial ports, baud rates, verification modes, specific control protocols, and the like need to be specified; the ancillary test device for communication using TCP/IP requires specification of an IP address, a port number, a specific control protocol, and the like.
The communication mode of the auxiliary test device is not limited to RS485 communication and TCP/IP communication, and may include USB communication, etc., which will not be described in detail herein. The control protocol may be a Modbus protocol, and may also be a custom protocol, which will not be described in detail herein. The control protocol is application-layer.
Since all kinds of auxiliary tests cannot be considered completely in the early stage, the test scheme is also completed gradually, and therefore, the later expansibility needs to be considered in the test development process. In order to facilitate the expansion of the test method, a design mode of an abstract factory is adopted.
Each time an auxiliary test device is newly added, specific auxiliary test device classes are only required to be expanded based on basic classes (abstreactdevice) according to the functions and protocols of the new auxiliary test device; for example, the pcstistdevice class shown in fig. 3 is based on an abstreactdevice, and the auxiliary test device has functions of acquiring addresses of all devices in the CAN communication network, acquiring addresses of hosts in the CAN communication network (the communication network includes one host and a plurality of slaves), and the like.
After the auxiliary test equipment type is newly added, an instantiation method of the newly added auxiliary test equipment is required to be added in the deviceFactoy. The devicefactor invokes an instantiation method of a specific auxiliary test device class for instantiation according to the auxiliary test device type specified in the xml file. And an extension function is set, so that new auxiliary test equipment can be conveniently extended for the whole tooling test system.
Another embodiment of the present application provides a device testing system.
Referring to fig. 4, the device testing system includes:
the mapping module 101 is configured to determine, according to the type of the device to be tested, an extensible markup language file corresponding to the type of the device to be tested; wherein the extensible markup language file includes test cases.
The parsing module 102 is configured to parse the extensible markup language file to obtain device information of all auxiliary test devices required by the device type to be tested, all test cases required by the device type to be tested, and test steps of the test cases.
A test module 103, configured to, for each test case: and controlling auxiliary test equipment required by the corresponding test case, and executing the test steps of the corresponding test case on the equipment to be tested to obtain the test result of the corresponding test case.
And the reporting module 104 is configured to form a test report of the device under test based on the test result of each test case.
As shown in fig. 5, a main program of the device testing system is configured on the PC end, and the main program of the device testing system is run on the PC end, where the main program controls the auxiliary testing devices (such as the auxiliary testing device a, the auxiliary testing device B, and the auxiliary testing device C shown in fig. 5) through an RS485 (CAN bus/USB interface or the like) to test the device to be tested.
The main program may include a control instruction in the above-mentioned device test system, that is, the PC end issues a control instruction to the auxiliary test device, and the auxiliary test device executes the control instruction to complete the test on the device under test.
Optionally, the test module 103 is configured to control auxiliary test equipment required by a corresponding test case, and execute a test step of the corresponding test case on the device to be tested, so as to obtain a test result of the corresponding test case, where the test module is specifically configured to:
and determining auxiliary test equipment required by the test cases.
And determining auxiliary test equipment corresponding to each test step in the test case from the auxiliary test equipment required by the test case.
And controlling the corresponding auxiliary test equipment to execute the action corresponding to the current test step on the corresponding sub-equipment in the equipment to be tested according to the test step.
And obtaining the test result of the corresponding test case.
In this embodiment, the mapping module 101 determines, according to the type of the device to be tested, an extensible markup language file corresponding to the type of the device to be tested; the extensible markup language file comprises a test case; the analysis module 102 analyzes the extensible markup language file to obtain equipment information of all auxiliary test equipment required by the type of equipment to be tested, all test cases required by the type of equipment to be tested and test steps of the test cases; test module 103, for each test case: controlling auxiliary test equipment required by the corresponding test case, and executing test steps of the corresponding test case on the equipment to be tested to obtain test results of the corresponding test case; the report module 104 forms a test report of the device to be tested based on the test result of each test case; therefore, the system can automatically test the equipment to be tested, test results are obtained, test standards are unified, and test efficiency is improved.
Features described in the embodiments in this specification may be replaced or combined, and identical and similar parts of the embodiments may be referred to each other, where each embodiment focuses on differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A method of device testing, comprising:
determining an extensible markup language file corresponding to the type of the equipment to be tested according to the type of the equipment to be tested;
analyzing the extensible markup language file to obtain equipment information of all auxiliary test equipment required by the equipment type to be tested, all test cases required by the equipment type to be tested and test steps of the test cases;
for each of the test cases: controlling auxiliary test equipment required by the corresponding test case, and executing test steps of the corresponding test case on the equipment to be tested to obtain test results of the corresponding test case;
and forming a test report of the equipment to be tested based on the test result of each test case.
2. The device testing method according to claim 1, wherein the controlling the auxiliary testing device required by the corresponding test case, performing the testing step of the corresponding test case on the device to be tested, to obtain the testing result of the corresponding test case, includes:
determining auxiliary test equipment required by the test case;
determining auxiliary test equipment corresponding to each test step in the test case from auxiliary test equipment required by the test case;
controlling corresponding auxiliary test equipment to execute actions corresponding to the current test step on corresponding sub-equipment in the equipment to be tested according to the test step;
and obtaining the test result of the corresponding test case.
3. The device testing method according to claim 2, wherein the obtaining the test result of the corresponding test case includes:
if any one of the test steps fails to be executed, generating a state code corresponding to the corresponding test step;
and taking the state code corresponding to each test step with failed execution as the test result of the test case.
4. The device testing method according to claim 1, further comprising, before the determining, according to the type of the device to be tested, an extensible markup language file corresponding to the type of the device to be tested:
and configuring the extensible markup language file.
5. The device testing method according to claim 1, further comprising, before the determining, according to the type of the device to be tested, an extensible markup language file corresponding to the type of the device to be tested:
and determining the type of the equipment to be tested.
6. The device testing method of claim 5, wherein the determining the device type under test comprises:
and acquiring interface information provided by the equipment to be tested, and determining the type of the equipment to be tested according to the interface information.
7. The device testing method according to claim 1, further comprising, before the determining, according to the type of the device to be tested, an extensible markup language file corresponding to the type of the device to be tested:
and configuring equipment information of each auxiliary test equipment in an abstract class mode according to a communication mode adopted by the auxiliary test equipment, and completing construction of an auxiliary test equipment set.
8. The device testing method of claim 1, wherein each of the test cases is executed one by one in a preset order or there are at least two simultaneous executions.
9. A device testing system, comprising:
the mapping module is used for determining an extensible markup language file corresponding to the type of the equipment to be detected according to the type of the equipment to be detected;
the analysis module is used for analyzing the extensible markup language file to obtain equipment information of all auxiliary test equipment required by the equipment type to be tested, all test cases required by the equipment type to be tested and test steps of the test cases;
a test module, configured to, for each of the test cases: controlling auxiliary test equipment required by the corresponding test case, and executing test steps of the corresponding test case on the equipment to be tested to obtain test results of the corresponding test case;
and the report module is used for forming a test report of the equipment to be tested based on the test result of each test case.
10. The device testing system according to claim 9, wherein the testing module is configured to control the auxiliary testing device required by the corresponding test case, and when the testing step of the corresponding test case is executed on the device to be tested, the testing module is specifically configured to:
determining auxiliary test equipment required by the test case;
determining auxiliary test equipment corresponding to each test step in the test case from auxiliary test equipment required by the test case;
controlling corresponding auxiliary test equipment to execute actions corresponding to the current test step on corresponding sub-equipment in the equipment to be tested according to the test step;
and obtaining the test result of the corresponding test case.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311647188.4A CN117667692A (en) | 2023-12-04 | 2023-12-04 | Equipment testing method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311647188.4A CN117667692A (en) | 2023-12-04 | 2023-12-04 | Equipment testing method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117667692A true CN117667692A (en) | 2024-03-08 |
Family
ID=90065621
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311647188.4A Pending CN117667692A (en) | 2023-12-04 | 2023-12-04 | Equipment testing method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117667692A (en) |
-
2023
- 2023-12-04 CN CN202311647188.4A patent/CN117667692A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10268570B2 (en) | Methods, systems, and computer readable media for automated generation of test files and testing network equipment using same | |
US7743090B1 (en) | Systems and methods for infrastructure validation | |
CN109491916B (en) | Test method, device, equipment, system and medium for operating system | |
CN112416327A (en) | Project construction method and device, computer equipment and storage medium | |
CN105302722B (en) | CTS automatic testing method and device | |
CN113706110B (en) | FPGA test tool integrated test management platform | |
CN112540924A (en) | Interface automation test method, device, equipment and storage medium | |
CN104461531A (en) | Implementing method for self-defined functions of reporting system | |
CN111459495A (en) | Unit test code file generation method, electronic device and storage medium | |
CN111026670A (en) | Test case generation method, test case generation device, and storage medium | |
Wahler et al. | CAST: Automating software tests for embedded systems | |
CN114124694A (en) | Configuration method and configuration device of Internet of things equipment, electronic equipment and medium | |
CN109408376B (en) | Configuration data generation method, device, equipment and storage medium | |
CN117435513B (en) | Test case generation method, terminal equipment and computer readable storage medium | |
CN114090365A (en) | Method, device and equipment for performing function test by using dynamic link library | |
US20120246636A1 (en) | Method and arrangement for installing and configuring a computer system | |
CN112685311A (en) | Test script automatic generation method and device, computer equipment and storage medium | |
CN110134559B (en) | BMC fault detection method, system and related components | |
CN117667692A (en) | Equipment testing method and system | |
Tsiolakis | Integrating model information in uml sequence diagrams | |
CN112118159A (en) | Network testing method, device, equipment and computer readable storage medium | |
CN112685322B (en) | Customized test method, device and system | |
CN113254040B (en) | Front-end framework updating method, device, equipment and storage medium | |
CN114297088A (en) | Method, device, equipment and medium for testing front end vue frame assembly | |
CN111580853A (en) | Universal generation method for multi-channel software installation package |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |