Interface function test method and device, electronic equipment and storage medium

By obtaining the port number of the module to be tested and displaying its test instruction information, the interface function test is performed, which solves the problem of bloated test DEMO code in software development, realizes lightweight interface function testing, reduces the system test burden and ensures coverage Rate.

CN118796706APending Publication Date: 2024-10-18SHENZHEN STREAMING VIDEO TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411039571.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In software development, it is difficult for existing technologies to effectively reduce the burden of system testing, especially since multiple test scenarios require multiple interface combination calls, resulting in bloated test DEMO code and increased R&D workload. As test scenarios increase, test DEMO It needs to be continuously added and maintained.

Method used

By obtaining the port number of the module to be tested, instructing the user to perform a login operation, displaying the test instruction information of the module to be tested in the test interface, and executing the interface function test of the module to be tested according to the corresponding relationship, the integrated test of the interface function is realized without the need for specific Write DEMO code for each test scenario.

Benefits of technology

While ensuring interface test coverage, it reduces the system's testing burden, simplifies the testing process, avoids redundant DEMO code maintenance, and improves testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796706A_ABST
    Figure CN118796706A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of vehicle-mounted intelligent equipment, and provides an interface function testing method and device, electronic equipment and a storage medium, the interface function testing method comprises the steps that a port number corresponding to a to-be-tested module is acquired, and the to-be-tested module comprises at least one interface function; in response to a login operation that a user inputs the port number into a test client, test instruction information of the to-be-tested module is displayed in a test interface, and the test instruction information comprises a corresponding relationship between an instruction parameter and at least one interface function in the to-be-tested module; according to the corresponding relation, testing of at least one interface function in the to-be-tested module is executed. According to the scheme, the test burden of the system is relieved in a lightweight mode under the condition that the interface test coverage rate is guaranteed through a modular test mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of vehicle-mounted intelligent devices, and in particular, relates to an interface function testing method, device, electronic device and storage medium. Background Art

[0002] In software development, after the module function is developed, in order to ensure that R&D personnel can perform self-testing and troubleshooting, test DEMOs are usually developed based on existing codes to verify whether the interface functions meet expectations, and to perform boundary parameter testing and performance stress testing. However, the integrated approach of testing all scenarios will make the system bloated, because these test codes are not required for the official software and are only required in the testing phase. In addition, multiple test scenarios require multiple interface combination calls, which means that multiple test DEMOs are required to cover all scenarios, increasing the workload of R&D, and as the number of test scenarios increases, test DEMOs need to be continuously added and maintained.

[0003] Therefore, there is an urgent need to provide a testing method for interface functions that can reduce the testing burden of the system in a lightweight manner while ensuring interface test coverage. Summary of the invention

[0004] The embodiments of the present application provide an interface function testing method, device, electronic device and storage medium, which can reduce the testing burden of the system in a lightweight manner while ensuring the interface test coverage.

[0005] A first aspect of an embodiment of the present application provides an interface function testing method, the interface function testing method comprising:

[0006] Obtaining a port number corresponding to a module to be tested, wherein the module to be tested includes at least one interface function;

[0007] In response to a user inputting the port number into a test client for a login operation, displaying test instruction information of the module to be tested in a test interface, the test instruction information including a correspondence between an instruction parameter and at least one interface function in the module to be tested;

[0008] According to the corresponding relationship, a test of at least one interface function in the module to be tested is performed.

[0009] Optionally, different modules to be tested correspond to the same port number; in response to the user inputting the port number into the test client for login operation, displaying the test instruction information of the module to be tested in the test interface includes:

[0010] In response to a user inputting the port number into a test client for a login operation, displaying a plurality of candidate modules to be tested on a test interface;

[0011] In response to the name information of the target module to be tested input by the user, the test instruction information of the target module to be tested is displayed in the test interface, and the target module to be tested is one of the multiple candidate modules to be tested.

[0012] Optionally, performing a test on at least one interface function in the module to be tested according to the corresponding relationship includes:

[0013] According to the corresponding relationship, when a user inputs a target instruction parameter, a test of at least one interface function in the module to be tested corresponding to the target instruction parameter is executed;

[0014] The target instruction parameter corresponds to an interface function or a combination of multiple interface functions in the module to be tested.

[0015] Optionally, the performing a test of at least one interface function in the module to be tested according to the corresponding relationship further includes:

[0016] According to the corresponding relationship, execute a complete test of the module to be tested in the test instruction information;

[0017] The complete test includes corresponding interface function tests of all instruction parameters included in the module to be tested, and the corresponding functional interface tests include separate functional interface tests or combined functional interface tests.

[0018] Optionally, the test instruction information includes a reserved instruction parameter; and the interface function test method further includes:

[0019] According to the test scenario of the module to be tested, configuring a first correspondence between the reserved instruction parameter and the interface function included in the test scenario;

[0020] The test of the test scenario is executed according to a first correspondence between the reserved instruction parameter and the interface function included in the test scenario.

[0021] Optionally, the interface function testing method further includes:

[0022] Obtain all interface functions included in the full interface function test of the module to be tested;

[0023] A second corresponding relationship between an instruction parameter and all interface functions included in the full interface function test is configured, and the full interface function test of the module to be tested is executed according to the second corresponding relationship.

[0024] Optionally, before obtaining the port number corresponding to the module to be tested, the interface function testing method further includes:

[0025] In response to a user's triggering operation on the interface test file, a modular test framework is introduced to generate the test client.

[0026] A second aspect of an embodiment of the present application provides an interface function testing device, the interface function testing device comprising:

[0027] An acquisition module, used to acquire a port number corresponding to a module to be tested, wherein the module to be tested includes at least one interface function;

[0028] A display module, configured to display the test instruction information of the module to be tested in a test interface in response to a user inputting the port number into a login operation of a test client, wherein the test instruction information includes a correspondence between an instruction parameter and at least one interface function of the module to be tested;

[0029] The testing module is used to perform a test of at least one interface function in the module to be tested according to the corresponding relationship.

[0030] Optionally, when different modules to be tested correspond to the same port number, the display module may specifically include:

[0031] A login submodule, configured to display a plurality of candidate modules to be tested on a test interface in response to a user inputting the port number into a test client for a login operation;

[0032] The information display submodule is used to display the test instruction information of the target module to be tested in the test interface in response to the name information of the target module to be tested input by the user, and the target module to be tested is one of the multiple candidate modules to be tested.

[0033] Optionally, the test module may specifically include:

[0034] A first test execution submodule is used to execute a test of at least one interface function in a module to be tested corresponding to a target instruction parameter when a user inputs a target instruction parameter according to the corresponding relationship;

[0035] The target instruction parameter corresponds to an interface function or a combination of multiple interface functions in the module to be tested.

[0036] Optionally, the test module may further include:

[0037] A second test execution submodule, configured to execute a complete test of the module to be tested in the test instruction information according to the corresponding relationship;

[0038] The complete test includes corresponding interface function tests of all instruction parameters included in the module to be tested, and the corresponding functional interface tests include separate functional interface tests or combined functional interface tests.

[0039] Optionally, when the test instruction information includes a reserved instruction parameter, the interface function testing device further includes:

[0040] A configuration module, configured to configure, according to a test scenario of the module to be tested, a first correspondence between the reserved instruction parameter and the interface function included in the test scenario;

[0041] The first test execution module is used to execute the test of the test scenario according to a first corresponding relationship between the reserved instruction parameter and the interface function included in the test scenario.

[0042] Optionally, the interface function testing device further includes:

[0043] A function acquisition module, used to acquire all interface functions included in the full interface function test of the module to be tested;

[0044] The second test execution module is used to configure a second corresponding relationship between an instruction parameter and all interface functions included in the full interface function test, and execute the full interface function test of the module to be tested according to the second corresponding relationship.

[0045] Optionally, the interface function testing device further includes:

[0046] The client generation module is used to introduce a modular test framework in response to a user's triggering operation on the interface test file to generate the test client.

[0047] A third aspect of an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the method of the first aspect is implemented when the processor executes the computer program.

[0048] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method of the first aspect is implemented.

[0049] A fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the method of the first aspect.

[0050] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0051] The embodiment of the present application obtains the port number of the module to be tested including at least one interface function, instructs the user to perform a login operation, and then displays the test instruction information of the module to be tested in the test interface in response to the user entering the port number into the test client for login operation, that is, the correspondence between the instruction parameters for testing the module to be tested and at least one interface function in the module to be tested; finally, according to the correspondence, the test of at least one interface function in the module to be tested is executed. The above scheme integrates the test of the interface function into a module to be tested, and there is no need to write DEMO code for each test scenario, thereby reducing the testing burden of the system in a lightweight manner; and the module to be tested includes the test of at least one interface function, which ensures the coverage of the interface test. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0053] Figure 1 It is a flowchart of an interface function testing method provided in Example 1 of the present application;

