Test method and device, computer equipment, readable storage medium and program product

By building test code mirroring and executing test cases, the problem of low efficiency in manual testing SDK interface in the prior art is solved, and efficient and accurate test report generation is achieved.

CN119597664APending Publication Date: 2025-03-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411715925.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the prior art, manually testing the SDK interface by technicians leads to low testing efficiency, high cost and poor accuracy of test results.

Method used

Provide a test method, by obtaining the test information of the SDK, building a test code image, and executing test cases based on the image to generate a test report. The method includes obtaining test information, building test code images, and executing test cases to generate test reports.

Benefits of technology

It improves the testing efficiency of the SDK interface, reduces costs, and improves the accuracy of the test report, thereby effectively improving the testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597664A_ABST
    Figure CN119597664A_ABST
Patent Text Reader

Abstract

The invention relates to a test method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring test information for a software development kit (SDK), wherein the test information is used for representing a target interface to be tested in a plurality of interfaces of the SDK; determining a test code mirror image according to the test information and a pre-constructed test code library, wherein the test code mirror image comprises a test code and a configuration file for the target interface; and executing a test case for the target interface according to the test code mirror image to generate a test report of the target interface of the SDK. By adopting the method, the test efficiency of the SDK interface can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a testing method, apparatus, computer equipment, computer-readable storage medium and computer program product. Background Art

[0002] SDK (Software Development Kit) is a collection of development tools, libraries, sample codes, documents and related support files that can help users quickly build applications or software components. Since SDK provides services to users through interfaces, the security and performance of SDK have a great impact on the reliability of services.

[0003] In the prior art, most of the time, technicians manually test various interfaces of the SDK to determine its performance and security.

[0004] However, this method of manual testing by technicians is not only costly and time-consuming, but also has poor accuracy in test results, which leads to low testing efficiency for SDK interfaces. Summary of the invention

[0005] Based on this, it is necessary to provide a test method, apparatus, computer equipment, computer-readable storage medium and computer program product that can achieve high test efficiency in response to the above technical problems.

[0006] In a first aspect, the present application provides a testing method, comprising:

[0007] Acquire test information for a software development kit SDK, where the test information is used to characterize a target interface to be tested among multiple interfaces of the SDK;

[0008] Determine a test code image according to the test information and a pre-built test code library, where the test code image includes test code and configuration files for the target interface;

[0009] A test case for the target interface is executed according to the test code image to generate a test report for the target interface of the SDK.

[0010] In one of the embodiments, the test code mirror is determined based on the test information and a pre-built test code library, including: obtaining test code from the test code library based on the test information, the test code including interface code of the target interface and target code for testing the target interface; compiling the test code, and generating the test code mirror based on the compiled test code.

[0011] In one of the embodiments, the test case for the target interface is executed according to the test code image to generate a test report for the target interface of the SDK, including: authenticating the test code image to obtain an authentication result of the test code image; when the authentication result indicates that the test code image is successfully authenticated, executing the test case for the target interface according to the test code image to generate a test report for the target interface of the SDK.

[0012] In one of the embodiments, the test code image is authenticated to obtain an authentication result of the test code image, including: loading a configuration file in the test code image to obtain a key and test environment information; generating a random key string based on the key, and accessing a target test environment indicated by the test environment information based on the random key string, and determining an access result; determining the authentication result of the test code image based on the access result.

[0013] In one of the embodiments, the test case for the target interface is executed according to the test code mirror to generate a test report for the target interface of the SDK, including: in the process of executing the test case for the target interface according to the test code mirror, a status check is performed in real time to obtain a status check result; when the status check result indicates that there is no abnormality in the test process, the test result obtained by executing the test case for the target interface according to the test code mirror is obtained, and the test report is generated according to the test result.

[0014] In one of the embodiments, the method further includes: when the status check result indicates that an abnormality occurs in the test process, obtaining test abnormality information, and generating a test abnormality report according to the test abnormality information.

[0015] In a second aspect, the present application also provides a testing device, comprising:

[0016] An acquisition module, used for acquiring test information for a software development kit SDK, where the test information is used for characterizing a target interface to be tested among multiple interfaces of the SDK;

[0017] A determination module, configured to determine a test code image according to the test information and a pre-built test code library, wherein the test code image includes a test code and a configuration file for the target interface;

