CN116872251A - Hardware testing method, device, electronic equipment and computer readable storage medium - Google Patents

Hardware testing method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116872251A
CN116872251A CN202310773621.2A CN202310773621A CN116872251A CN 116872251 A CN116872251 A CN 116872251A CN 202310773621 A CN202310773621 A CN 202310773621A CN 116872251 A CN116872251 A CN 116872251A
Authority
CN
China
Prior art keywords
test
global variable
static global
target
variable value
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
Application number
CN202310773621.2A
Other languages
Chinese (zh)
Inventor
戚祯祥
邢晓凡
汪晓姗
吴为
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jieka Robot Co ltd
Original Assignee
Jieka Robot Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Jieka Robot Co ltd filed Critical Jieka Robot Co ltd
Priority to CN202310773621.2A priority Critical patent/CN116872251A/en
Publication of CN116872251A publication Critical patent/CN116872251A/en
Pending legal-status Critical Current

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J19/00Accessories fitted to manipulators, e.g. for monitoring, for viewing; Safety devices combined with or specially adapted for use in connection with manipulators
    • B25J19/0095Means or methods for testing manipulators
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Robotics (AREA)
  • Mechanical Engineering (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application discloses a hardware testing method, a device, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: determining a test item corresponding to the hardware equipment; calling a test case under a test item, wherein the test case comprises a static global variable name, a target static global variable value and expected test result data; executing the test case, and determining a memory space storing initial static global variable values according to the static global variable names; modifying the initial static global variable value in the memory space to a target static global variable value, and determining target test data of the hardware equipment; and obtaining the test result of the test item according to the target test data and the expected test result data. The application solves the technical problems of complicated steps and low efficiency caused by manual operation when hardware equipment is tested in the related technology.

Description

Hardware testing method, device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of hardware testing, and in particular, to a hardware testing method, apparatus, electronic device, and computer readable storage medium.
Background
The software test of the software and hardware combined products, especially the system test of the system level, because most scenes need to be connected with external hardware to execute test cases, the application scenes are complex, and when the test is manually performed, the problems of complicated steps, low efficiency and the like exist.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the application provides a hardware testing method, a device, electronic equipment and a computer readable storage medium, which at least solve the technical problems of complicated steps and low efficiency caused by manual operation when hardware equipment is tested in the related technology.
According to an aspect of an embodiment of the present application, there is provided a hardware testing method including: determining a test item corresponding to the hardware equipment; calling a test case under the test item, wherein the test case comprises a static global variable name, a target static global variable value and expected test result data; executing the test case, and determining a memory space storing initial static global variable values according to the static global variable names; modifying the initial static global variable value in the memory space to the target static global variable value, and determining target test data of the hardware equipment; and obtaining the test result of the test item according to the target test data and the expected test result data.
Optionally, before the modifying the initial static global variable value to the target static global variable value in the memory space and determining the target test data of the hardware device, the method further includes: determining an initial static global variable value corresponding to the test case; and writing the initial static global variable value into the memory space to obtain the memory space storing the initial static global variable value.
Optionally, the executing the test case, according to the static global variable name, determining a memory space storing an initial static global variable value includes: configuring a test environment for executing test on the hardware equipment; checking the test environment to obtain an environment test result; and executing the test case under the condition that the environment test result is that the test environment passes, and determining the memory space storing the initial static global variable value according to the static global variable name.
Optionally, the modifying the initial static global variable value to the target static global variable value in the memory space, determining the target test data of the hardware device includes: and under the condition that the test cases comprise a plurality of test cases, modifying the initial static global variable value in the memory space to a corresponding target static global variable value, and determining a plurality of target test data of the hardware equipment, wherein the plurality of test cases are in one-to-one correspondence with the plurality of target test data.
Optionally, after determining the test item corresponding to the hardware device, the method further includes: and determining a test item corresponding to a combined hardware device, wherein the combined hardware device is a hardware device obtained by combining the hardware device with other hardware devices.
Optionally, before the calling the test case under the test item, the method further includes: acquiring device data of the hardware device; and constructing test cases under the test item according to the equipment data.
Optionally, after obtaining the test result obtained by executing the test item according to the target test data and the expected test data, the method further includes: and sending alarm information to a preset terminal under the condition that the test result is that the test item is abnormal, wherein the alarm information carries the test item.
According to an aspect of an embodiment of the present application, there is provided a hardware testing apparatus including: the first determining module is used for determining a test item corresponding to the hardware equipment; the calling module is used for calling the test case under the test item, wherein the test case comprises a static global variable name, a target static global variable value and expected test result data; the second determining module is used for executing the test case and determining a memory space storing initial static global variable values according to the static global variable names; the modification module is used for modifying the initial static global variable value in the memory space to the target static global variable value and determining target test data of the hardware equipment; and the third determining module is used for obtaining the test result of the test item according to the target test data and the expected test result data.
According to an aspect of an embodiment of the present application, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the hardware testing method of any of the above.
According to an aspect of an embodiment of the present application, there is provided a computer-readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform any one of the hardware testing methods described above.
In the embodiment of the application, the test item corresponding to the hardware equipment is determined, so as to test the corresponding test item on the hardware equipment, after the test item is determined, the test case under the test item is called, the test case comprises a static global variable name, a target static global variable value and expected test result data, the memory space storing the initial static global variable value is found according to the static global variable name included in the test case by executing the test case, then the initial static global variable value in the memory space is modified to the target static global variable value, and the target test data of the hardware equipment under the target static global variable value is determined, so that the test result of the test item is obtained according to the target test data and the expected test result data, thereby achieving the purpose of automatic test and solving the technical problems of complicated steps and low efficiency caused by manual operation when the hardware equipment is tested in the related technology.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow chart of a hardware testing method according to an embodiment of the application;
FIG. 2 is a test flow chart provided by an alternative embodiment of the present application;
FIG. 3 is a schematic diagram of a serial test provided by an alternative embodiment of the present application;
FIG. 4 is a schematic diagram of parallel testing provided by an alternative embodiment of the present application;
fig. 5 is a block diagram of a hardware testing apparatus according to an embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In accordance with an embodiment of the present application, there is provided an embodiment of a hardware testing method, it being noted that the steps shown in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order other than that shown or described herein.
FIG. 1 is a flow chart of a hardware testing method according to an embodiment of the application, as shown in FIG. 1, comprising the steps of:
step S102, determining a test item corresponding to the hardware equipment;
in step S102 provided in the present application, the hardware device may be a device related to a robot, for example, may be a robot. The test item is an item related to the hardware device, for example, in the case where the hardware device is a robot, the test item may be a movement direction test, a movement speed test, or the like of the robot. The test items can be customized according to specific hardware equipment.
Step S104, calling a test case under the test item, wherein the test case comprises a static global variable name, a target static global variable value and expected test result data;
in step S104 provided in the present application, the test case may determine whether the test result of the corresponding test item of the corresponding hardware device meets the expected requirement. The test cases comprise static global variable names, and the static global variable names are used for finding corresponding static global variables. The test case comprises a target static global variable value, and is used for modifying the initial static global variable value to change the static global variable value into the target static global variable value. The test case comprises expected test result data, and the expected test result data can be compared with target test result data obtained by executing the test case to determine a test result of the test item.
Step S106, executing the test case, and determining a memory space storing initial static global variable values according to the static global variable names;
in step S106 provided by the present application, a memory space storing an initial static global variable value is found according to the static global variable name, so as to modify the static global variable value in the memory space for testing.
Step S108, modifying the initial static global variable value in the memory space to a target static global variable value, and determining target test data of the hardware equipment;
in step S108 provided by the present application, the initial static global variable value in the memory space is modified to the target static global variable value, and the target test data of the hardware device is determined under the condition that the static global variable value is the target static global variable value. In the corresponding test case automation process, the operation effect can be generated on the hardware equipment by calling and modifying the static global variable value in the memory space, so that the effect of automatic test is achieved.
Step S110, according to the target test data and the expected test result data, the test result of the test item is obtained.
In step S110 provided in the present application, a test result of the test item is obtained, and specifically how to obtain the test result according to the target test data and the expected test result data, so that a specific scenario can be set correspondingly. For example, in some scenarios, the target test data may be compared to the expected test result data, and the test result may be obtained based on whether the two are consistent. For example, in some scenarios, the test result of the test item may be obtained by determining an error range of the target test data and the expected test result data, and comparing the obtained error range with an allowable error range.
Through the steps, the test items corresponding to the hardware equipment are determined, the corresponding test items are tested on the hardware equipment, after the test items are determined, the test cases under the test items are called, the test cases comprise static global variable names, target static global variable values and expected test result data, through executing the test cases, the memory space storing the initial static global variable values is found according to the static global variable names included in the test cases, then the initial static global variable values in the memory space are modified to the target static global variable values, the target test data of the hardware equipment are determined under the target static global variable values, the test results of the test items are obtained according to the target test data and the expected test result data, the purpose of automatic test is achieved, and the technical problems that when the hardware equipment is tested in the related technology, manual operation is required, the steps are complicated and the efficiency is low are solved.
As an alternative embodiment, modifying the initial static global variable value to the target static global variable value in the memory space, before determining the target test data of the hardware device, further includes: determining an initial static global variable value corresponding to the test case; and writing the initial static global variable value into the memory space to obtain the memory space storing the initial static global variable value.
In this embodiment, the initial static global variable value corresponding to the test case is written into the memory space for management, and when the test case is executed again later, the execution can be repeatedly invoked, so that the test process is greatly facilitated. And the initial static global variable value is written into the memory space, so that the hardware equipment can be in an initial state, and test operation is carried out under the operation, so that not only can a unified standard be formulated for testing successfully or not, but also the test result of whether the testing is successful or not can be timely and primarily judged in a visual layer. After the memory space storing the initial static global variable value is obtained, the test can be directly carried out by modifying the variable value, so that the test is more flexible and customizable. For example, the change values may be modified according to different requirements to change the behavior of the test or output the results. This avoids the need to re-write code each time to accommodate new requirements. In addition, the hardware equipment can be debugged by repairing the variable value, so that the problem can be found out in time and repaired.
As an alternative embodiment, executing the test case, determining the memory space storing the initial static global variable value according to the static global variable name, includes: configuring a test environment for executing test on the hardware equipment; checking the test environment to obtain an environment test result; and under the condition that the environment test result is that the test environment passes, executing the test case, and determining the memory space storing the initial static global variable value according to the static global variable name.
In this embodiment, the environment of the test is configured. When the test environment is configured, a hardware device name, a hardware device physical address and a corresponding communication port may be required to be included according to requirements in some situations. The environment configuration can be customized according to the actual application and the scene. In the process of executing the automatic program, the environment in which the automatic program operates is accurately configured, the test environment is checked to obtain an environment test result, the test case can be executed under the condition that the environment test result is that the test environment passes, and the memory space in which the initial static global variable value is stored is determined according to the static global variable name, so that the normal operation of the automatic program and the accuracy of the test result can be ensured. Moreover, by checking the test environment, the usability of the test environment can be ensured, unnecessary delays and cost increases due to errors and faults in hardware, software or networks can be avoided, time waste is reduced, and risks are reduced, for example, when performing corresponding function integration, upgrading, migration or patching of hardware devices, performing a series of benchmarks and function/performance markers before verification will help to determine and prepare for potential risks.
As an alternative embodiment, modifying the initial static global variable value to the target static global variable value in the memory space, determining the target test data of the hardware device, includes: and under the condition that the test cases comprise a plurality of test cases, modifying the initial static global variable value in the memory space to a corresponding target static global variable value, and determining a plurality of target test data of the hardware equipment, wherein the plurality of test cases are in one-to-one correspondence with the plurality of target test data.
In this embodiment, a case is described in which a plurality of test cases are included, that is, after determining a test item of a hardware device, a test case corresponding to the test item is determined, and at this time, the corresponding test case is a plurality of test cases. And testing the test result of the test item through a plurality of test cases, wherein under the condition that the number of the test cases is a plurality of, the number of the static global variable names is one, the number of the target static global variable values is a plurality, and changing the initial static global variable values in the memory space to the corresponding target static global variable values to correspondingly obtain a plurality of target test data of the hardware equipment. The multiple test cases can be executed according to a predetermined sequence or according to a certain rule, and are not limited herein, so long as the corresponding tests can be completed, and the purpose of executing the multiple test cases to obtain the test results of the test items is achieved. Moreover, multiple test items can provide more comprehensive evaluation, so that the advantages and disadvantages of the hardware equipment can be more accurately determined, potential problems and errors can be more effectively found through multiple tests, measures can be timely taken for correction and improvement, and the reliability and stability of the hardware equipment can be enhanced through multiple tests on different aspects. Multiple tests can also help avoid the high costs of extensive repair work at a later stage throughout the development process.
As an alternative embodiment, after determining the test item corresponding to the hardware device, the method further includes: and determining a test item corresponding to the combined hardware device, wherein the combined hardware device is a hardware device obtained by combining the hardware device with other hardware devices.
In this embodiment, the test item corresponding to the combined hardware device is determined, which means that after the test item of the hardware device is tested, the combined hardware device obtained after the hardware device is assembled may also be tested. For example, in the case where the hardware device is a robot, the other hardware device may be a robot tentacle, and the two may be combined into a robot with a robot tentacle, which is tested. The method comprises the steps of executing a test item corresponding to the combined hardware device, calling a test case under the test item, wherein the test case comprises a static global variable name, a target static global variable value and expected test result data, executing the test case, determining a memory space storing an initial static global variable value according to the static global variable name, modifying the initial static global variable value in the memory space to the target static global variable value, determining target test data of the combined hardware device, obtaining a test result of the test item according to the target test data and the expected test result data, and the like, obtaining a test result of the combined hardware device, and achieving the technical effect of comprehensive test.
As an alternative embodiment, before invoking the test case under the test item, the method further includes: acquiring device data of hardware devices; and constructing test cases under the test item according to the equipment data.
In this embodiment, the device data of the hardware device is obtained, which test is to be performed by the hardware device, i.e. which test item is to be performed, can be determined according to some specific settings of the hardware device, and a test case under the test item is constructed, so that the test case can be directly invoked for testing when the device is used subsequently, which is beneficial to improving the hardware test efficiency.
As an alternative embodiment, after obtaining the test result obtained by executing the test item according to the target test data and the expected test data, the method further includes: and sending alarm information to a preset terminal under the condition that the test result is that the test item is abnormal, wherein the alarm information carries the test item.
In this embodiment, when the test result is that the test item is abnormal, the alarm information may be sent to the predetermined terminal, and since the alarm information carries the test item, a person using the predetermined terminal may know the abnormality in time and process the abnormality in time.
Based on the foregoing embodiments and optional embodiments, an optional implementation is provided, and is specifically described below.
In an alternative embodiment of the present application, a method for testing a robot is provided, fig. 2 is a test flow chart provided in an alternative embodiment of the present application, and as shown in fig. 2, an alternative embodiment of the present application is described below.
S1, an environment configuration link;
and setting environment parameters for accurately positioning the physical environment of the corresponding robot in the execution process of the automatic program. The parameters here may include the name of the robot, the physical address (e.g.ip) and in some cases the corresponding communication port.
S2, testing a standby example link;
the method comprises the steps of assigning an initial static global variable value to a created static global variable by a hardware component which needs to be operated by a robot, externally connected with hardware to be operated, generally a gripper and the like in the robot industry.
S3, testing an execution case link;
s3.1, determining a test item corresponding to the robot;
such as a test robot gripper.
S3.2, calling a test case under the test item, wherein the test case comprises a static global variable name, a target static global variable value and expected test result data;
for example, in the 1 st use case, the static global variable name is a variable name of a variable corresponding to each input/output IO setting control of the gripper switch, and the target static global variable value is a variable value set as the gripper opening, so that the gripper is placed in an open state, and the expected test result data is a test result corresponding to the gripper opening.
In the 2 nd use case, the static global variable name is the variable name of each IO setting corresponding variable of the control gripper switch, the gripper is set to grip objects, the target static global variable value is the variable value corresponding to the distance from the gripper to the two sides of 2cm, and the expected test result data is that the gripper is closed to the distance of 2cm.
S3.3, executing the test case, and determining a memory space storing initial static global variable values according to the static global variable names;
for example, a memory space storing static global variables for each IO setting controlling the grip switch is determined.
S3.4, modifying the initial static global variable value in the memory space to a target static global variable value, and determining target test data of the robot;
and S3.5, obtaining the test result of the test item according to the target test data and the expected test result data.
It should be noted that fig. 3 is a schematic diagram of a serial test provided by an alternative embodiment of the present application, and fig. 4 is a schematic diagram of a parallel test provided by an alternative embodiment of the present application.
When the test automation is actually executed, the test automation task is controlled by the server. When there is only one server, each test case may run serially, as shown in FIG. 3. In this case, the total time of test automation run is the sum of the individual test case run times.
When the number of servers is sufficient, it may be set to divide the plurality of test cases into a plurality of test case groups, so that the plurality of test case groups can run in parallel, as shown in fig. 4. In this case, the total time of the test automation run is the test case group run time with the longest run time.
By the alternative embodiments, at least the following advantages can be achieved:
1) Compared with an automatic test scheme of pure software, the scheme can call external hardware when the automatic test is executed, so that the existing category of software test automation is widened, and the possibility is provided for the test automation of more soft and hard combined products;
2) According to the test automation scheme, the test preparation cases are adopted to uniformly manage the external hardware, so that the subsequent test cases can conveniently call the external hardware, the stability and the order of the test are greatly ensured, excessive manpower input of subsequent maintenance is avoided, and the test efficiency is improved;
3) The return value variable of the hardware execution result is read, so that the hardware execution result can be returned to the final execution result of the test automation, the result is digitally presented, the test management cost is reduced, and the quality of the product is improved to be controlled quickly;
4) Different test preparation cases are designed according to different external hardware compositions, and all specific test execution cases are divided into different groups according to different external hardware/test preparation cases. Each automatic test group can be sequentially executed through the scheduling of CICD, so that the test cases are completely executed without human participation, and the automatic test execution efficiency is improved;
5) The automatic test execution time is faster than that of manual test, so that the test execution time can be saved, and the test work efficiency can be improved.
6) All connected external hardware are assigned to the static constants with meaningful names in the test preparation cases, so that each subsequent test case can conveniently call the corresponding hardware; if any hardware changes exist, the corresponding variable assignment is only updated in the test case, and large-scale changes on an automation frame or a specific automation script are not needed.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present application.
Example 2
According to an embodiment of the present application, there is further provided an apparatus for implementing the above-mentioned hardware testing method, and fig. 5 is a block diagram of a hardware testing apparatus according to an embodiment of the present application, as shown in fig. 5, where the apparatus includes: the first determination module 502, the calling module 504, the second determination module 506, the modifying module 508, and the third determination module 510 are described in detail below.
A first determining module 502, configured to determine a test item corresponding to a hardware device; a calling module 504, coupled to the first determining module 502, for calling a test case under the test item, where the test case includes a static global variable name, a target static global variable value, and expected test result data; the second determining module 506 is connected to the calling module 504, and is configured to execute the test case, and determine a memory space storing the initial static global variable value according to the static global variable name; the modifying module 508 is connected to the second determining module 506, and is configured to modify the initial static global variable value in the memory space to a target static global variable value, and determine target test data of the hardware device; the third determining module 510 is connected to the modifying module 508, and is configured to obtain a test result of the test item according to the target test data and the expected test result data.
It should be noted that the first determining module 502, the calling module 504, the second determining module 506, the modifying module 508, and the third determining module 510 correspond to steps S102 to S110 in implementing the hardware testing method, and the plurality of modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in the foregoing embodiment 1.
Example 3
According to another aspect of the embodiment of the present application, there is also provided an electronic device including: a processor; a memory for storing processor-executable instructions, wherein the processor is configured to execute the instructions to implement the hardware testing method of any of the above.
Example 4
According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform any one of the hardware testing methods described above.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method for testing hardware, comprising:
determining a test item corresponding to the hardware equipment;
calling a test case under the test item, wherein the test case comprises a static global variable name, a target static global variable value and expected test result data;
executing the test case, and determining a memory space storing initial static global variable values according to the static global variable names;
modifying the initial static global variable value in the memory space to the target static global variable value, and determining target test data of the hardware equipment;
and obtaining the test result of the test item according to the target test data and the expected test result data.
2. The method of claim 1, wherein modifying the initial static global variable value in the memory space to the target static global variable value, prior to determining target test data for the hardware device, further comprises:
determining an initial static global variable value corresponding to the test case;
and writing the initial static global variable value into the memory space to obtain the memory space storing the initial static global variable value.
3. The method of claim 1, wherein the executing the test case, based on the static global variable name, determines a memory space storing an initial static global variable value, comprises:
configuring a test environment for executing test on the hardware equipment;
checking the test environment to obtain an environment test result;
and executing the test case under the condition that the environment test result is that the test environment passes, and determining the memory space storing the initial static global variable value according to the static global variable name.
4. The method of claim 1, wherein said modifying the initial static global variable value in the memory space to the target static global variable value, determining target test data for the hardware device, comprises:
and under the condition that the test cases comprise a plurality of test cases, modifying the initial static global variable value in the memory space to a corresponding target static global variable value, and determining a plurality of target test data of the hardware equipment, wherein the plurality of test cases are in one-to-one correspondence with the plurality of target test data.
5. The method of claim 1, wherein after determining the test item corresponding to the hardware device, further comprising:
and determining a test item corresponding to a combined hardware device, wherein the combined hardware device is a hardware device obtained by combining the hardware device with other hardware devices.
6. The method of claim 1, wherein the invoking is prior to the test case under the test item, further comprising:
acquiring device data of the hardware device;
and constructing test cases under the test item according to the equipment data.
7. The method of claim 1, wherein after obtaining the test result obtained by executing the test item according to the target test data and the expected test data, further comprising:
and sending alarm information to a preset terminal under the condition that the test result is that the test item is abnormal, wherein the alarm information carries the test item.
8. A hardware testing apparatus, comprising:
the first determining module is used for determining a test item corresponding to the hardware equipment;
the calling module is used for calling the test case under the test item, wherein the test case comprises a static global variable name, a target static global variable value and expected test result data;
the second determining module is used for executing the test case and determining a memory space storing initial static global variable values according to the static global variable names;
the modification module is used for modifying the initial static global variable value in the memory space to the target static global variable value and determining target test data of the hardware equipment;
and the third determining module is used for obtaining the test result of the test item according to the target test data and the expected test result data.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the hardware testing method of any one of claims 1 to 7.
10. A computer readable storage medium, characterized in that instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the hardware testing method of any one of claims 1 to 7.
CN202310773621.2A 2023-06-27 2023-06-27 Hardware testing method, device, electronic equipment and computer readable storage medium Pending CN116872251A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310773621.2A CN116872251A (en) 2023-06-27 2023-06-27 Hardware testing method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310773621.2A CN116872251A (en) 2023-06-27 2023-06-27 Hardware testing method, device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116872251A true CN116872251A (en) 2023-10-13