[0054] Figure 2 It is a schematic diagram showing the display of test instruction information in the test interface;

[0055] Figure 3 Login flow chart when different modules to be tested correspond to the same port number;

[0056] Figure 4 It is a flowchart of an interface function testing method provided in Embodiment 2 of the present application;

[0057] Figure 5 It is a schematic diagram of the architecture of the modular test framework in the host system;

[0058] Figure 6 It is a structural schematic diagram of an interface function testing device provided in Embodiment 3 of the present application;

[0059] Figure 7 It is a structural schematic diagram of an electronic device provided in Example 4 of the present application. DETAILED DESCRIPTION

[0060] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0061] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0062] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0063] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0064] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0065] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0066] In software development, after the module function is developed, in order to ensure that R&D personnel can perform self-testing and troubleshooting, test DEMOs are usually developed based on existing codes to verify whether the interface functions meet expectations, and to perform boundary parameter testing and performance stress testing. However, the integrated approach of testing all scenarios will make the system bloated, because these test codes are not required for the official software and are only required in the testing phase. In addition, multiple test scenarios require multiple interface combination calls, which means that multiple test DEMOs are required to cover all scenarios, increasing the workload of R&D, and as the number of test scenarios increases, test DEMOs need to be continuously added and maintained.

[0067] In order to solve the above problems, the present application proposes an interface function testing method, which obtains the port number of a module to be tested including at least one interface function, instructs the user to perform a login operation, and then, in response to the user entering the port number into the test client for login operation, displays the test instruction information of the module to be tested in the test interface, that is, the correspondence between the instruction parameters for testing the module to be tested and at least one interface function in the module to be tested. Finally, according to the correspondence, the test of at least one interface function in the module to be tested is executed. The above scheme integrates the test of the interface function into a module to be tested, and there is no need to write DEMO code for each test scenario, thereby reducing the testing burden of the system in a lightweight manner. In addition, the module to be tested includes the test of at least one interface function, which ensures the coverage of the interface test.

[0068] It should be understood that the size of the serial numbers of the steps in this embodiment does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0069] In order to illustrate the technical solution of the present application, specific embodiments are provided below.

[0070] See also Figure 1 , shows a flow chart of an interface function testing method provided by an embodiment of the present application. Figure 1 As shown, the interface function testing method may include the following steps:

[0071] Step 101, obtaining the port number corresponding to the module to be tested.

[0072] The module to be tested may refer to a specific part or component in the software system, which includes at least one interface function to be tested. In the vehicle-mounted intelligent device of the present application, the module to be tested may refer to a 4G communication module, a Bluetooth module, a WIFI module, an Ethernet module, etc.

[0073] The port number refers to a numerical identifier used to distinguish different services or applications in a computer network. Different modules to be tested may correspond to the same port number or different port numbers, which is not limited in this application.

[0074] Each module to be tested includes at least one interface function. It should be understood that the interface function is a function or service provided by the module to be tested, which can be called through a specific interface (Application Programming Interface, API). These functions usually include data processing, business logic execution, etc. For example, if the module to be tested is a Bluetooth module, the interface that implements the Bluetooth function may include but is not limited to enabling, scanning, connecting, sending data, and setting local information, etc.

[0075] In the embodiment of the present application, the port number corresponding to the module to be tested can be obtained by presetting the correspondence between the module to be tested and the port number in the system. For example, the port number corresponding to the 4G communication module is 1001, the port number corresponding to the Bluetooth module is 1002, the port number corresponding to the WIFI module is 1003, and the port number corresponding to the Ethernet module is 1004.

[0076] It should be understood that the port number corresponding to the module to be tested can be obtained in response to the name of the module to be tested input by the user to obtain the corresponding port number, or the port numbers corresponding to all modules to be tested can be directly obtained to facilitate user viewing and selection. This application does not limit this.

[0077] Step 102: In response to the user inputting the port number into the test client for login, the test instruction information of the module to be tested is displayed in the test interface.