[0018] The execution module is used to execute the test case for the target interface according to the test code mirror to generate a test report for the target test interface of the SDK.

[0019] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in any embodiment of the first aspect when executing the computer program.

[0020] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any embodiment of the first aspect above.

[0021] In a fifth aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in any embodiment of the first aspect above.

[0022] The above-mentioned test method, apparatus, computer equipment, computer-readable storage medium and computer program product first obtain test information for the software development kit SDK, and the test information is used to characterize the target interface to be tested among the multiple interfaces of the SDK; then determine the test code image according to the test information and the pre-built test code library, and the test code image includes the test code and configuration file for the target interface; finally, execute the test case for the target interface according to the test code image to generate a test report for the target interface of the SDK. The test method provided by the present application can generate a test report for the target interface of the SDK according to the test information for the SDK. Compared with the prior art, the technicians manually test each interface of the SDK to obtain the test report of each interface. The test method provided by the present application is not only time-consuming and low-cost, but also has high accuracy of the obtained test report, thereby effectively improving the test efficiency for the SDK interface. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions 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 related drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 A schematic diagram of a test method in one embodiment;

[0025] Figure 2 A flowchart of a method for determining a test code image according to the test information and a pre-built test code library in one embodiment;

[0026] Figure 3A flowchart of a method for generating a test report of a target interface of the SDK in one embodiment;

[0027] Figure 4 A flowchart of a method for obtaining an authentication result of the test code image in one embodiment;

[0028] Figure 5 A flowchart of a method for generating a test report of a target interface of the SDK in another embodiment;

[0029] Figure 6 A schematic flow chart of a testing method in another embodiment;

[0030] Figure 7 is a schematic diagram of a test system in one embodiment;

[0031] Figure 8 is a structural block diagram of a testing device in one embodiment;

[0032] Fig. 9 is an internal structure diagram of a computer device in one embodiment;

[0033] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0035] SDK (Software Development Kit) is a collection of development tools, libraries, sample codes, documents and related support files that can help users quickly build applications or software components. Since SDK provides services to users through interfaces, the security and performance of SDK have a great impact on the reliability of services.

[0036] In the prior art, most of the time, technicians manually test various interfaces of the SDK to determine its performance and security.

[0037] However, this method of manual testing by technicians is not only costly and time-consuming, but also has poor accuracy in test results, which leads to low testing efficiency for SDK interfaces.

[0038] In view of this, the present application provides a testing method, which is not only time-saving and low-cost, but also has high accuracy of test results, thereby effectively improving the testing efficiency of the SDK interface.

[0039] The test method provided in the present application may be executed by a computer device, which may be a terminal or a server. The terminal may be, but is not limited to, various personal computers, laptops, tablet computers, and IoT devices. The server may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0040] In an exemplary embodiment, Figure 1 As shown, a testing method is provided, the method comprising the following steps:

[0041] Step 101: Obtain test information for a software development kit SDK.

[0042] The test information is used to characterize the target interface to be tested among the multiple interfaces of the SDK.

[0043] Optionally, the target interface may be one or more than one. That is, the method provided in the present application may test one SDK interface at a time or may test multiple SDK interfaces at a time.

[0044] In some exemplary embodiments, when a user has a test requirement for an SDK, a test plan can be first constructed on a computer device, and the test plan can be manually triggered or triggered through a scheduled task, so that the computer device executes the test task based on the triggered test plan. Specifically, the user can construct a test plan on a test management platform pre-built on the computer device. After the user manually triggers the test plan or triggers the test plan through a scheduled task, the computer device can obtain the test information of the SDK through the test plan.

[0045] Step 102: Determine a test code image according to the test information and a pre-built test code library.

[0046] The test code image includes the test code and configuration files for the target interface.

[0047] Optionally, the test code repository can be a Git code repository.

[0048] Exemplarily, the code in the test code library may be pre-uploaded by a developer, or may be rewritten and uploaded by a user according to his / her own test requirements. Further, when the test code library determines that there is uploaded code, the uploaded code will be automatically packaged.

[0049] An image is a lightweight, executable, independent software package that can be used to package a software runtime environment and software developed based on the runtime environment. It contains all the content required to run a piece of software, including code, runtime, libraries, environment variables, and configuration files. The test code image refers to the image for the test code.