Family

ID=88257749

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310773621.2A Pending CN116872251A (en) 2023-06-27 2023-06-27 Hardware testing method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116872251A (en)

Similar Documents

Publication Publication Date Title
US9411710B2 (en) Automated regression test case selector and black box test coverage tool for product testing
CN105389256A (en) Unit testing method and system
CN102595184B (en) Intelligent television automation test method and system
CN110347590A (en) The interface testing control method and device of operation system
CN110990289B (en) Method and device for automatically submitting bug, electronic equipment and storage medium
CN112260885B (en) Industrial control protocol automatic test method, system, device and readable storage medium
CN107357721B (en) Method and device for testing system
CN113448826A (en) Software automation test system and method
CN114996127A (en) Intelligent test method and system for solid state disk firmware module
CN111767218B (en) Automatic test method, equipment and storage medium for continuous integration
CN117290255A (en) Batch interface performance test method based on Python and Locut frameworks
CN113127331B (en) Test method and device based on fault injection and computer equipment
CN111290902B (en) Switch port pressure testing method, device, equipment and medium
CN116872251A (en) Hardware testing method, device, electronic equipment and computer readable storage medium
CN111427582A (en) Management method, device and equipment of RT L code and computer readable storage medium
CN115470141A (en) Fault simulation method, device and related equipment
CN108932355B (en) Logic verification method and device
CN115576810A (en) Automatic testing method, system, medium and computing device for real-time alarm
CN115220707A (en) Software development management method and system based on block chain
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
CN113254332A (en) Multi-scenario testing method, system, terminal and storage medium for storage system
CN115437903A (en) Interface test method, device, apparatus, storage medium, and program
CN112416805A (en) Test management cloud platform and method
CN112350879A (en) Data communication equipment test management method, device, system and storage medium
CN106992873B (en) Protection group processing method and device

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