Test method, system, storage medium and electronic device of software tool kit
By receiving test instructions from the target server and testing the software toolkit based on the interface call information, the problem of low testing efficiency in existing technologies is solved, and efficient SDK iteration and in-depth analysis are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-27
- Publication Date
- 2026-03-24
AI Technical Summary
Existing software toolkits have low testing efficiency, which leads to the need to develop demo apps during SDK iteration, increasing workload and making it impossible to deeply analyze interface test data.
By receiving test instructions sent by the target server, the target software toolkit is tested based on the interface call information, the test results are obtained, and the results are compared with the pre-determined predicted results to determine the target test result, thus avoiding triggering the test through the application layer interface.
It improves the testing efficiency of software toolkits, reduces dependence on application layer interfaces, and enables efficient SDK version iteration and in-depth interface testing and analysis.
Smart Images

Figure CN113849398B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of communication, in particular to a software toolkit testing method and system, a storage medium and an electronic device. BACKGROUND
[0002] As an IOT platform in the field of smart home appliances, in order to facilitate external rapid access to the platform, the capabilities of the IOT are usually encapsulated into a general SDK to provide capabilities to the outside; external developers can quickly develop an application based on the IOT platform by integrating the SDK in the APP, calling the API interface provided by the SDK, and encapsulating the upper layer application.
[0003] In the related art, the SDK is a bottom component of the APP application, and the operation of each interface thereof usually depends on the triggering and scheduling of the application layer interface, so when a new version of the SDK is iterated or an API interface is added, the application layer of the APP usually needs to develop an interface for the interface, and the API interface is tested by triggering the application layer interface, which is very inefficient.
[0004] Therefore, the related art has the problem of low efficiency of testing the software toolkit.
[0005] In view of the above problems in the related art, no effective solution has been proposed so far. SUMMARY
[0006] Embodiments of the present application provide a software toolkit testing method and system, a storage medium and an electronic device to at least solve the problem of low efficiency of testing the software toolkit in the related art.
[0007] According to an embodiment of the present application, a software toolkit testing method is provided, comprising: receiving a test instruction sent by a target server for indicating testing a target software toolkit; testing the target software toolkit based on interface calling information included in the test instruction to obtain a test result; and sending the test result to the target server to instruct the target server to compare the test result with a pre-determined predicted test result to determine a target test result.
[0008] According to one embodiment of the present application, a test method of a software package is also provided, comprising: sending a test instruction for indicating a test target software package to a test device, to instruct the test device to test the target software package based on interface call information included in the test instruction, to obtain a test result, and to send the test result to a target server; receiving the test result; comparing the test result with a pre-determined predicted test result, to determine a target test result.
[0009] According to another embodiment of the present application, a test apparatus of a software package is provided, comprising: a first receiving module, configured to receive a test instruction for indicating a test target software package sent by a target server; a testing module, configured to test the target software package based on interface call information included in the test instruction, to obtain a test result; and a first determining module, configured to send the test result to the target server, to instruct the target server to compare the test result with a pre-determined predicted test result, to determine a target test result.
[0010] According to another embodiment of the present application, a test apparatus of a software package is also provided, comprising: a sending module, configured to send a test instruction for indicating a test target software package to a test device, to instruct the test device to test the target software package based on interface call information included in the test instruction, to obtain a test result, and to send the test result to a target server; a second receiving module, configured to receive the test result; and a second determining module, configured to compare the test result with a pre-determined predicted test result, to determine a target test result.
[0011] According to another embodiment of the present application, a test system of a software package is provided, comprising: a target server, configured to send a test instruction for indicating a test target software package to a test device; and the test device, configured to receive the test instruction, to test the target software package based on interface call information included in the test instruction, to obtain a test result, and to send the test result to the target server, to instruct the target server to compare the test result with a pre-determined predicted test result, to determine a target test result.
[0012] According to yet another embodiment of the present application, a computer readable storage medium is also provided, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the method described in any of the above embodiments.
[0013] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0014] This invention receives test instructions from a target server, instructing the testing of a target software toolkit. The target software toolkit is then tested based on interface call information included in the test instructions. Test results are obtained and sent to the target server, instructing it to compare these results with pre-determined predicted test results to determine the target test result. Because the target software toolkit can be tested by calling interfaces based on the interface call information in the test instructions, there is no need to trigger tests through an application-layer interface. Consequently, there is no need to develop a separate test interface for each individual software toolkit. Therefore, this invention solves the problem of low efficiency in testing software toolkits in related technologies, thereby improving the effectiveness of software toolkit testing. Attached Figure Description
[0015] Figure 1 This is a hardware structure block diagram of a mobile terminal for a software toolkit testing method according to an embodiment of the present invention.
[0016] Figure 2 This is a flowchart of a testing method for a software toolkit according to an embodiment of the present invention. Figure 1 ;
[0017] Figure 3 This is a flowchart illustrating the testing of a target software toolkit based on interface call information included in test instructions, according to an exemplary embodiment of the present invention.
[0018] Figure 4 This is a flowchart of a testing method for a software toolkit according to an embodiment of the present invention. Figure 2 ;
[0019] Figure 5 This is a structural block diagram of a testing apparatus for a software toolkit according to an embodiment of the present invention. Figure 1 ;
[0020] Figure 6 This is a structural block diagram of a testing apparatus for a software toolkit according to an embodiment of the present invention. Figure 2 ;
[0021] Figure 7 This is a structural block diagram of a testing system for a software toolkit according to an embodiment of the present invention;
[0022] Figure 8 This is a schematic diagram of the test system structure of a software toolkit according to a specific embodiment of the present invention. Detailed Implementation
[0023] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0025] In related technologies, when testing SDK version iterations, a demo app is usually developed for each version. This leads to the following problems: 1. The correctness of the SDK API interface depends on the correctness of the demo app; 2. Developing the demo app generates additional workload and slows down version iteration; 3. Through graphical testing, it is impossible to obtain intermediate data from interface testing, making in-depth analysis inconvenient.
[0026] To address the aforementioned problems in the relevant technologies, the following embodiments are proposed:
[0027] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a software toolkit testing method according to an embodiment of the present invention. For example... Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0028] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the testing method of the software toolkit in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the methods described above. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0029] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0030] This embodiment provides a method for testing a software toolkit. Figure 2 This is a flowchart of a testing method for a software toolkit according to an embodiment of the present invention. Figure 1 ,like Figure 2 As shown, the process includes the following steps:
[0031] Step S202: Receive test instructions sent by the target server to instruct the test target software toolkit;
[0032] Step S204: Test the target software toolkit based on the interface call information included in the test instructions to obtain test results;
[0033] Step S206: Send the test results to the target server to instruct the target server to compare the test results with the predetermined predicted test results and determine the target test results.
[0034] In the above embodiments, the target server can be an IoT cloud server, the target software toolkit is the software toolkit SDK to be tested, and the target server can send test instructions to indicate the components included in the target software toolkit. These test instructions may include interface call information, such as the interface call order and interface dependencies. After receiving the test instructions, the target software package can be tested according to the interface call information to obtain test results, which are then sent to the target server. The target server can pre-determine predicted test results. After receiving the test results, the target server can compare the two results to determine the target test result.
[0035] In the above embodiments, the target server can manage and input interface information provided by various versions of uSDK. This interface information includes: interface name, fully qualified interface name, interface method, and interface input and output parameters. Interfaces can also be orchestrated, allowing one or more interfaces to be combined into a single command. Within this command, the execution order and dependencies of multiple interfaces can be orchestrated. The orchestrated command is then issued, for example, pushed to the testing system via a WebSocket channel for execution. The test results are then fed back to the target server, which compares the test results pushed by the Test App with the predicted test results to determine the correctness of the interface.
[0036] In the above embodiment, the target server pushes the following test command:
[0037]
[0038]
[0039] The returned test results are as follows:
[0040]
[0041] The target server compares the return_value and expected_value values in the above schema to obtain the execution status of the entire command and the execution status of each interface under the command.
[0042] Optionally, the entity performing the above steps may be a testing device, a background processor, or other devices with similar processing capabilities, but is not limited to these.
[0043] This invention receives test instructions from a target server, instructing the testing of a target software toolkit. The target software toolkit is then tested based on interface call information included in the test instructions. Test results are obtained and sent to the target server, instructing it to compare these results with pre-determined predicted test results to determine the target test result. Because the target software toolkit can be tested by calling interfaces based on the interface call information in the test instructions, there is no need to trigger tests through an application-layer interface. Consequently, there is no need to develop a separate test interface for each individual software toolkit. Therefore, this invention solves the problem of low efficiency in testing software toolkits in related technologies, thereby improving the effectiveness of software toolkit testing.
[0044] In one exemplary embodiment, a flowchart illustrating the testing of the target software toolkit based on the interface call information included in the test instructions can be found in the appendix. Figure 3 ,like Figure 3 As shown, the process includes:
[0045] Step S302: Compile the target software toolkit to obtain the target test software;
[0046] Step S304: Based on the interface call information, determine the target interface to be tested in the target test software and the calling order of each interface included in the target interface;
[0047] Step S306: Control the target testing software to call each interface included in the target interface in the order of interface calls.
[0048] In this embodiment, a stable uSDK interface scheduling framework can be used to test the uSDK interfaces of the target software toolkit. This framework is not iterated with uSDK version iterations; each time a new uSDK package is tested, the new uSDK is simply introduced into the framework, packaged, and compiled to generate the test app. That is, upon obtaining the target software toolkit to be tested, it can be compiled to obtain the target test software, i.e., the test app. Upon receiving a test command, the interfaces to be called and their parameters can be parsed from the command. Java's reflection mechanism can then be used to call and execute the interfaces to obtain the test results. In other words, based on the interface call information, the target interfaces to be tested in the target test software, as well as the calling order and dependencies of the interfaces included in the target interface, can be determined. The target test software can then be controlled to call each interface sequentially according to the interface call order to complete the test.
[0049] In the above embodiments, before testing the target software toolkit, the basic code stored in the pre-acquired code library can be obtained. During testing, the target software toolkit can be introduced, and the test APP can be generated by packaging and compiling the basic code and the target software toolkit.
[0050] In one exemplary embodiment, the method further includes at least one of the following: after receiving a test instruction sent by a target server to instruct the testing of a target software toolkit, displaying the test instruction on a target interface; after determining a target test result, displaying the test result on the target interface; and after testing the target software toolkit based on the interface call information included in the test instruction, displaying test logs generated during the testing of the target software toolkit on the target interface. In this embodiment, the target interface can provide a simple log display window capable of displaying received data and data uploaded to the cloud. For example, during testing, the received test instructions can be displayed on the target interface. The interface may display the interface call order and interface dependencies included in the test instructions. After testing the target software toolkit, test results can also be displayed on the target interface. Test logs can also be displayed during testing to allow users to easily identify the location of faults or anomalies during testing based on the displayed information.
[0051] In one exemplary embodiment, before receiving test instructions for the target software toolkit sent by the target server, the method further includes: establishing a WebSocket connection with the target server. In this embodiment, a WebSocket connection can be established with the cloud before testing. Data is received and sent via WebSocket.
[0052] This embodiment provides a method for testing a software toolkit. Figure 4 This is a flowchart of a testing method for a software toolkit according to an embodiment of the present invention. Figure 2 ,like Figure 4 As shown, the process includes the following steps:
[0053] Step S402: Send a test instruction to the test device to instruct the test device to test the target software toolkit based on the interface call information included in the test instruction, obtain test results, and send the test results to the target server;
[0054] Step S404: Receive the test results;
[0055] Step S406: Compare the test results with the predetermined predicted test results to determine the target test result.
[0056] In the above embodiments, the target server can be an IoT cloud server, the target software toolkit is the software toolkit SDK to be tested, and the target server can send test instructions to indicate the components included in the target software toolkit. These test instructions may include interface call information, such as the interface call order and interface dependencies. After receiving the test instructions, the test device can test the target software package according to the interface call information and obtain test results. The test results are then sent to the target server. The target server can pre-determine predicted test results. After receiving the test results, the target server can compare the two results to determine the target test result.
[0057] In the above embodiment, the target server pushes the following test command:
[0058]
[0059]
[0060] The returned test results are as follows:
[0061]
[0062]
[0063] The target server compares the return_value and expected_value values in the above schema to obtain the execution status of the entire command and the execution status of each interface under the command.
[0064] Optionally, the entity performing the above steps may be the target server, but is not limited to this.
[0065] Through this invention, the target server sends test instructions to instruct the testing of a target software toolkit. Upon receiving the test instructions, the testing equipment performs tests on the target software toolkit based on the interface call information included in the test instructions, obtains test results, and sends the test results back to the target server. The target server compares the test results with pre-determined predicted test results to determine the target test result. Since the target software toolkit can be tested by calling interfaces based on the interface call information in the test instructions, there is no need to trigger tests through an application layer interface, and therefore no need to develop a separate test interface for each software toolkit. Thus, this invention solves the problem of low efficiency in testing software toolkits in related technologies, thereby improving the effectiveness of testing software toolkits.
[0066] In an exemplary embodiment, before sending a test instruction to the test device to instruct the target software toolkit, the method further includes: obtaining interface information of the target software toolkit; determining interface call information based on the interface information; and determining the interface call information as the test instruction. In this embodiment, the target server can manage and input interface information provided by various versions of the uSDK. The interface information may include: interface name, fully qualified interface name, interface method, and interface input and output parameters. The target server can orchestrate interfaces, assembling one or more interfaces into a single instruction. The instruction can internally orchestrate the execution order and dependencies of multiple interfaces. The orchestrated instruction is then issued, for example, by pushing it to the test system via a WebSocket channel for execution. The test results are then fed back to the target server, which compares the test results pushed by the Test App with the predicted test results to determine the correctness of the interface.
[0067] In one exemplary embodiment, before sending test instructions for instructing the target software toolkit to the test device, the method further includes establishing a WebSocket connection with the test device. In this embodiment, the cloud can establish a WebSocket connection with the test device before conducting the test. Data is received and sent via WebSocket.
[0068] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0069] This embodiment also provides a testing apparatus for a software toolkit, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0070] Figure 5 This is a structural block diagram of a testing apparatus for a software toolkit according to an embodiment of the present invention. Figure 1 ,likeFigure 5 As shown, the device includes:
[0071] The first receiving module 52 is used to receive test instructions sent by the target server to instruct the test target software toolkit;
[0072] Test module 54 is used to test the target software toolkit based on the interface call information included in the test instructions and obtain test results;
[0073] The first determining module 56 is used to send the test result to the target server to instruct the target server to compare the test result with the pre-determined predicted test result and determine the target test result.
[0074] In an exemplary embodiment, the test module 54 can test the target software toolkit based on the interface call information included in the test instructions in the following manner: compiling the target software toolkit to obtain target test software; determining the target interface to be tested in the target test software and the calling order of each interface included in the target interface based on the interface call information; and controlling the target test software to call each interface included in the target interface in the order of interface calls.
[0075] In one exemplary embodiment, the apparatus may be used for at least one of the following: after receiving a test instruction sent by a target server to instruct the testing of a target software toolkit, displaying the test instruction on a target interface; after determining a target test result, displaying the test result on the target interface; and after testing the target software toolkit based on the interface call information included in the test instruction, displaying test logs generated during the testing of the target software toolkit on the target interface.
[0076] In one exemplary embodiment, the apparatus can also be used to establish a WebSocket connection with the target server before receiving test instructions for the target software toolkit sent by the target server.
[0077] Figure 6 This is a structural block diagram of a testing apparatus for a software toolkit according to an embodiment of the present invention. Figure 2 ,like Figure 6 As shown, the device includes:
[0078] The sending module 62 is used to send a test instruction to the test device to instruct the test device to test the target software toolkit, so as to instruct the test device to test the target software toolkit based on the interface call information included in the test instruction, obtain test results, and send the test results to the target server;
[0079] The second receiving module 64 is used to receive the test results;
[0080] The second determining module 66 is used to compare the test results with the pre-determined predicted test results to determine the target test result.
[0081] In one exemplary embodiment, the apparatus may be configured to, before sending a test instruction to a test device for instructing a target software toolkit, obtain interface information of the target software toolkit; determine interface call information based on the interface information; and determine the interface call information as the test instruction.
[0082] In one exemplary embodiment, the apparatus may be used to establish a WebSocket connection with the test device before sending test instructions for instructing the test target software toolkit to the test device.
[0083] Figure 7 This is a structural block diagram of a testing system for a software toolkit according to an embodiment of the present invention, such as... Figure 7 As shown, the system includes:
[0084] The target server 72 is used to send test instructions to the test equipment to instruct the test target software toolkit;
[0085] The testing device 74 is used to receive the testing instructions, test the target software toolkit based on the interface call information included in the testing instructions, obtain test results, and send the test results to the target server to instruct the target server to compare the test results with a predetermined predicted test result and determine the target test result.
[0086] In the above embodiments, the target server can be an IoT cloud server, and the target software toolkit is the software toolkit SDK to be tested. The target server can send test instructions to the test module to indicate the components included in the target software toolkit. These test instructions may include interface call information, such as the interface call order and interface dependencies. After receiving the test instructions, the test module can test the target software package according to the interface call information and obtain test results. The test results are then sent to the target server. The target server can pre-determine and predict the test results. After receiving the test results, the target server can compare the two results to determine the target test result.
[0087] In the above embodiments, the target server can manage and input interface information provided by various versions of uSDK. This interface information includes: interface name, fully qualified interface name, interface method, and interface input and output parameters. Interfaces can also be orchestrated, allowing one or more interfaces to be combined into a single command. Within this command, the execution order and dependencies of multiple interfaces can be orchestrated. The orchestrated command is then issued, for example, pushed to the testing system via a WebSocket channel for execution. The test results are then fed back to the target server, which compares the test results pushed by the Test App with the predicted test results to determine the correctness of the interface.
[0088] Through this invention, the testing module receives test instructions sent by the target server, instructing the testing of a target software toolkit. Based on the interface call information included in the test instructions, the module tests the target software toolkit, obtains test results, and sends these results back to the target server. The target server then compares these test results with pre-determined predicted test results to determine the target test result. Since the testing module can test the target software toolkit by calling interfaces based on the interface call information in the test instructions, it eliminates the need to trigger tests through an application-layer interface. Furthermore, it avoids the need to develop a separate test interface for each individual software toolkit. Therefore, this invention solves the problem of low efficiency in testing software toolkits in related technologies, thereby improving the effectiveness of testing software toolkits.
[0089] In an exemplary embodiment, the testing device 74 includes: a communication unit connected to the target server, used to receive the test instructions; and a dynamic execution interface engine connected to the communication unit, used to test the target software toolkit based on the interface call information included in the test instructions, obtain test results, and send the test results to the communication unit; the communication unit is also used to send the test results to the target server to instruct the target server to compare the test results with a pre-determined predicted test result and determine the target test result. In this embodiment, the testing device can be a stable uSDK interface scheduling framework used for testing uSDK interfaces. The framework does not iterate with the uSDK version iteration; each time a new uSDK package is tested, only the new uSDK needs to be introduced into the framework, packaged, compiled, and generated into a test APP. The testing device may include a communication unit and a dynamic execution interface engine. The communication unit can establish a WebSocket connection with the cloud after the Test APP starts. It is responsible for receiving instructions (including the API interface to be called and interface parameters) sent from the cloud (corresponding to the aforementioned target server), and after receiving the instructions, it sends them to the dynamic execution interface engine. After receiving data from the communication unit, the dynamic execution interface engine parses out the interface to be called and its parameters; it then uses Java's reflection mechanism to call the execution interface and sends the interface call result data (corresponding to the test results mentioned above) to the communication unit. The communication unit then sends the instruction execution result data pushed by the dynamic execution interface engine to the cloud via a WebSocket channel.
[0090] In one exemplary embodiment, the test device 74 further includes a software toolkit unit connected to the dynamic execution interface engine, used to store the target software toolkit. In this embodiment, the software toolkit unit provides encapsulation of IoT capabilities and provides a basic code library. External users can integrate the code library and use local interface calls to call the uSDK API interface to implement IoT capabilities.
[0091] In an exemplary embodiment, the testing device 74 further includes: a display unit connected to the dynamic execution interface engine, configured to display at least one of the following on the target interface corresponding to the display unit: the test instructions, the test results, and test logs generated during the testing of the target software toolkit. In this embodiment, the display unit may be a UI display layer corresponding to the target interface. The target interface can provide a simple log display window capable of displaying received data and data uploaded to the cloud. For example, during testing, received test instructions can be displayed on the target interface. The target interface may display the interface call order and interface dependencies included in the test instructions. After testing the target software toolkit, test results can also be displayed on the target interface. Test logs can also be displayed during testing to allow users to easily identify the location of faults or anomalies during testing based on the displayed information.
[0092] The testing system for the software toolkit is described below with reference to specific implementation methods:
[0093] Figure 8 This is a schematic diagram of the test system structure of a software toolkit according to a specific embodiment of the present invention, such as... Figure 8 As shown, the structure includes:
[0094] The IoT cloud (corresponding to the target server mentioned above) includes an interface management unit, an interface orchestration unit, and a unit for comparing interface execution test results with predicted test results. It provides the following functions:
[0095] 1) Provides input and management of interface information provided by various versions of uSDK. Interface information includes: interface name, fully qualified interface name, interface method, and interface input and output parameters.
[0096] 2) Interface orchestration: It can orchestrate one or more interfaces into a single command, and the execution order and dependencies of multiple interfaces can be orchestrated within the command.
[0097] 3) Issue the compiled instructions and push them to the Test App through the WebSocket channel for execution.
[0098] 4) Compare the execution results pushed by the Test App with the expected results to determine the correctness of the interface.
[0099] The Test App (corresponding to the aforementioned test equipment) provides a stable uSDK interface scheduling framework for testing uSDK interfaces. This framework is not iterated upon with uSDK version updates; each time a new uSDK package is tested, simply import the new uSDK into the framework, package and compile it to generate the Test App. It includes a communication module (corresponding to the aforementioned communication unit), a dynamic execution interface engine, USDK (corresponding to the aforementioned software toolkit unit), and a UI presentation layer (corresponding to the aforementioned presentation unit).
[0100] The communication module is responsible for establishing a WebSocket connection with the cloud after the Test App starts; receiving instructions sent from the cloud (including the API interfaces to be called and interface parameters), and sending them to the dynamic execution interface engine; and sending the execution result data of the instructions pushed by the dynamic execution interface engine to the cloud through the WebSocket channel.
[0101] The dynamic execution interface engine receives data from the communication module, parses out the interface to be called and its parameters, uses Java's reflection mechanism to call and execute the interface, and sends the interface call result data to the communication module, which then uploads it to the cloud.
[0102] The UI presentation layer provides a simple log display window that can show the data received by the Test App and the data uploaded to the cloud.
[0103] In the aforementioned embodiments, by developing a unified Test App framework, each uSDK version iteration only needs to integrate the new SDK package to compile and generate a Test App, which does not require iterative development with each SDK version iteration. This enables automated and efficient testing of the SDK, solving various problems encountered in SDK testing and improving the efficiency of SDK version iteration. The Test App establishes a WebSocket connection through the communication module IoT cloud, enabling it to receive the interfaces and parameters pushed by the testing platform. After execution by the dynamic execution engine, the interface returns data back to the IoT cloud. The IoT cloud maintains the interfaces of each iteration version, enabling testing of individual interfaces or complex business logic through interface orchestration, and scheduling execution based on dependencies between interfaces. Testing the uSDK based on this framework eliminates the need for app iteration, improving efficiency; simultaneously, the interface assembly method can cover various functional scenarios, simplifying testing compared to previous methods; furthermore, the input and output data of the entire execution process are visible, facilitating problem analysis.
[0104] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0105] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0106] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0107] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0108] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0109] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0110] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0111] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A testing method for a software toolkit, characterized in that, include: The system receives test instructions sent by the target server to instruct the testing of the target software toolkit. The target server is used to manage the interface information provided by each version of the target software toolkit. The interface information includes: interface name, fully qualified interface name, interface method, and interface input and output parameters. The target software toolkit is tested based on the interface call information included in the test instructions, and the test results are obtained. The test results are sent to the target server to instruct the target server to compare the test results with the pre-determined predicted test results and determine the target test results; Testing the target software toolkit based on the interface call information included in the test instructions includes: compiling the target software toolkit to obtain target test software; determining the target interface to be tested in the target test software, the calling order of each interface included in the target interface, and their dependencies based on the interface call information; and controlling the target test software to call each interface included in the target interface sequentially according to the interface call order.
2. The method according to claim 1, characterized in that, The method further includes at least one of the following: After receiving the test instructions sent by the target server to instruct on testing the target software toolkit, the test instructions are displayed on the target interface. After the target test result is determined, the test result is displayed on the target interface; After testing the target software toolkit based on the interface call information included in the test instructions, the test logs generated during the testing of the target software toolkit are displayed on the target interface.
3. The method according to claim 1, characterized in that, Before receiving test instructions for the target software toolkit sent by the target server, the method further includes: Establish a WebSocket connection with the target server.
4. A testing method for a software toolkit, characterized in that, include: Send a test instruction to the test device to instruct the test device to test the target software toolkit based on the interface call information included in the test instruction, obtain test results, and send the test results to the target server; Receive the test results; The test results are compared with the predetermined predicted test results to determine the target test result.
5. The testing method for the software toolkit according to claim 4, characterized in that, Before sending test instructions to the test equipment to indicate the target software toolkit, the method further includes: Obtain the interface information of the target software toolkit; The interface call information is determined based on the interface information; The interface call information is identified as the test instruction.
6. The testing method for the software toolkit according to claim 4, characterized in that, Before sending test instructions to the test equipment to indicate the target software toolkit, the method further includes: Establish a WebSocket connection with the test device.
7. A testing apparatus for a software toolkit, characterized in that, include: The first receiving module is used to receive test instructions sent by the target server to instruct the testing of the target software toolkit. The target server is used to manage the interface information provided by each version of the target software toolkit. The interface information includes: interface name, fully qualified interface name, interface method, and interface input and output parameters. The testing module is used to test the target software toolkit based on the interface call information included in the test instructions, and obtain test results; The first determining module is used to send the test result to the target server to instruct the target server to compare the test result with the pre-determined predicted test result and determine the target test result; The testing module performs testing on the target software toolkit based on the interface call information included in the test instructions in the following manner: compiling the target software toolkit to obtain target test software; determining the target interface to be tested in the target test software, the calling order of each interface included in the target interface, and the dependencies based on the interface call information; and controlling the target test software to call each interface included in the target interface in sequence according to the interface call order.
8. A testing apparatus for a software toolkit, characterized in that, include: The sending module is used to send test instructions to the test device to instruct the test device to test the target software toolkit, so as to instruct the test device to test the target software toolkit based on the interface call information included in the test instructions, obtain test results, and send the test results to the target server. The target server is used to manage the interface information provided by each version of the target software toolkit, wherein the interface information includes: interface name, fully qualified interface name, interface method, interface input and output parameters; The second receiving module is used to receive the test results; The second determining module is used to compare the test results with the pre-determined predicted test results to determine the target test results; The testing equipment performs testing on the target software toolkit based on the interface call information included in the test instructions as follows: compiling the target software toolkit to obtain target test software; determining the target interface to be tested in the target test software, the calling order of each interface included in the target interface, and their dependencies based on the interface call information; and controlling the target test software to call each interface included in the target interface sequentially according to the interface call order.
9. A testing system for a software toolkit, characterized in that, include: The target server is used to send test instructions to the test device to instruct the test target software toolkit. The target server is used to manage the interface information provided by each version of the target software toolkit. The interface information includes: interface name, fully qualified interface name, interface method, and interface input and output parameters. The testing equipment is used to receive the test instructions, test the target software toolkit based on the interface call information included in the test instructions, and obtain test results; and send the test results to the target server to instruct the target server to compare the test results with a predetermined predicted test result and determine the target test result. The testing equipment performs testing on the target software toolkit based on the interface call information included in the test instructions as follows: compiling the target software toolkit to obtain target test software; determining the target interface to be tested in the target test software, the calling order of each interface included in the target interface, and their dependencies based on the interface call information; and controlling the target test software to call each interface included in the target interface sequentially according to the interface call order.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 3, or performs the method according to any one of claims 4 to 6.
11. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 3, or to perform the method according to any one of claims 4 to 6.
Citation Information
Patent Citations
SDK access state detection method, computer equipment and computer readable storage medium
CN111597101A
Software testing method, device and equipment and computer readable medium
CN113268406A