[0050] In some exemplary embodiments, after the computer device obtains the test information, it can determine the target test interface based on the test information, then determine the test code corresponding to the target test interface from the pre-built test code library, and generate a test code image based on the test code.

[0051] In other exemplary embodiments, the test information can also be input into a pre-trained test code image generation model to obtain the test code image output by the test code image generation model. The test code image generation model is connected to the test code library, or the test code image generation model stores the code in the test code library.

[0052] Step 103: Execute the test case for the target interface according to the test code mirror to generate a test report for the target interface of the SDK.

[0053] Optionally, a test case is a description of a test task, which is used to reflect the test plan, method, technology and strategy. The test case may include test objectives, test environment, input data, test steps, expected results and test scripts.

[0054] The test report can be used to describe the test process and test results, and can even include analysis of the test results.

[0055] In some exemplary embodiments, after the computer device obtains the test code image, it can first generate a test case for the target interface according to the test code image, then execute the test case, and obtain the test result of the test case, and determine the test report of the target interface according to the test result and the pre-set initial test report. Specifically, the initial test report can be configured according to the test result to obtain the test report.

[0056] The above-mentioned test method first obtains test information for the software development kit SDK, and the test information is used to characterize the target interface to be tested among the multiple interfaces of the SDK; then, a test code image is determined according to the test information and a pre-built test code library, and the test code image includes test code and configuration files for the target interface; finally, the test case for the target interface is executed according to the test code image to generate a test report for the target interface of the SDK. The test method provided in the present application can generate a test report for the target interface of the SDK according to the test information for the SDK. Compared with the prior art, the technicians manually test each interface of the SDK to obtain a test report for each interface. The test method provided in the present application is not only time-consuming and low-cost, but also has a high accuracy of the test report, thereby effectively improving the test efficiency for the SDK interface.

[0057] In an exemplary embodiment, Figure 2 As shown, determining the test code mirror according to the test information and the pre-built test code library includes the following steps:

[0058] Step 201: Acquire test code from the test code library according to the test information.

[0059] The test code includes an interface code of the target interface and a target code for testing the target interface.

[0060] In some exemplary embodiments, the test code library stores interface codes corresponding to various interfaces of the SDK and codes for testing various interfaces. As described above, the test information includes a target interface to be tested.

[0061] Furthermore, after obtaining the test information, the target interface can be determined based on the test information, and then the interface code corresponding to the target interface and the target code for testing the target interface can be obtained from the test code library based on the target interface, and the interface code and the target code can be determined as the test code.

[0062] Step 202: compile the test code and generate the test code image according to the compiled test code.

[0063] Optionally, the compiling process refers to converting the test code into a compilable state. Exemplarily, the test code is a Java file, and the compiling process may specifically be a process of compiling the test code from the Java file into a bytecode file.

[0064] The image can be a Docker image. Docker is an open source container platform that provides development tools, container runtimes, and orchestration services to assist in the rapid construction, deployment, and management of containerized applications.

[0065] For example, in Docker, a read-only layer can be called an image, and an image will never change. Since Docker uses a unified file system, the Docker process thinks that the entire file system is mounted in read-write mode. However, all changes occur in the top writable layer, and the original read-only image file in the lower layer does not change. Since the image is not writable, the image is stateless. Each image may depend on another image composed of one or more lower layers. The lower layer image is the parent image of the upper layer image.

[0066] In some exemplary embodiments, after obtaining the test code, the test code may be compiled to obtain the compiled test code. Further, the test code image may be generated by importing an operating system template file and the compiled test code. The test code image may also be generated based on a Dockerfile and the compiled test code.

[0067] In an optional embodiment of the present application, after the test code is compiled and a test code image is generated according to the compiled test code, the computer device can push the test code image to a test server in the computer device.

[0068] In an exemplary embodiment, Figure 3 As shown, executing the test case for the target interface according to the test code mirror to generate a test report for the target interface of the SDK includes the following steps:

[0069] Step 301: Authenticate the test code image to obtain an authentication result of the test code image.

[0070] Optionally, the authentication process can be used to determine whether the test code image has the right to access the test environment.

[0071] In some exemplary embodiments, the authentication process of the test code image may be implemented by setting an environment variable or based on a configuration file.

[0072] Furthermore, after the test code image is authenticated, an authentication result of the test code image may be obtained. The authentication result may include a first result and a second result, wherein the first result may be used to indicate that the test code image is successfully authenticated, and the second result may be used to indicate that the test code image is unauthenticated.