[0078] The test client refers to an application or tool for users to perform test operations, and the test client has a graphical user interface or a command line interface.

[0079] The user's login operation may refer to an operation in which the user inputs a port number on the test client to connect to the module to be tested.

[0080] The test instruction information may refer to the available instructions or operations provided by the test client, which are used to test the interface function of the module to be tested. Specifically, the test instruction information may include the correspondence between the instruction parameters and at least one interface function in the module to be tested. For example, if the module to be tested is a Bluetooth module, the correspondence between the instruction parameters and at least one interface function in the Bluetooth module may be: instruction parameter 1 corresponds to calling Bluetooth interface 1; instruction parameter 2 corresponds to calling Bluetooth interface 2; instruction parameter 3 corresponds to calling a Bluetooth stress test scenario, wherein the Bluetooth stress test scenario includes a combination of multiple interface functions.

[0081] The above test command information is only for illustrative purposes. In actual applications, the corresponding relationship between the command parameters and at least one interface function in the Bluetooth module can be configured according to the actual scenario. Figure 2 The schematic diagram of the display of the test instruction information in the test interface shown in the figure includes the corresponding relationship between multiple instruction parameters and at least one interface function in the Bluetooth module. After the user logs in to the test client using the port number of the Bluetooth module, the test interface of the test client can directly display Figure 2 Information in.

[0082] In a possible implementation, different modules to be tested correspond to the same port number. In response to a user inputting the port number into a test client for a login operation, test instruction information of the module to be tested is displayed in a test interface, including:

[0083] In response to a user inputting a port number into a test client for a login operation, a plurality of candidate modules to be tested are displayed on a test interface;

[0084] In response to the name information of the target module to be tested input by the user, the test instruction information of the target module to be tested is displayed in the test interface, and the target module to be tested is one of the multiple candidate modules to be tested.

[0085] In the embodiment of the present application, in order not to waste the port resources of the host system, each module to be tested can share a port. For example, the port number corresponding to the Bluetooth module and the port number corresponding to the WIFI module are both 1002. After using 1002 to log in to the test client, the name information of the Bluetooth module and the WIFI module can be displayed on the test interface. The user enters the name information of the Bluetooth module in the corresponding area of ​​the test interface, such as bttext, and the test interface displays the test instruction information of the Bluetooth module. The user enters the name information of the WIFI module in the corresponding area of ​​the test interface, such as wifitext, and the test interface displays the test instruction information of the WIFI module. For details, please refer to Figure 3 The login flow chart shown is when different modules to be tested correspond to the same port number.

[0086] In the above example, in order to facilitate the user to perform testing, after using 1002 to log in to the test client, the name information of the Bluetooth module and the WIFI module waiting to be tested can be displayed on the test interface. However, in order to save system resources, the test interface can also directly display the input window of the name information without displaying the name information of multiple modules to be tested corresponding to the port number. This application does not limit this.

[0087] In a possible implementation, in response to the user inputting the port number into the test client for login, the test client enters the command line mode, and the name information of the target module to be tested is input in the corresponding command line, and the test instruction information of the target module to be tested can be displayed.

[0088] Step 103: Execute a test of at least one interface function in the module to be tested according to the corresponding relationship.

[0089] In an embodiment of the present application, according to the correspondence between the instruction parameters and at least one interface function in the module to be tested, different combinations of instructions and parameters can be executed to test a separate interface. For example, instruction 1 is to test the enablement of Bluetooth, parameter 1 is to turn on Bluetooth, and parameter 2 is to turn off Bluetooth. Then, the combination of instruction 1 and parameter 1 can test the Bluetooth on function, and the combination of instruction 1 and parameter 2 can test the Bluetooth off function.

[0090] For example, for a Bluetooth module, the interfaces for implementing Bluetooth functions may include but are not limited to the five interfaces of enable, scan, connect, send data, and set local information. The corresponding interfaces are ENABLE(), SCAN(), CONNECT(), SEND(), and CONFIGURE().

[0091] The command parameters and at least one interface function may have a corresponding relationship as shown in the following table:

[0092]

[0093] In the above embodiment, the test of all interface functions that need to be tested can be automatically executed according to the configured correspondence, or the user can input the corresponding instruction parameters, and the test of the interface functions corresponding to the instruction parameters input by the user can be executed one by one according to the configured correspondence.

[0094] That is, the above step 103 may further specifically include:

[0095] According to the corresponding relationship, when a user inputs a target instruction parameter, a test of at least one interface function in the module to be tested corresponding to the target instruction parameter is executed;

[0096] The target instruction parameter corresponds to an interface function or a combination of multiple interface functions in the module to be tested.

[0097] Alternatively, the above step 103 may further include:

[0098] According to the corresponding relationship, execute the complete test of the module to be tested in the test instruction information;

[0099] The complete test includes corresponding interface function tests of all instruction parameters included in the module to be tested, and the corresponding functional interface tests include separate functional interface tests or combined functional interface tests.

[0100] In a possible implementation, as shown in the above table, some instruction parameters may be reserved and configured by the tester. That is, when the test instruction information includes reserved instruction parameters, the interface function test method further includes:

[0101] According to the test scenario of the module to be tested, a first correspondence relationship between the reserved instruction parameter and the interface function included in the test scenario is configured;

[0102] According to a first correspondence between the reserved instruction parameter and the interface function included in the test scenario, the test of the test scenario is executed.

[0103] In the embodiment of the present application, the test of instructions 7 and 8 in the above table belongs to the actual test scenario and can be opened to the tester to define it by himself. It is generally implemented through a combination of interface calls to take into account both interface testing and scenario testing.

[0104] In an embodiment of the present application, a first correspondence can be established between a reserved instruction parameter and a specific interface function according to a test scenario. Then a specific test scenario is loaded by a test client. The scenario contains a defined correspondence between a reserved instruction parameter and an interface function. The reserved instruction parameter is then executed, i.e., the user selects or inputs the reserved instruction parameter, triggering the test client to perform the corresponding interface function test. The test client passes the necessary test parameters and calls the corresponding interface function according to the reserved instruction parameter, and records the result of the interface call, including a successful response, an error message, performance data, etc. Finally, the test result is analyzed to ensure that the interface function works as expected. The analysis result can be generated by the test client as a test report, which includes the test scenario, the reserved instruction parameter executed, the interface function call result and the analysis conclusion, and the report can be presented in the form of a log file, a console output or a graphical report.

[0105] In a possible implementation, the interface function testing method further includes:

[0106] Get all interface functions included in the full interface function test of the module to be tested;

[0107] A second corresponding relationship between an instruction parameter and all interface functions included in the full interface function test is configured, and the full interface function test of the module to be tested is performed according to the second corresponding relationship.

[0108] In the embodiment of the present application, a full interface test instruction can be added to execute a basic DEMO containing all interface functions. This DEMO should be as concise as possible and show the minimum function combination to ensure that all interface functions are covered and verify their basic usability. Among them, the minimum function combination can refer to the simplest function combination that ensures that all interface functions are called, which is used to verify the basic operating status of each interface.

[0109] It should be understood that by adding full interface functional testing and implementing a basic DEMO with a minimum functional combination, it can ensure that all interface functions of the module to be tested are verified. This method helps to quickly and comprehensively check the basic operating status of the module and improve test coverage and test efficiency.

[0110] In an embodiment of the present application, by obtaining the port number of a module to be tested that includes at least one interface function, instructing the user to perform a login operation, and then in response to the user entering the port number into the test client for login operation, the test instruction information of the module to be tested is displayed in the test interface, that is, the correspondence between the instruction parameters for testing the module to be tested and at least one interface function in the module to be tested, and finally, according to the correspondence, the test of at least one interface function in the module to be tested is executed. The above scheme integrates the test of the interface function into a module to be tested, and there is no need to write DEMO code for each test scenario, thereby reducing the testing burden of the system in a lightweight manner. In addition, the module to be tested includes the test of at least one interface function, which ensures the coverage of the interface test.

[0111] See also Figure 4 , shows a flow chart of an interface function testing method provided in Embodiment 2 of the present application. Figure 4 As shown, the interface function testing method may include the following steps:

[0112] Step 401 : In response to a user triggering operation on an interface test file, a modular test framework is introduced to generate a test client.

[0113] In an embodiment of the present application, the interface test file may refer to a configuration file including a modular test framework. When the test needs to be started, the configuration file may be modified to take effect and thus load the modular test framework.

[0114] In one possible implementation, the modular testing framework may be compiled into the DEBUG version of the software, but the official version is not compiled.

