CN112181749A - Hardware testing method and device, electronic equipment and storage medium - Google Patents
Hardware testing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112181749A CN112181749A CN202011119729.2A CN202011119729A CN112181749A CN 112181749 A CN112181749 A CN 112181749A CN 202011119729 A CN202011119729 A CN 202011119729A CN 112181749 A CN112181749 A CN 112181749A
- Authority
- CN
- China
- Prior art keywords
- hardware
- api
- test
- interface
- tested
- 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 271
- 238000000034 method Methods 0.000 claims abstract description 34
- 230000006870 function Effects 0.000 claims description 74
- 230000008569 process Effects 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 4
- 230000000007 visual effect Effects 0.000 claims description 4
- 238000004806 packaging method and process Methods 0.000 claims description 2
- 239000004744 fabric Substances 0.000 claims 1
- 238000013461 design Methods 0.000 abstract description 7
- 238000004891 communication Methods 0.000 description 15
- 238000010586 diagram Methods 0.000 description 11
- 239000008186 active pharmaceutical agent Substances 0.000 description 4
- 230000004913 activation Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000009849 deactivation Effects 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011990 functional testing Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2268—Logging of test results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
-
- 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)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a hardware testing method, a hardware testing device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining the API type and API calling sequence of an application program interface API corresponding to the hardware to be tested according to the acquired parameter scene; sequentially calling interface test cases in a preset test form through the API types and the API calling sequence to test the hardware to be tested; and displaying the test result of the hardware to be tested on a preset interface. According to the technical scheme of the embodiment of the invention, the API type and the API calling sequence of the hardware to be tested are determined through the reference scene, and the corresponding interface test case is obtained for hardware testing, so that the repeated design time of the test case is reduced, the hardware testing efficiency is improved, the application scene is assisted to be quickly restored by a client, the difficulty of fault location is reduced, the problem location efficiency is improved, and the user experience degree can be enhanced.
Description
Technical Field
The embodiment of the invention relates to the technical field of hardware testing, in particular to a hardware testing method and device, electronic equipment and a storage medium.
Background
OpenCPU is an application mode using a module as a main processor, and with the development of communication technology and the continuous change of the market, more and more users recognize the advantages of OpenCPU solutions. The OpenCPU is gradually applied to a wireless communication module and is used for solving the problems of processor and FLASH memory resources in a shared module. The structures of the normal communication module and the OpenCpu communication module may be as shown in fig. 1a and fig. 1b, where a conventional communication module needs to have a process of parsing an instruction and outputting a result with a Micro Control Unit (MCU), and the OpenCpu communication module may directly call an Application Program Interface (API) through the MCU. For an OpenCpu communication module, a conventional test method is that a tester designs a test case for an interface to be tested, writes test codes according to a parameter entry condition scene, compiles and generates a pac file of an example demo, and downloads the pac file to the communication module for testing during testing. Since the entry condition scenario of the communication module includes a plurality of API call procedures, test cases need to be designed for the APIs one by one and the procedures described above need to be repeated, and the test procedure of the OpenCpu communication module takes a lot of time.
Disclosure of Invention
The invention provides a hardware testing method, a hardware testing device, electronic equipment and a storage medium, which are used for realizing the rapid testing of hardware, improving the multiplexing times of test cases, reducing the time cost of hardware testing and reducing the testing difficulty.
In a first aspect, an embodiment of the present invention provides a hardware-side method, where the method includes:
determining the API type and API calling sequence of an application program interface API corresponding to the hardware to be tested according to the acquired parameter scene;
sequentially calling interface test cases in a preset test form through the API types and the API calling sequence to test the hardware to be tested;
and displaying the test result of the hardware to be tested on a preset interface.
In a second aspect, an embodiment of the present invention further provides a hardware testing apparatus, where the apparatus includes:
the attribute information module is used for determining the API type and the API calling sequence of the application program interface API corresponding to the hardware to be tested according to the acquired parameter entering scene;
the test execution module is used for sequentially calling interface test cases in a preset test form through the API types and the API calling sequence to test the hardware to be tested;
and the result display module is used for displaying the test result of the hardware to be tested on a preset interface.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a memory for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the hardware testing method according to any one of the embodiments of the present invention.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the hardware testing method according to any one of the embodiments of the present invention.
According to the embodiment of the invention, the API type and the calling sequence of the application program interface corresponding to the hardware to be tested are determined through the reference scene, the interface test case corresponding to the hardware to be tested is searched in the preset test table through the API type and the calling sequence, the hardware to be tested is tested, and the test result is displayed on the preset interface, so that the rapid test of the hardware to be tested is realized, the repeated design time of the test case is reduced, the hardware test efficiency is improved, a client is assisted to rapidly restore the application scene, the difficulty in fault positioning is reduced, and the problem positioning efficiency is improved.
Drawings
Fig. 1a is a schematic structural diagram of a conventional communication module in the prior art;
FIG. 1b is a schematic diagram illustrating a structure of an OpenCpu communication module in the prior art;
FIG. 2 is a time consuming analysis example diagram of a conventional API test in the prior art;
FIG. 3 is a flowchart of a hardware testing method according to an embodiment of the present invention;
FIG. 4 is a flowchart of another hardware testing method according to the second embodiment of the present invention;
fig. 5 is an exemplary diagram of a grouping model of API interface test modules in a preset interface according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of a hardware testing apparatus according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be noted that, for convenience of description, only a part of the structures related to the present invention, not all of the structures, are shown in the drawings, and furthermore, embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
In a conventional hardware testing method, a tester designs a test case for an API of hardware to be tested, writes a section of test code according to a parameter entry condition scene, compiles and generates a pac file of a testing paradigm demo, and downloads the generated pac file into the hardware to be tested, so that the hardware to be tested is started to directly run the demo to complete the API test of the scene, and a test result is recorded. And then repeating the steps aiming at another API of the hardware to be tested to realize coding, downloading and running. It can be seen that the traditional hardware test has low test efficiency and takes a lot of time for demo encoding and compiling and debugging. FIG. 2 is a time-consuming analysis example diagram of a conventional API test in the prior art, referring to FIG. 2, assuming that the basic functional test is completed after the user basic engineering compilation is completed, the version release request is completed, and the test stage is entered, aiming at a test case one of an API a, a test scenario demo needs to be completed, at this time, a tester takes time t for coding, compiling and debugging scenarios11Time t for downloading demo packet to module2Running test demo time of use t3. Test case two of API b, total time t in the same way12+t2+t3Here, it is assumed that the demo version download time t2And test case runtime t3The change is not changed; correspondingly, the total time of the test cases n up to API n is t1n+t2+t3Then if the total elapsed time to test n test cases may be t11+t12+…+t1n+nt2+nt3. Tested for hardware under testThe method of the embodiment of the invention calls the integrated test case through the use scene of the hardware to be tested, so that the time cost of the coding in the test process can be reduced, and the test efficiency of the hardware is improved.
Example one
Fig. 3 is a flowchart of a hardware testing method according to an embodiment of the present invention, where the method is applicable to a situation of testing a complex application scenario of an OpenCpu communication module, and the method may be executed by a hardware testing device, and the device may be implemented in a hardware and/or software manner, referring to fig. 3, the method according to the embodiment of the present invention specifically includes the following steps:
The parameter entering scene may be a hardware application scene to be tested, the parameter entering scene may include a use function of hardware and a use sequence of each function, the hardware to be tested may be hardware to be tested, and may be hardware provided with an application program interface, for example, a conventional communication module, an OpenCpu communication module, and the like.
In an embodiment of the present invention, the application program interface API may be a function interface included in the hardware under test, and the API may be some predefined function in order to provide the capability of accessing a set of routines based on software and/or hardware. The API type may be attribute information of the API, specifically, the API type used by the hardware to be tested in the parameter entering scenario, and the API calling order may be an order in which the hardware to be tested calls the API in the parameter entering scenario.
Specifically, after a parameter entering scene of the hardware to be tested is obtained, the API type and the API calling order of the application program interface API in the hardware to be tested can be determined by using the hardware to be tested in the parameter entering scene, for example, one parameter entering scene may include operations of sequentially performing startup, Packet data protocol (Packet data protocol) activation, obtaining IMEI, obtaining Plmn, Pdp deactivation, obtaining a network connection state, dialing 10086, hanging up a telephone and obtaining a network connection state, and the like, the corresponding API type may be determined according to the operation executed by the equipment to be tested, and the API calling order may be determined according to the sequence of the operation executed by the equipment to be tested.
And 102, sequentially calling interface test cases in a preset test form to test the hardware to be tested through the API types and the API calling sequence.
The preset test form may be a data table in which interface test cases are stored in advance, different APIs in the preset test form may correspond to different interface test cases, and the interface test cases and the APIs may be stored in the preset test form in an associated manner. An interface test case may be a set of test outputs, execution conditions, and expected outputs that are programmed to test an API, and may test whether an API meets certain requirements.
In the embodiment of the invention, the interface test cases corresponding to the API types can be sequentially searched in the preset test form according to the API calling sequence, and the obtained interface test cases are used for testing the corresponding API in the hardware to be tested to obtain the test output. It can be understood that the manner of obtaining the interface test cases and using the interface test cases to test the hardware to be tested is not limited, and after all the interface test cases are obtained according to the API call sequence, the hardware to be tested can be sequentially tested according to the API call sequence by using the interface test cases. And testing the hardware to be tested by using the interface test case every time one interface test case is obtained according to the API calling sequence.
And 103, displaying the test result of the hardware to be tested on a preset interface.
Specifically, the obtained test results of the interface test cases can be summarized and analyzed, and the analysis results can be displayed on a preset interface. It is understood that the test result of the hardware to be tested can be displayed in at least one of a chart, a text and a video.
According to the embodiment of the invention, the API type and the calling sequence of the application program interface corresponding to the hardware to be tested are determined through the reference scene, the interface test case corresponding to the hardware to be tested is searched in the preset test table through the API type and the calling sequence, the hardware to be tested is tested, and the test result is displayed on the preset interface, so that the rapid test of the hardware to be tested is realized, the repeated design time of the test case is reduced, the hardware test efficiency is improved, and the user experience degree can be enhanced.
Further, on the basis of the above embodiment of the present invention, the preset process of presetting the test form includes: packaging an interface test case according to a using method of an Application Program Interface (API), wherein the interface test case at least comprises at least one of input parameters, output parameters and return values of the API; storing the interface test cases according to the hardware function of the corresponding API in a classified manner; and classifying the classified interface test cases according to corresponding hardware functions, and registering the classified interface test cases in a main function as a test module of a preset test form.
In the embodiment of the present invention, the interface test case may be information for testing the API of the hardware to be tested, can be composed of input parameters, output parameters and return values, can be made according to different API use modes, and the determined information is packaged into an interface test case corresponding to the API, in order to improve the test efficiency of the hardware to be tested, the interface test cases generated by encapsulation can be classified according to the hardware function of the hardware to be tested implemented by the corresponding API, and the interface test cases with different functions are stored under different hardware function classifications, for example, the interface test cases can be divided according to hardware function classifications such as a common test model, a network information module, an equipment information module and a file information module, and interface test cases corresponding to different APIs for realizing corresponding hardware functions are stored under different hardware function classifications. Before using the interface test cases, it is necessary to register each test case, for example, to register a test module in a software main function implementing the method of this embodiment, so that the main function uses a corresponding interface test case to test the hardware to be tested when acquiring the call information.
Further, on the basis of the above embodiment of the present invention, the interface test cases belonging to the same hardware function class are managed using the same structure.
In the embodiment of the present invention, interface test cases belonging to the same hardware function classification may be placed in a container, and the interface test cases may be managed using the same structure, where a hardware function classification General _ Info of an interface test case is an example, and the structure corresponding to each interface test case may be represented as follows:
example two
Fig. 4 is a flowchart of another hardware testing method provided in the second embodiment of the present invention, the second embodiment of the present invention is embodied on the basis of the foregoing second embodiment of the present invention, and referring to fig. 4, the method provided in the second embodiment of the present invention specifically includes the following steps:
Specifically, the preset interface may be a visual page for showing each interface test case of the test API to the user, fig. 5 is an exemplary diagram of a grouping model of the API interface test module in the preset interface according to a second embodiment of the present invention, and referring to fig. 5, the hardware function classification of different hardware functions, such as general information, device test, wireless network test, audio test, and the like, may be shown through the preset interface. The user can select the hardware functions to be tested in turn from the hardware function classes displayed in the preset interface, and the hardware functions can be realized by the API in the hardware to be tested. Attribute information corresponding to a hardware function input by a user may be used as function information of a participating scene, and a sequence in which the hardware function is input by the user may be used as a function execution sequence of the participating scene.
In the embodiment of the present invention, the hardware function in the hardware to be tested may be implemented by an API, the API type for implementing the corresponding function in the hardware to be tested may be searched through the obtained function information, and the function execution sequence may be directly used as the API call sequence, and the API corresponding to the function that is executed first in the participating scene may be called first.
It can be understood that the function information and the API type may be pre-stored, and the API type corresponding to the function information may be determined by the pre-stored information in the search process, and the function information and the API type may be stored in association as the following table:
hardware function | API kind |
Starting up | Power on |
Activation of Pdp | Pdp Active |
Obtaining Imei | Get Imei |
Obtaining Plmn | Get Plmn |
Pdp deactivation | Pdp Deactive |
Obtaining network connection status | Get act state |
Dial 10086 | Dial 10086 |
Hanging up telephone | Hangup |
Obtaining network connection status | Get act state |
It can be understood that the above-indicated hardware functions and API types are an exemplary case, different participation scenarios may include different hardware functions and API types, and a user may customize different participation scenarios to obtain different associated storage tables of function information and API types.
And 203, sequentially calling interface test cases corresponding to the API types in a preset test form according to the API calling sequence, wherein at least one interface test case is stored in the preset test form according to the API function classification.
In the embodiment of the invention, the interface test cases in the pre-test form can be stored according to the API function classification, and the interface test cases belonging to the same API function classification are used for testing the API realizing the same hardware function. Interface test cases corresponding to the API types can be sequentially searched in a preset test form according to the API calling sequence, and one or more obtained interface test cases are used for carrying out the subsequent hardware test process.
And step 204, inputting the interface test case into the hardware to be tested to execute the hardware test.
In the embodiment of the invention, one or more acquired interface test cases can be downloaded to the hardware to be tested, and the test corresponding to the interface test case is executed on the hardware to be tested. It can be understood that the execution sequence of each interface test case in the hardware to be tested can be the same as the calling sequence of the API in the parameter entering scene, and the API called first formulates the corresponding interface test case first.
And step 205, acquiring output parameters of the test case of the interface corresponding to the hardware to be tested.
Specifically, the hardware to be tested can be monitored by using a serial port, and the output parameters corresponding to the interface test cases are obtained.
And step 206, visually displaying the test result generated by analyzing the output parameter on a preset interface, wherein the visual display at least comprises at least one of character display, chart display and animation display.
In the embodiment of the present invention, the obtained output parameters may be analyzed, for example, the output parameters are compared with the standard values to determine whether the corresponding interface is correct, and if so, the test result of the test case of the corresponding interface is determined to be a test success, otherwise, the test failure is determined. And generating a test result by analyzing the output parameters corresponding to the test cases of each interface, and displaying the test result in a preset interface through one or more of characters, diagrams or animation.
And step 207, storing at least one of information of the API type, the API calling sequence and the parameter entering scene as a scene test case.
Specifically, the relevant information process of the test process of the hardware to be tested may be stored, the stored information may be used as a scenario test case, and the storage content may include an API type, an API call sequence, a participation scenario, and the like. When the same entry scene is encountered, the scene test case can be directly used for testing the hardware to be tested, so that the test efficiency is further improved.
In the embodiment of the invention, the function information and the function execution sequence corresponding to the hardware to be tested, which are input by a user, are acquired through the preset interface and are used as the participation scene, determines the kind of API by the function information and determines the API calling order according to the function execution order, sequentially searching interface test cases corresponding to the API types in a preset test form according to the API calling sequence, downloading the interface test cases to the hardware to be tested for testing, collecting output parameters of the interface test cases corresponding to the hardware to be tested, and the test result generated by analyzing the output parameter is visually displayed on a preset interface, and at least one of the API type, the API calling sequence and the parameter entering scene is stored as a scene test case, so that the rapid test of the application program interface in the hardware test is realized, the case repeated design time of each interface is reduced, the hardware test efficiency is improved, and the user experience is improved.
EXAMPLE III
Fig. 6 is a schematic structural diagram of a hardware testing apparatus according to a third embodiment of the present invention, and the apparatus shown in fig. 6 can execute a hardware testing method according to any embodiment of the present invention, and functional modules and beneficial effects corresponding to the specific method. The device can be implemented by software and/or hardware, and specifically comprises: an attribute information module 301, a test execution module 302 and a result presentation module 303.
And the attribute information module 301 is configured to determine, according to the obtained parameter scene, an API type and an API call sequence of the application program interface API corresponding to the hardware to be tested.
And the test execution module 302 is configured to sequentially call interface test cases in a preset test form to test the hardware to be tested according to the API types and the API calling sequences.
And a result displaying module 303, configured to display a test result of the hardware to be tested on a preset interface.
According to the embodiment of the invention, the API type and the calling sequence of the application program interface corresponding to the hardware to be tested are determined through the attribute information module input parameter scene, the test execution module searches the interface test case corresponding to the hardware to be tested in the preset test table through the API type and the calling sequence and tests the hardware to be tested, and the result display module displays the test result on the preset interface, so that the rapid test of the hardware to be tested is realized, the repeated design time of the test case is reduced, the hardware test efficiency is improved, and the user experience degree can be enhanced.
Further, on the basis of the above embodiment of the present invention, the attribute information module 301 includes:
and the interface monitoring unit is used for acquiring the function information and the function execution sequence of the hardware to be tested, which are input by a user, as a participation scene through a preset interface.
And the information determining unit is used for determining the API type for realizing the function corresponding to the function information and taking the function execution sequence as the API calling sequence.
Further, on the basis of the above embodiment of the present invention, the test execution module 302 includes:
and the case obtaining unit is used for sequentially calling the interface test cases corresponding to the API types in the preset test form according to the API calling sequence, wherein at least one interface test case is stored in the preset test form according to the API function classification.
And the test execution unit is used for inputting the interface test case into the hardware to be tested so as to execute the hardware test.
Further, on the basis of the embodiment of the present invention, the interface test case package system further includes a form setting module, configured to package the interface test case according to a use method of the application program interface API, where the interface test case at least includes at least one of an input parameter, an output parameter, and a return value of the API; storing the interface test cases according to the hardware function of the corresponding API in a classified manner; and classifying the classified interface test cases according to corresponding hardware functions, and registering the classified interface test cases in a main function as a test module of a preset test form.
Further, on the basis of the above embodiment of the present invention, the interface test cases belonging to the same hardware function classification in the form setting module are managed by using the same structural body.
Further, on the basis of the above embodiment of the invention, the result displaying module 303 includes:
and the output parameter unit is used for acquiring the output parameters of the interface test case corresponding to the hardware to be tested.
And the result display unit is used for visually displaying the test result generated by analyzing the output parameters on a preset interface, wherein the visual display at least comprises at least one of character display, chart display and animation display.
Further, on the basis of the above embodiment of the invention, the apparatus further includes:
and the scene case module is used for storing at least one information of the API type, the API calling sequence and the parameter entering scene as a scene test case.
Example four
Fig. 7 is a schematic structural diagram of an electronic apparatus according to a fourth embodiment of the present invention, as shown in fig. 7, the electronic apparatus includes a processor 70, a memory 71, an input device 72, and an output device 73; the number of the processors 70 in the electronic device may be one or more, and one processor 70 is taken as an example in fig. 7; the processor 70, the memory 71, the input device 72 and the output device 73 in the electronic apparatus may be connected by a bus or other means, and the bus connection is exemplified in fig. 7.
The memory 71 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program modules corresponding to the hardware testing method in the embodiment of the present invention (for example, the attribute information module 301, the test execution module 302, and the result presentation module 303 in the hardware testing apparatus). The processor 70 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the memory 71, that is, implements the hardware testing method described above.
The memory 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 71 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 71 may further include memory located remotely from the processor 70, which may be connected to the electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 72 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic apparatus. The output device 73 may include a display device such as a display screen.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium containing a computer program, which when executed by a computer processor is configured to perform a hardware testing method, the method including:
determining the API type and API calling sequence of an application program interface API corresponding to the hardware to be tested according to the acquired parameter scene;
sequentially calling interface test cases in a preset test form through the API types and the API calling sequence to test the hardware to be tested;
and displaying the test result of the hardware to be tested on a preset interface.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the hardware testing method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the hardware testing apparatus, the included units and modules are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (10)
1. A method for hardware testing, the method comprising:
determining the API type and API calling sequence of an application program interface API corresponding to the hardware to be tested according to the acquired parameter scene;
sequentially calling interface test cases in a preset test form through the API types and the API calling sequence to test the hardware to be tested;
and displaying the test result of the hardware to be tested on a preset interface.
2. The method according to claim 1, wherein the determining the API type and API calling order of the API corresponding to the application program interface of the hardware to be tested according to the obtained reference scene includes:
acquiring function information and a function execution sequence of the hardware to be tested, which are input by a user, as a participation scene through a preset interface;
determining the API type for realizing the function corresponding to the function information, and taking the function execution sequence as the API calling sequence.
3. The method of claim 1, wherein the sequentially calling interface test cases in a preset test form through the API types and the API calling order to test the hardware to be tested comprises:
sequentially calling the interface test cases corresponding to the API types in the preset test form according to the API calling sequence, wherein at least one interface test case is stored in the preset test form according to the API function classification;
and inputting the interface test case into the hardware to be tested to execute hardware test.
4. The method according to claim 1 or 3, wherein the preset process of the preset test form comprises:
packaging an interface test case according to a using method of an Application Program Interface (API), wherein the interface test case at least comprises at least one of input parameters, output parameters and return values of the API;
storing the interface test cases according to the hardware function of the corresponding API in a classified manner;
and classifying the classified interface test cases according to corresponding hardware functions, and registering the classified interface test cases in a main function as a test module of a preset test form.
5. The method of claim 4, wherein interface test cases belonging to the same hardware functional class are managed using the same fabric.
6. The method of claim 1, wherein the displaying the test result of the hardware under test on a preset interface comprises:
acquiring output parameters of the interface test case corresponding to the hardware to be tested;
and visually displaying the test result generated by analyzing the output parameters on a preset interface, wherein the visual display at least comprises at least one of character display, chart display and animation display.
7. The method of claim 1, further comprising:
and storing at least one information of the API type, the API calling sequence and the parameter entering scene as a scene test case.
8. A hardware testing apparatus, the apparatus comprising:
the attribute information module is used for determining the API type and the API calling sequence of the application program interface API corresponding to the hardware to be tested according to the acquired parameter entering scene;
the test execution module is used for sequentially calling interface test cases in a preset test form through the API types and the API calling sequence to test the hardware to be tested;
and the result display module is used for displaying the test result of the hardware to be tested on a preset interface.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the hardware testing method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the hardware testing method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011119729.2A CN112181749A (en) | 2020-10-19 | 2020-10-19 | Hardware testing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011119729.2A CN112181749A (en) | 2020-10-19 | 2020-10-19 | Hardware testing method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112181749A true CN112181749A (en) | 2021-01-05 |
Family
ID=73949751
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011119729.2A Pending CN112181749A (en) | 2020-10-19 | 2020-10-19 | Hardware testing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112181749A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113225232A (en) * | 2021-05-12 | 2021-08-06 | 中国第一汽车股份有限公司 | Hardware testing method and device, computer equipment and storage medium |
CN113535554A (en) * | 2021-07-12 | 2021-10-22 | 青岛中科英泰商用系统股份有限公司 | Automatic test system and method for Android system equipment |
CN116069575A (en) * | 2022-12-23 | 2023-05-05 | 摩尔线程智能科技(北京)有限责任公司 | Adapter testing method and device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2801551A1 (en) * | 2012-01-12 | 2013-07-12 | Accenture Global Services Limited | System for generating test scenarios and test conditions and expected results |
CN110795328A (en) * | 2018-08-01 | 2020-02-14 | 北京京东尚科信息技术有限公司 | Interface testing method and device |
CN111124871A (en) * | 2018-10-31 | 2020-05-08 | 北京国双科技有限公司 | Interface test method and device |
CN111679989A (en) * | 2020-06-16 | 2020-09-18 | 贝壳技术有限公司 | Interface robustness testing method and device, electronic equipment and storage medium |
-
2020
- 2020-10-19 CN CN202011119729.2A patent/CN112181749A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2801551A1 (en) * | 2012-01-12 | 2013-07-12 | Accenture Global Services Limited | System for generating test scenarios and test conditions and expected results |
CN110795328A (en) * | 2018-08-01 | 2020-02-14 | 北京京东尚科信息技术有限公司 | Interface testing method and device |
CN111124871A (en) * | 2018-10-31 | 2020-05-08 | 北京国双科技有限公司 | Interface test method and device |
CN111679989A (en) * | 2020-06-16 | 2020-09-18 | 贝壳技术有限公司 | Interface robustness testing method and device, electronic equipment and storage medium |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113225232A (en) * | 2021-05-12 | 2021-08-06 | 中国第一汽车股份有限公司 | Hardware testing method and device, computer equipment and storage medium |
CN113535554A (en) * | 2021-07-12 | 2021-10-22 | 青岛中科英泰商用系统股份有限公司 | Automatic test system and method for Android system equipment |
CN113535554B (en) * | 2021-07-12 | 2024-03-12 | 青岛中科英泰商用系统股份有限公司 | Automatic testing system and method for Android system equipment |
CN116069575A (en) * | 2022-12-23 | 2023-05-05 | 摩尔线程智能科技(北京)有限责任公司 | Adapter testing method and device, electronic equipment and storage medium |
CN116069575B (en) * | 2022-12-23 | 2023-09-19 | 摩尔线程智能科技(北京)有限责任公司 | Adapter testing method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112181749A (en) | Hardware testing method and device, electronic equipment and storage medium | |
CN106339312B (en) | API test method and system | |
CN111159049B (en) | Automatic interface testing method and system | |
CN106557424B (en) | Memory test method, tested terminal, test client and system | |
CN110750442A (en) | Test case generation method, device, equipment and storage medium | |
CN111026645B (en) | User interface automatic test method and device, storage medium and electronic equipment | |
CN108459964B (en) | Test case selection method, device, equipment and computer readable storage medium | |
KR20080068385A (en) | Program test system, method and computer readable medium on which program for executing the method is recorded | |
CN108415830B (en) | Method and device for generating software test case | |
CN111181805B (en) | Micro-service test baffle generation method and system based on test case | |
CN107797922B (en) | Application page testing method, electronic device and electronic equipment | |
CN111475390A (en) | Log collection system deployment method, device, equipment and storage medium | |
CN114546738A (en) | Server general test method, system, terminal and storage medium | |
CN111475161A (en) | Method, device and equipment for accessing component | |
CN111625471A (en) | Execution processing and exception positioning method, device, equipment and medium of test case | |
CN111045879A (en) | Pressure test report generation method and device and storage medium | |
CN113590454A (en) | Test method, test device, computer equipment and storage medium | |
CN111694733A (en) | API (application programming interface) testing method and device for software development kit SDK (software development kit) | |
CN114238151A (en) | Software testing method and device, electronic equipment and storage medium | |
CN111008122A (en) | Test data generation method and device, computer equipment and storage medium | |
CN107656849B (en) | Method and device for positioning performance problem of software system | |
CN110989978A (en) | Page packaging method and device, electronic equipment and storage medium | |
CN106844186B (en) | Offline test method of application and terminal equipment | |
CN114756183A (en) | Data printing method, device, equipment and storage medium | |
CN111143227B (en) | Data operation method, device, terminal and storage medium |
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 |