[0073] Step 302: When the authentication result indicates that the test code image is successfully authenticated, execute the test case for the target interface according to the test code image to generate a test report for the target interface of the SDK.

[0074] In some exemplary embodiments, after the test code image is authenticated, the authentication result of the test code image can be obtained. When the authentication result indicates that the test code image is successfully authenticated, that is, whether the test code image has the right to access the test environment, the test case for the target interface can be executed according to the test code image to obtain the test result, and a test report can be generated based on the test result.

[0075] Specifically, the test code image can be used to start a running container to execute test cases for the target interface to obtain a test report for the target interface of the SDK.

[0076] In an exemplary embodiment, Figure 4 As shown, the test code image is authenticated to obtain the authentication result of the test code image, including the following steps:

[0077] Step 401: Load the configuration file in the test code image to obtain the key and test environment information.

[0078] Optionally, the loading process includes loading process and parsing process.

[0079] In some exemplary embodiments, the configuration file can be loaded by calling the setUp method of the parent class to ensure that the basic settings of the test environment can be correctly initialized and obtain necessary properties from the configuration file, such as regionID, repositoryID, instanceIDList, projectID, etc. These properties specify the operation area, resource repository, instance list and project ID.

[0080] Furthermore, the key can be obtained from the configuration file based on the initClient method. The initClient method is responsible for creating and initializing CtecsClient, a client for interacting with cloud computing services. The key includes an access key and a security key. These two keys are part of the authentication process to ensure that the test code can interact with the cloud computing service safely. The endpoint of the service can also be read from the configuration file. The endpoint can be the network address of the cloud computing service, which defines the specific cloud computing service location that the client will connect to.

[0081] Furthermore, you can use the obtained access key and security key to create a Credential object, which contains the authentication information required for making API calls. You can also create a CtecsClient instance and initialize the client using the authentication information and service endpoint.

[0082] The above automatic loading process of the configuration file in the test code image can reduce the complexity and error rate of manual configuration.

[0083] Step 402: Generate a random key string according to the key, access the target test environment indicated by the test environment information based on the random key string, and determine the access result.

[0084] In some exemplary embodiments, a random key string may be first generated based on the key, and a target test environment indicated by the test environment information may be accessed based on the random key string. The access result may be determined based on whether the target test environment indicated by the test environment information can be accessed based on the random key string.

[0085] The access result may include a first access result and a second access result. The first access result can be used to characterize that the target test environment indicated by the test environment information can be accessed based on the random key string, and the second access result can be used to characterize that the target test environment indicated by the test environment information cannot be accessed based on the random key string.

[0086] Step 403: Determine the authentication result of the test code image according to the access result.

[0087] In some exemplary embodiments, when the access result indicates that the target test environment indicated by the test environment information can be accessed based on the random key string, that is, when the access result is the first access result, the authentication result of the test code image is determined to be authentication passed.

[0088] When the access result indicates that the target test environment indicated by the test environment information cannot be accessed based on the random key string, that is, the access result is the second access result, the authentication result of the test code image is determined to be authentication failure.

[0089] In an exemplary embodiment, Figure 5 As shown, executing the test case for the target interface according to the test code mirror to generate a test report for the target interface of the SDK includes the following steps:

[0090] Step 501: During the process of executing the test case for the target interface according to the test code mirror, a status check is performed in real time to obtain a status check result.

[0091] Optionally, the status check may be real-time monitoring of the status of cloud computing service resources, such as the creation and destruction status of test cases.

[0092] In some exemplary embodiments, in the process of executing the test case for the target interface according to the test code image, the status of the cloud computing service resource can be monitored in real time based on the automated status check mechanism to obtain a status check result. The status check result includes a first status check result and a second status check result. The first status check result can be used to characterize that no abnormality occurs during the test process, and the second status check result can be used to characterize that an abnormality occurs during the test process.

[0093] Furthermore, through this periodic status check, the state transition of cloud computing service resources can be automatically verified to ensure the comprehensiveness and accuracy of the testing process.

[0094] Step 502: When the status check result indicates that no abnormality occurs during the test process, a test result obtained by executing the test case for the target interface according to the test code mirror is obtained, and the test report is generated according to the test result.