[0115] Specifically, the schematic diagram of the modular test framework embedded in the host system can be seen in Figure 5 ,exist Figure 5The software may include multiple functional modules, one of which is a modular test framework corresponding to the interface function test. After clicking the functional module, the test framework can be introduced, the modular test can be opened to log in to the client, and the login port can be selected for module testing.

[0116] Step 402, obtaining the port number corresponding to the module to be tested.

[0117] Step 403: In response to the user inputting the port number into the test client for login, the test instruction information of the module to be tested is displayed in the test interface.

[0118] Step 404: Execute a test of at least one interface function in the module to be tested according to the corresponding relationship.

[0119] Steps 402-404 of this embodiment are the same as steps 101-103 of the aforementioned embodiment, and can refer to each other, and will not be described in detail in this embodiment.

[0120] Compared with Example 1, the interface function testing method provided in the embodiment of the present application can be embedded in the host system, and the modular testing framework is introduced only in response to the user's triggering operation on the interface test file. In the formal system of actual application, the modular test can be deleted so that the modular test is only applied to the testing stage to avoid occupying the design resources of the formal system.

[0121] See also Figure 6 , shows a schematic diagram of the structure of an interface function testing device provided in Example 3 of the present application. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.

[0122] The interface function testing device 600 may specifically include:

[0123] The acquisition module 601 is used to acquire the port number corresponding to the module to be tested, where the module to be tested includes at least one interface function;

[0124] Display module 602, for displaying the test instruction information of the module to be tested in the test interface in response to the user inputting the port number into the test client login operation, the test instruction information including the corresponding relationship between the instruction parameter and at least one interface function in the module to be tested;

[0125] The testing module 603 is used to perform a test on at least one interface function in the module to be tested according to the corresponding relationship.

[0126] In the embodiment of the present application, when different modules to be tested correspond to the same port number, the display module 602 may specifically include:

[0127] A login submodule, for displaying a plurality of candidate modules to be tested on a test interface in response to a user inputting a port number into a test client for login;

[0128] The information display submodule is used to display the test instruction information of the target module to be tested in the test interface in response to the name information of the target module to be tested input by the user, and the target module to be tested is one of the multiple candidate modules to be tested.

[0129] In the embodiment of the present application, the test module 603 may specifically include:

[0130] The first test execution submodule is used to execute the test of at least one interface function in the module to be tested corresponding to the target instruction parameter when the user inputs a target instruction parameter according to the corresponding relationship;

[0131] The target instruction parameter corresponds to an interface function or a combination of multiple interface functions in the module to be tested.

[0132] In the embodiment of the present application, the test module 603 may further include:

[0133] The second test execution submodule is used to execute a complete test of the module to be tested in the test instruction information according to the corresponding relationship;

[0134] The complete test includes corresponding interface function tests of all instruction parameters included in the module to be tested, and the corresponding functional interface tests include separate functional interface tests or combined functional interface tests.

[0135] In the embodiment of the present application, when the test instruction information includes a reserved instruction parameter, the interface function testing device 600 further includes:

[0136] A configuration module, configured to configure a first correspondence between a reserved instruction parameter and an interface function included in the test scenario according to a test scenario of the module to be tested;

[0137] The first test execution module is used to execute the test of the test scenario according to the first corresponding relationship between the reserved instruction parameters and the interface functions included in the test scenario.

[0138] In the embodiment of the present application, the interface function testing device 600 further includes:

[0139] Function acquisition module, used to obtain all interface functions included in the full interface function test of the module to be tested;

[0140] The second test execution module is used to configure a second corresponding relationship between an instruction parameter and all interface functions included in the full interface function test, and execute the full interface function test of the module to be tested according to the second corresponding relationship.

[0141] In the embodiment of the present application, the interface function testing device 600 further includes:

[0142] The client generation module is used to introduce a modular test framework to generate a test client in response to a user's triggering operation on an interface test file.

[0143] The interface function testing device provided in the embodiment of the present application can be applied in the aforementioned method embodiment. For details, please refer to the description of the aforementioned method embodiment, which will not be repeated here.

[0144] Figure 7 Schematic diagram of the structure of the electronic device provided in the fourth embodiment of the present application. Figure 7 As shown, the electronic device 700 of this embodiment includes: at least one processor 710 ( Figure 7 Only one is shown in the figure) a processor, a memory 720, and a computer program 721 stored in the memory 720 and executable on the at least one processor 710, and when the processor 710 executes the computer program 721, the steps in any one of the above-mentioned interface function testing method embodiments are implemented.