[0095] In some exemplary embodiments, when the status check result indicates that no abnormality occurs in the test process, that is, when the status check result is the first status check result, the test result obtained by executing the test case for the target interface according to the test code mirror can be obtained.

[0096] Furthermore, after obtaining the test result, the computer device may input the test result into a pre-trained result processing model, in which a test report template is provided, and the result processing model may automatically generate a test report according to the test result.

[0097] The test results are converted into test reports, which increases the readability of the test results. In addition, the use of models to generate test reports can effectively improve the efficiency of test report generation.

[0098] In an exemplary embodiment, when the status check result indicates that an abnormality occurs in the test process, the method further includes: acquiring test abnormality information, and generating a test abnormality report according to the test abnormality information.

[0099] In some exemplary embodiments, when the status check result indicates that an abnormality has occurred in the test process, that is, when the status check result is the second status check result, it can be determined that the test result obtained by executing the test case for the target interface according to the test code mirror is an inaccurate test result. Therefore, there is no need to output a test report according to the test result, and only the test abnormality information needs to be obtained, and a test abnormality report needs to be generated according to the test abnormality information. The test abnormality report can be used as a basis for adjusting the test case process.

[0100] In an optional embodiment of the present application, after obtaining the test report, the test report may also be rendered and displayed.

[0101] In an optional embodiment of the present application, the test method provided by the present application adopts Java's TestNG test framework.

[0102] The test method provided by this application can automatically compile the test code and build a test code image, which can not only improve the efficiency of test code management and deployment, but also reduce the complexity and error rate of manual operations. And the test plan is automatically triggered through the test management platform, that is, the deployment of the image and the execution of the test case. Not only can the consistency and repeatability of the test environment be ensured, but also the automated management of the test plan is realized, ensuring that each test is carried out in a consistent environment, thereby improving the reliability of the test results.

[0103] In an exemplary embodiment, Figure 6 Another testing method is provided, which includes the following steps:

[0104] Step 601: Acquire test information for a software development kit SDK, where the test information is used to characterize a target interface to be tested among multiple interfaces of the SDK; acquire test code from the test code library according to the test information, where the test code includes an interface code of the target interface and a target code for testing the target interface;

[0105] Step 602: compile the test code and generate the test code image according to the compiled test code; the test code image includes the test code and configuration file for the target interface;

[0106] Step 603: Load the configuration file in the test code image to obtain the key and test environment information; generate a random key string according to the key, access the target test environment indicated by the test environment information based on the random key string, and determine the access result; determine the authentication result of the test code image according to the access result;

[0107] Step 604: When the authentication result indicates that the authentication of the test code image is successful, a status check is performed in real time during the process of executing the test case for the target interface according to the test code image to obtain a status check result;

[0108] Step 605: When the status check result indicates that no exception occurred in the test process, obtain the test result obtained by executing the test case for the target interface according to the test code mirror, and generate the test report according to the test result; when the status check result indicates that an exception occurred in the test process, obtain test exception information, and generate a test exception report according to the test exception information.

[0109] In an exemplary embodiment, Figure 7 As shown, the present application also provides a test system, which may include a git code repository, an image packaging platform and an execution test platform.

[0110] The git code repository stores the SDK core code (that is, the interface code of each SDK interface in this application), the test core code (that is, the code used to test each interface in this application) and the image package file (that is, the file obtained by packaging the test code image in this application).

[0111] The image packaging platform can be used to pull the test code corresponding to the target interface (the SDK core code and test core code corresponding to the target interface) from the git code repository, compile the test (compile and package), generate a test code image of the compiled test code, and push the test code image to the image repository.

[0112] The test execution platform can be used to obtain the test code image from the image repository, and start the test container through the test code image to execute the test plan on the test machine (that is, the process of executing the test case in this application).

[0113] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0114] Based on the same inventive concept, the embodiment of the present application also provides a test device for implementing the test method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more test device embodiments provided below can refer to the limitations on the test method above, and will not be repeated here.

[0115] In an exemplary embodiment, Figure 8 As shown, a testing device 800 is provided, including: an acquisition module 801, a determination module 802 and an execution module 803, wherein:

[0116] An acquisition module 801 is used to acquire test information for a software development kit SDK, where the test information is used to characterize a target interface to be tested among multiple interfaces of the SDK;

[0117] A determination module 802 is used to determine a test code image according to the test information and a pre-built test code library, where the test code image includes a test code and a configuration file for the target interface;

[0118] The execution module 803 is used to execute the test case for the target interface according to the test code mirror to generate a test report for the target test interface of the SDK.

[0119] In one embodiment, the determination module 802 is specifically used to obtain test code from the test code library according to the test information, and the test code includes the interface code of the target interface and the target code for testing the target interface; compile the test code, and generate the test code image according to the compiled test code.

[0120] In one embodiment, the execution module 803 is specifically used to perform authentication processing on the test code image to obtain an authentication result of the test code image; when the authentication result indicates that the test code image is successfully authenticated, the test case for the target interface is executed according to the test code image to generate a test report for the target interface of the SDK.

[0121] In one embodiment, the execution module 803 is specifically used to load and process the configuration file in the test code image to obtain the key and test environment information; generate a random key string based on the key, and access the target test environment indicated by the test environment information based on the random key string, and determine the access result; determine the authentication result of the test code image based on the access result.

[0122] In one embodiment, the execution module 803 is specifically used to perform a status check in real time to obtain a status check result during the process of executing the test case for the target interface according to the test code mirror; when the status check result indicates that there is no abnormality in the test process, obtain the test result obtained by executing the test case for the target interface according to the test code mirror, and generate the test report based on the test result.

[0123] In one embodiment, the execution module 803 is further configured to obtain test exception information and generate a test exception report according to the test exception information when the status check result indicates that an exception occurs in the test process.

[0124] Each module in the above-mentioned test device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0125] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a test method is implemented.

[0126] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a test method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0127] Those skilled in the art will understand that Fig. 9 and Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0128] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0129] Acquire test information for a software development kit SDK, where the test information is used to characterize a target interface to be tested among multiple interfaces of the SDK;

[0130] Determine a test code image according to the test information and a pre-built test code library, where the test code image includes test code and configuration files for the target interface;

[0131] A test case for the target interface is executed according to the test code image to generate a test report for the target interface of the SDK.

[0132] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining test code from the test code library according to the test information, the test code including the interface code of the target interface and the target code for testing the target interface; compiling the test code, and generating the test code image according to the compiled test code.

[0133] In one embodiment, when the processor executes the computer program, the following steps are also implemented: performing authentication processing on the test code image to obtain an authentication result of the test code image; when the authentication result indicates that the test code image is successfully authenticated, executing the test case for the target interface according to the test code image to generate a test report for the target interface of the SDK.

[0134] In one embodiment, when the processor executes the computer program, the following steps are also implemented: loading and processing the configuration file in the test code image to obtain the key and test environment information; generating a random key string based on the key, and accessing the target test environment indicated by the test environment information based on the random key string, and determining the access result; determining the authentication result of the test code image based on the access result.

[0135] In one embodiment, the processor also implements the following steps when executing the computer program: in the process of executing the test case for the target interface according to the test code mirror, a status check is performed in real time to obtain a status check result; when the status check result indicates that there is no abnormality in the test process, the test result obtained by executing the test case for the target interface according to the test code mirror is obtained, and the test report is generated according to the test result.

[0136] In one embodiment, when the processor executes the computer program, the following steps are further implemented: when the status check result indicates that an abnormality occurs in the test process, test abnormality information is obtained, and a test abnormality report is generated according to the test abnormality information.

[0137] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0138] Acquire test information for a software development kit SDK, where the test information is used to characterize a target interface to be tested among multiple interfaces of the SDK;

[0139] Determine a test code image according to the test information and a pre-built test code library, where the test code image includes test code and configuration files for the target interface;

[0140] A test case for the target interface is executed according to the test code image to generate a test report for the target interface of the SDK.

[0141] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining test code from the test code library according to the test information, the test code including the interface code of the target interface and the target code for testing the target interface; compiling the test code, and generating the test code image according to the compiled test code.

[0142] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the test code image is authenticated to obtain an authentication result of the test code image; when the authentication result indicates that the test code image is successfully authenticated, the test case for the target interface is executed according to the test code image to generate a test report for the target interface of the SDK.

[0143] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: loading and processing the configuration file in the test code image to obtain the key and test environment information; generating a random key string based on the key, and accessing the target test environment indicated by the test environment information based on the random key string, and determining the access result; determining the authentication result of the test code image based on the access result.