[0145] The electronic device 700 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a processor 710 and a memory 720. Those skilled in the art will appreciate that Figure 7 This is merely an example of the electronic device 700 and does not constitute a limitation on the electronic device 700 . The electronic device 700 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0146] The processor 710 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0147] In some embodiments, the memory 720 may be an internal storage unit of the electronic device 700, such as a hard disk or memory of the electronic device 700. In other embodiments, the memory 720 may also be an external storage device of the electronic device 700, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 700. Further, the memory 720 may also include both an internal storage unit of the electronic device 700 and an external storage device. The memory 720 is used to store an operating system, an application program, a boot loader (Boot Loader), data and other programs, such as the program code of the computer program, etc. The memory 720 may also be used to temporarily store data that has been output or is to be output.

[0148] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0149] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0150] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0151] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0152] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0153] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0154] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0155] The present application implements all or part of the processes in the above-mentioned embodiment method, and may also be completed through a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing.

[0156] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. An interface function testing method, It is characterized in that The interface function testing method comprises: Obtaining a port number corresponding to a module to be tested, wherein the module to be tested includes at least one interface function; In response to a user inputting the port number into a test client for a login operation, displaying test instruction information of the module to be tested in a test interface, the test instruction information including a correspondence between an instruction parameter and at least one interface function in the module to be tested; According to the corresponding relationship, a test of at least one interface function in the module to be tested is performed.

2. The interface function testing method according to claim 1, It is characterized in that Different modules to be tested correspond to the same port number; In response to the user inputting the port number into the test client for login, displaying the test instruction information of the module to be tested in the test interface includes: In response to a user inputting the port number into a test client for a login operation, displaying a plurality of candidate modules to be tested on a test interface; In response to the name information of the target module to be tested input by the user, the test instruction information of the target module to be tested is displayed in the test interface, and the target module to be tested is one of the multiple candidate modules to be tested.

3. The interface function testing method according to claim 1, It is characterized in that The performing of testing at least one interface function in the module to be tested according to the corresponding relationship comprises: According to the corresponding relationship, when a user inputs a target instruction parameter, a test of at least one interface function in the module to be tested corresponding to the target instruction parameter is executed; The target instruction parameter corresponds to an interface function or a combination of multiple interface functions in the module to be tested.

4. The interface function testing method according to claim 3, It is characterized in that The performing of testing at least one interface function in the module to be tested according to the corresponding relationship further includes: According to the corresponding relationship, execute a complete test of the module to be tested in the test instruction information; The complete test includes corresponding interface function tests of all instruction parameters included in the module to be tested, and the corresponding functional interface tests include separate functional interface tests or combined functional interface tests.

5. The interface function testing method according to claim 1, It is characterized in that The test instruction information includes reserved instruction parameters; the interface function test method also includes: According to the test scenario of the module to be tested, configuring a first correspondence between the reserved instruction parameter and the interface function included in the test scenario; The test of the test scenario is executed according to a first correspondence between the reserved instruction parameter and the interface function included in the test scenario.

6. The interface function testing method according to claim 5, It is characterized in that The interface function testing method also includes: Obtain all interface functions included in the full interface function test of the module to be tested; A second corresponding relationship between an instruction parameter and all interface functions included in the full interface function test is configured, and the full interface function test of the module to be tested is executed according to the second corresponding relationship.

7. The interface function testing method according to any one of claims 1 to 6, It is characterized in that Before obtaining the port number corresponding to the module to be tested, the interface function testing method further includes: In response to a user's triggering operation on the interface test file, a modular test framework is introduced to generate the test client.

8. An interface function testing device, It is characterized in that The interface function testing device comprises: An acquisition module, used to acquire a port number corresponding to a module to be tested, wherein the module to be tested includes at least one interface function; A display module, configured to display the test instruction information of the module to be tested in a test interface in response to a user inputting the port number into a login operation of a test client, wherein the test instruction information includes a correspondence between an instruction parameter and at least one interface function of the module to be tested; The testing module is used to perform a test of at least one interface function in the module to be tested according to the corresponding relationship.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Fault test method and system based on functional module, medium and equipment

    CN121277147A