[0144] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in the process of executing the test case for the target interface according to the test code mirror, a status check is performed in real time to obtain a status check result; when the status check result indicates that there is no abnormality in the test process, the test result obtained by executing the test case for the target interface according to the test code mirror is obtained, and the test report is generated according to the test result.

[0145] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the status check result indicates that an abnormality occurs in the test process, test abnormality information is obtained, and a test abnormality report is generated according to the test abnormality information.

[0146] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0147] Acquire test information for a software development kit SDK, where the test information is used to characterize a target interface to be tested among multiple interfaces of the SDK;

[0148] Determine a test code image according to the test information and a pre-built test code library, where the test code image includes test code and configuration files for the target interface;

[0149] A test case for the target interface is executed according to the test code image to generate a test report for the target interface of the SDK.

[0150] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining test code from the test code library according to the test information, the test code including the interface code of the target interface and the target code for testing the target interface; compiling the test code, and generating the test code image according to the compiled test code.

[0151] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the test code image is authenticated to obtain an authentication result of the test code image; when the authentication result indicates that the test code image is successfully authenticated, the test case for the target interface is executed according to the test code image to generate a test report for the target interface of the SDK.

[0152] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: loading and processing the configuration file in the test code image to obtain the key and test environment information; generating a random key string based on the key, and accessing the target test environment indicated by the test environment information based on the random key string, and determining the access result; determining the authentication result of the test code image based on the access result.

[0153] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in the process of executing the test case for the target interface according to the test code mirror, a status check is performed in real time to obtain a status check result; when the status check result indicates that there is no abnormality in the test process, the test result obtained by executing the test case for the target interface according to the test code mirror is obtained, and the test report is generated according to the test result.

[0154] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the status check result indicates that an abnormality occurs in the test process, test abnormality information is obtained, and a test abnormality report is generated according to the test abnormality information.

[0155] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0156] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0157] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A testing method, characterized in that: The method comprises: Acquire test information for a software development kit SDK, where the test information is used to characterize a target interface to be tested among multiple interfaces of the SDK; Determine a test code mirror according to the test information and a pre-built test code library, wherein the test code mirror includes a test code and a configuration file for the target interface; A test case for the target interface is executed according to the test code mirror to generate a test report for the target interface of the SDK.

2. The method according to claim 1, characterized in that The determining the test code mirror according to the test information and a pre-built test code library includes: Acquire test code from the test code library according to the test information, the test code including the interface code of the target interface and the target code for testing the target interface; The test code is compiled, and the test code image is generated according to the compiled test code.

3. The method according to claim 1, characterized in that The executing the test case for the target interface according to the test code mirror to generate a test report for the target interface of the SDK includes: Performing authentication processing on the test code image to obtain an authentication result of the test code image; When the authentication result indicates that the authentication of the test code image is successful, a test case for the target interface is executed according to the test code image to generate a test report for the target interface of the SDK.

4. The method according to claim 3, characterized in that: The performing authentication processing on the test code image to obtain an authentication result of the test code image includes: Loading the configuration file in the test code image to obtain the key and test environment information; Generate a random key string according to the key, access the target test environment indicated by the test environment information based on the random key string, and determine the access result; An authentication result of the test code image is determined according to the access result.

5. The method according to claim 3, characterized in that: The executing the test case for the target interface according to the test code mirror to generate a test report for the target interface of the SDK includes: In the process of executing the test case for the target interface according to the test code mirror, a status check is performed in real time to obtain a status check result; When the status check result indicates that no abnormality occurs during the test process, a test result obtained by executing the test case for the target interface according to the test code mirror is obtained, and the test report is generated according to the test result.

6. The method according to claim 5, characterized in that The method further comprises: When the status check result indicates that an abnormality occurs in the test process, test abnormality information is obtained, and a test abnormality report is generated according to the test abnormality information.

7. A testing device, characterized in that: The device comprises: An acquisition module, used for acquiring test information for a software development kit SDK, wherein the test information is used for characterizing a target interface to be tested among multiple interfaces of the SDK; A determination module, configured to determine a test code image according to the test information and a pre-built test code library, wherein the test code image includes a test code and a configuration file for the target interface; An execution module is used to execute test cases for the target interface according to the test code mirror to generate a test report for the target test interface of the SDK.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.