Multi-environment interface comparison test method and device, computer device, and storage medium

By comparing the test results of the interface code in multiple test environments, the problem of incomplete and untimely testing caused by relying on simulated data in existing technologies is solved. This enables the verification of the stability and accuracy of the interface code, early detection of defects, and full verification of the interface data.

CN115563006BActive Publication Date: 2026-06-26CHINA PING AN PROPERTY INSURANCE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA PING AN PROPERTY INSURANCE CO LTD
Filing Date
2022-10-27
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies rely too heavily on simulated data when testing dynamically changing interfaces, resulting in incomplete and untimely test results, and failing to effectively verify whether data changes caused by interface code modifications meet expectations.

Method used

By comparing the test results of the interface code in multiple test environments, including non-production and production environments, we can gradually verify whether the return results of existing and newly added functions are consistent, thus ensuring the stability and accuracy of the interface code under different environments.

Benefits of technology

It enables early detection of code defects, ensures full and comprehensive verification of interface returned data, avoids test omissions, and can judge the impact of new code on interface performance in different environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115563006B_ABST
    Figure CN115563006B_ABST
Patent Text Reader

Abstract

The application discloses a multi-environment interface comparison test method applied to the field of software testing. The method comprises the following steps: obtaining a test result of a first version of interface code in a first back-end environment and a test result of a current version of interface code in a second back-end environment; if the return results of existing functions are the same and the return results of new functions are different, obtaining a test result of the first version of interface code in the second back-end environment; if the return results of existing functions are the same and the return results of new functions are the same, obtaining a test result of the first version of interface code in a third back-end environment and a test result of the current version of interface code in a fourth back-end environment; if the return results of existing functions are the same and the return results of new functions are different, obtaining a test result of the first version of interface code in the fourth back-end environment; and if the return results of existing functions are the same and the return results of new functions are the same, the first version of interface code passes the test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software testing technology, and in particular to a multi-environment interface comparison testing method, apparatus, computer equipment, and storage medium. Background Technology

[0002] The APIs used by software and apps in the financial and insurance industries often involve data such as personal information, amounts, fees, interest rates, trends, and distributions across various dimensions. Users are highly sensitive to changes in this data, so development teams often need to rigorously test and continuously monitor the data returned by these APIs. For example, the APIs for insurance, wealth management, and loan products on fintech platforms return data such as amounts and interest rates. Another example is the API data from digital healthcare platforms, which includes personal health records, prescriptions, and examination reports—data that involves personal medical information.

[0003] However, when the product's API calls involve large amounts of data, complex calculations, and dynamic changes in field values ​​or data structures, it is necessary to verify whether the data changes caused by API code modifications meet expectations. Existing technologies generally use API test results from test and production environments for comparison, but this relies too heavily on simulated data, resulting in incomplete, inaccurate, and untimely test results. Summary of the Invention

[0004] This application provides a multi-environment interface comparison test method, apparatus, computer equipment, and storage medium to solve the problems of over-reliance on simulated data and incomplete and untimely test results when testing dynamically changing interfaces in the prior art.

[0005] The first aspect of this application provides a method for comparing interfaces in multiple environments, including:

[0006] Obtain the first test result of the first version of the interface code to be tested in the first backend interface service environment, and the second test result of the current version of the interface code in the second backend interface service environment, wherein the first backend interface service environment and the second backend interface service environment are non-production environments;

[0007] Determine whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same;

[0008] If the return results of the existing functions in the first test result and the second test result are the same, and the return results of the newly added functions are different, then obtain the third test result of the first version of the interface code to be tested in the second backend interface service environment;

[0009] Determine whether the return results of the existing functions in the first test result and the third test result are the same, and whether the return results of the newly added functions are the same;

[0010] If the return results of the existing functions in the first test result and the third test result are the same and the return results of the newly added functions are the same, then obtain the fourth test result of the first version of the interface code to be tested in the third backend interface service environment, and the fifth test result of the current version of the interface code in the fourth backend interface service environment, wherein the third backend interface service environment and the fourth backend interface service environment are production environments.

[0011] Determine whether the return results of the existing functions in the fourth test result and the fifth test result are the same, and whether the return results of the newly added functions are the same;

[0012] If the return results of the existing functions in the fourth test result and the fifth test result are the same, but the return results of the newly added functions are different, then the sixth test result of the first version of the interface code to be tested in the fourth backend interface service environment is obtained.

[0013] Determine whether the return results of the existing functions in the fourth test result and the sixth test result are the same, and whether the return results of the newly added functions are the same;

[0014] If the return results of the existing functions in the fourth test result and the return results of the newly added functions are the same, then the first version of the interface code to be tested passes the test.

[0015] A second aspect of this application provides a multi-environment interface comparison testing device, comprising:

[0016] The first test process module is used to obtain the first test result of the first version of the interface code to be tested in the first backend interface service environment, and the second test result of the current version of the interface code in the second backend interface service environment, wherein the first backend interface service environment and the second backend interface service environment are non-production environments;

[0017] The first result comparison module is used to determine whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same;

[0018] The second test process module is used to obtain the third test result of the first version of the interface code to be tested in the second backend interface service environment if the return result of the existing function in the first test result and the return result of the new function are the same and different.

[0019] The second result comparison module is used to determine whether the return results of the existing functions in the first test result and the third test result are the same, and whether the return results of the newly added functions are the same.

[0020] The third test process module is used to obtain the fourth test result of the first version of the interface code to be tested in the third backend interface service environment and the fifth test result of the current version of the interface code in the fourth backend interface service environment if the return result of the existing function in the first test result and the return result of the newly added function are the same. The third backend interface service environment and the fourth backend interface service environment are production environments.

[0021] The third result comparison module is used to determine whether the return results of the existing functions in the fourth test result and the fifth test result are the same, and whether the return results of the newly added functions are the same.

[0022] The fourth test process module is used to obtain the sixth test result of the first version of the interface code to be tested in the fourth backend interface service environment if the return results of the existing functions in the fourth test result and the return results of the newly added functions are the same and different.

[0023] The fourth result comparison module is used to determine whether the return results of the existing functions in the fourth test result and the sixth test result are the same, and whether the return results of the newly added functions are the same.

[0024] The test verification module is used to ensure that if the return results of the existing functions in the fourth test result and the return results of the newly added functions are the same, then the first version of the interface code to be tested passes the test.

[0025] A third aspect of this application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described multi-environment interface comparison test method.

[0026] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described multi-environment interface comparison test method.

[0027] The aforementioned multi-environment interface comparison test method, apparatus, computer equipment, and storage medium compare and verify the test results of different test environments multiple times. This helps to discover code defects as early as possible in the early stages of testing in low-environment environments and ensures that the data returned by the interface can be fully and comprehensively verified, avoiding test omissions. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a schematic diagram of an application environment for a multi-environment interface comparison test method in one embodiment of this application;

[0030] Figure 2 This is a flowchart of a multi-environment interface comparison test method in one embodiment of this application;

[0031] Figure 3 This is a schematic diagram of the structure of a multi-environment interface comparison test device in one embodiment of this application;

[0032] Figure 4 This is a schematic diagram of a computer device according to one embodiment of this application. Detailed Implementation

[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0034] The multi-environment interface comparison testing method provided in this application can be applied to, for example... Figure 1 In this application environment, the computer equipment can be, but is not limited to, various personal computers and laptops. The computer equipment can also be a server, which can be a standalone server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. This is understandable. Figure 1 The number of computer devices shown is merely illustrative and can be expanded in any number according to actual needs.

[0035] In the field of software testing, environments typically include QA (Quality Assurance), STG (Staging, Pre-Release), UAT (User Acceptance Test), and PRD (Production). The QA and STG environments are non-production environments, while the UAT and PRD environments are production environments. Furthermore, during testing, corresponding database environments need to be configured for both the non-production and production environments. Generally, some data from the database connected to the production environment is synchronized to another database to serve as the database corresponding to the non-production environment. Simultaneously, testers must differentiate between non-production and production environments when writing test cases or generating automated test cases.

[0036] In one embodiment, such as Figure 2 As shown, a multi-environment interface comparison test method is provided, which is then applied to... Figure 1 The following steps, S101 to S109, are used as an example of computer equipment:

[0037] S101. Obtain the first test result of the first version of the interface code to be tested in the first backend interface service environment, and the second test result of the current version of the interface code in the second backend interface service environment, wherein the first backend interface service environment and the second backend interface service environment are non-production environments.

[0038] Furthermore, obtaining the first test result of the first version of the interface code to be tested in the first backend interface service environment includes: firstly, obtaining the first database environment corresponding to the first backend interface service environment, wherein the first database environment is a non-production environment. Then, running the first interface automated test case using a preset testing tool or testing framework, wherein the first interface automated test case obtains the first test result from the first database environment through the first backend interface service environment.

[0039] Furthermore, the preset testing tools or frameworks include, but are not limited to, Postman, JMeter, SoapUI, Robot Framework, Unittest, TestNG, etc. In more specific embodiments, the corresponding testing tool or framework is selected based on the attributes of the interface code to be tested and the testing requirements. For example, some fintech platforms provide functions with high-concurrency application scenarios such as shopping, social networking, interactive games, and resource transfer. Therefore, high-concurrency testing tools are needed to stress test these application scenarios to ensure that the deployed functional code can run well under high-concurrency conditions. As another example, some digital healthcare platforms provide functions that require stable communication lines, such as intelligent diagnosis and remote consultation. Before deployment, these functions need to undergo thorough stability testing using stability testing tools to ensure uninterrupted operation and high-quality transmission of images and voice during use.

[0040] S102. Determine whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same.

[0041] The process of determining whether the returned results are the same includes, but is not limited to: verifying the interface return status, error messages, returned data structure, all field values, interface response time, etc., and generating comparison results or test reports. The automated script does not need to perform specific validations on the results returned by a particular interface, such as verifying that the returned data must contain field A, or that the value of field A must be "100". It only needs to directly compare whether the returned results of the two backend interface service environments are completely identical, without being constrained by test cases or test data.

[0042] The existing functions refer to the functional code portions of the interface code to be tested in the first version that are the same as those in the current version of the interface code. The newly added functions refer to the functional code portions of the interface code to be tested in the first version that are different from those in the current version of the interface code, i.e., newly added interface code or modified interface code.

[0043] Furthermore, if the return results of the existing functions in the first test result and the second test result are different, or the return results of the newly added functions are the same, then the first version of the interface code to be tested has a defect. Then, the first test result is updated using the test results of the second version of the interface code to be tested in the first backend interface service environment, wherein the second version of the interface code to be tested is obtained after modifying the defects in the first version of the interface code to be tested. Finally, the steps of determining whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same, are executed again.

[0044] S103 If the return results of the existing functions in the first test result and the second test result are the same, and the return results of the newly added functions are different, then obtain the third test result of the first version of the interface code to be tested in the second backend interface service environment.

[0045] In this process, after the first version of the interface code to be tested passes the verification in the first backend interface service environment, it needs to be further verified in the second backend interface service environment, which further increases the stability of the first version of the interface code to be tested.

[0046] S104. Determine whether the return results of the existing functions in the first test result and the third test result are the same, and whether the return results of the newly added functions are the same.

[0047] Furthermore, if the return results of the existing functions in the first test result and the return results of the newly added functions are different from those in the third test result, then the first version of the interface code to be tested has a defect. Then, the first test result is updated using the test results of the third version of the interface code to be tested in the first backend interface service environment, wherein the third version of the interface code to be tested is obtained by modifying the defects in the first version or the second version of the interface code to be tested. Finally, the steps of determining whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same, are executed again.

[0048] S105. If the return results of the existing functions in the first test result and the third test result are the same and the return results of the newly added functions are the same, then obtain the fourth test result of the first version of the interface code to be tested in the third backend interface service environment, and the fifth test result of the current version of the interface code in the fourth backend interface service environment, wherein the third backend interface service environment and the fourth backend interface service environment are production environments.

[0049] Further, obtaining the fourth test result of the first version of the interface code to be tested in the third backend interface service environment includes: first, obtaining the second database environment corresponding to the third backend interface service environment, wherein the second database environment is a production environment. Then, running the second interface automated test case using a preset testing tool or testing framework, the second interface automated test case obtaining the fourth test result from the second database environment through the third backend interface service environment.

[0050] S106. Determine whether the return results of the existing functions in the fourth test result and the fifth test result are the same, and whether the return results of the newly added functions are the same.

[0051] Furthermore, if the return results of the existing functions in the fourth test result and the fifth test result are different, or the return results of the newly added functions are the same, then the first version of the interface code to be tested has a defect. Then, the first test result is updated using the test results of the fourth version of the interface code to be tested in the first backend interface service environment, wherein the fourth version of the interface code to be tested is obtained by modifying the defects in the first version, the second version, or the third version of the interface code to be tested. Finally, the steps of determining whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same, are executed again.

[0052] S107. If the return results of the existing functions in the fourth test result and the fifth test result are the same, and the return results of the newly added functions are different, then obtain the sixth test result of the first version of the interface code to be tested in the fourth backend interface service environment.

[0053] After the first version of the interface code to be tested passes the verification in the third backend interface service environment, it needs to be further verified in the fourth backend interface service environment, which further increases the stability of the first version of the interface code to be tested.

[0054] S108. Determine whether the return results of the existing functions in the fourth test result and the sixth test result are the same, and whether the return results of the newly added functions are the same.

[0055] Furthermore, if the return results of the existing functions in the fourth test result and the sixth test result are different, or the return results of the newly added functions are different, then the first version of the interface code to be tested has a defect. Then, the first test result is updated using the test results of the fifth version of the interface code to be tested in the first backend interface service environment, wherein the fifth version of the interface code to be tested is obtained by modifying the defects of the first version, the second version, the third version, or the fourth version of the interface code to be tested. Finally, the steps of determining whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same, are executed again.

[0056] S109. If the return results of the existing functions in the fourth test result and the sixth test result are the same, and the return results of the newly added functions are the same, then the first version of the interface code to be tested passes the test.

[0057] Furthermore, it should be noted that if the current R&D environment and conditions cannot meet the requirements for establishing the aforementioned four testing environments, the aforementioned testing process can be simplified to two testing environments, namely QA environment and STG environment, or UAT environment and PRD environment. The execution principle of the above multi-environment interface comparison testing method remains unchanged, that is, only the test results in the first backend interface service environment and the second backend interface service environment, or the test results in the third backend interface service environment and the fourth backend interface service environment are verified.

[0058] The multi-environment interface comparison testing method provided in this embodiment compares and verifies the test results of different testing environments, which helps to discover code defects as early as possible in low-environment environments; it can also ensure that the data returned by the interface can be fully and comprehensively verified, avoiding test omissions; at the same time, it can also judge the difference in interface performance brought by new code from the response speed of the interface in different environments.

[0059] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0060] In one embodiment, a multi-environment interface comparison testing device 100 is provided, which corresponds one-to-one with the multi-environment interface comparison testing method described in the above embodiments. For example... Figure 3As shown, the multi-environment interface comparison testing device 100 includes a first test process module 11, a first result comparison module 12, a second test process module 13, a second result comparison module 14, a third test process module 15, a third result comparison module 16, a fourth test process module 17, a fifth result comparison module 18, and a test pass verification module 19. Detailed descriptions of each functional module are as follows:

[0061] The first test process module 11 is used to obtain the first test result of the first version of the interface code to be tested in the first backend interface service environment, and the second test result of the current version of the interface code in the second backend interface service environment, wherein the first backend interface service environment and the second backend interface service environment are non-production environments.

[0062] The first result comparison module 12 is used to determine whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same;

[0063] The second test process module 13 is used to obtain the third test result of the first version of the interface code to be tested in the second backend interface service environment if the return result of the existing function in the first test result and the return result of the new function are the same and different.

[0064] The second result comparison module 14 is used to determine whether the return results of the existing functions in the first test result and the third test result are the same, and whether the return results of the newly added functions are the same.

[0065] The third test process module 15 is used to obtain the fourth test result of the first version of the interface code to be tested in the third backend interface service environment and the fifth test result of the current version of the interface code in the fourth backend interface service environment if the return result of the existing function in the first test result and the return result of the newly added function are the same. The third backend interface service environment and the fourth backend interface service environment are production environments.

[0066] The third result comparison module 16 is used to determine whether the return results of the existing functions in the fourth test result and the fifth test result are the same, and whether the return results of the newly added functions are the same;

[0067] The fourth test process module 17 is used to obtain the sixth test result of the first version of the interface code to be tested in the fourth backend interface service environment if the return results of the existing functions in the fourth test result and the return results of the newly added functions are the same and different.

[0068] The fourth result comparison module 18 is used to determine whether the return results of the existing functions in the fourth test result and the sixth test result are the same, and whether the return results of the newly added functions are the same;

[0069] The test verification module 19 is used to verify that if the return results of the existing functions in the fourth test result and the sixth test result are the same, and the return results of the newly added functions are the same, then the first version of the interface code to be tested passes the test.

[0070] Furthermore, the first result comparison module 12 also includes:

[0071] The first defect code judgment submodule is used to determine if the return results of the existing functions in the first test result and the second test result are different or the return results of the newly added functions are the same, then the first version of the interface code to be tested has a defect.

[0072] The second version code acquisition submodule is used to update the first test result using the test result of the second version of the interface code to be tested in the first backend interface service environment. The second version of the interface code to be tested is obtained by modifying the defects of the first version of the interface code to be tested.

[0073] The first step is to reset the submodule, which is used to re-execute the step of judging whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same.

[0074] Furthermore, the second result comparison module 14 also includes:

[0075] The second defect code judgment submodule is used to determine if the return results of the existing functions in the first test result and the third test result are different or the return results of the newly added functions are different, then the first version of the interface code to be tested has a defect.

[0076] The third version code acquisition submodule is used to update the first test result using the test result of the third version of the interface code to be tested in the first backend interface service environment. The third version of the interface code to be tested is obtained by modifying the defects of the first version or the second version of the interface code to be tested.

[0077] The second step is to reset the submodule, which is used to re-execute the step of judging whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same.

[0078] Furthermore, the third result comparison module 16 also includes:

[0079] The third defect code judgment submodule is used to determine if the return results of the existing functions in the fourth test result and the fifth test result are different or the return results of the newly added functions are the same, then the first version of the interface code to be tested has a defect.

[0080] The fourth version code acquisition submodule is used to update the first test result using the test result of the fourth version of the interface code to be tested in the first backend interface service environment. The fourth version of the interface code to be tested is obtained by modifying the defects of the first version, the second version, or the third version of the interface code to be tested.

[0081] The third step is to reset the submodule, which is used to re-execute the step of judging whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same.

[0082] Furthermore, the fourth result comparison module 18 also includes:

[0083] The fourth defect code judgment submodule is used to determine if the return results of the existing functions in the fourth test result and the sixth test result are different or the return results of the newly added functions are different, then the first version of the interface code to be tested has a defect.

[0084] The fifth version code acquisition submodule is used to update the first test result using the test result of the fifth version of the interface code to be tested in the first backend interface service environment. The fifth version of the interface code to be tested is obtained by modifying the defects of the first version, the second version, the third version, or the fourth version of the interface code to be tested.

[0085] The fourth step is to reset the submodule, which is used to re-execute the step of judging whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same.

[0086] Furthermore, the first test process module 11 also includes:

[0087] The first database environment submodule is used to obtain the first database environment corresponding to the first backend interface service environment, wherein the first database environment is a non-production environment.

[0088] The first automated testing submodule is used to run the first interface automated test case using a preset testing tool or testing framework. The first interface automated test case obtains the first test result from the first database environment through the first backend interface service environment.

[0089] Furthermore, the third test process module 15 also includes:

[0090] The second database environment submodule is used to obtain the second database environment corresponding to the third backend interface service environment, wherein the second database environment is a production environment;

[0091] The second automated testing submodule is used to run second interface automated test cases using preset testing tools or testing frameworks. The second interface automated test cases obtain the fourth test result from the second database environment through the third backend interface service environment.

[0092] The terms "first" and "second" in the above-mentioned modules / units are only used to distinguish different modules / units and are not intended to specify which module / unit has a higher priority or any other limiting meaning. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. The module divisions appearing in this application are merely logical divisions; in actual applications, different division methods may be used.

[0093] Specific limitations regarding the multi-environment interface comparison test device can be found in the limitations of the multi-environment interface comparison test method described above, and will not be repeated here. Each module in the aforementioned multi-environment interface comparison test device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0094] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides the environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data involved in the multi-environment interface comparison test method. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a multi-environment interface comparison test method.

[0095] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the multi-environment interface comparison test method described in the above embodiments, for example... Figure 2 The steps S101 to S109 shown, as well as other extensions and related steps of the method, are examples. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit of the multi-environment interface comparison test device in the above embodiments, for example... Figure 3 The functions of modules 11 to 19 are shown. To avoid repetition, they will not be described again here.

[0096] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the computer device, connecting various parts of the computer device via various interfaces and lines.

[0097] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, video data, etc.).

[0098] The memory can be integrated into the processor or it can be set up separately from the processor.

[0099] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements the steps of the multi-environment interface comparison test method described in the above embodiments, for example... Figure 2The steps S101 to S109 shown, as well as other extensions and related steps of the method, are examples. Alternatively, when the computer program is executed by a processor, it implements the functions of each module / unit of the multi-environment interface comparison test device in the above embodiments, for example... Figure 3 The functions of modules 11 to 19 are shown. To avoid repetition, they will not be described again here.

[0100] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0101] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0102] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A multi-environment interface comparison test method, characterized in that, include: Obtain the first test result of the first version of the interface code to be tested in the first backend interface service environment, and the second test result of the current version of the interface code in the second backend interface service environment, wherein the first backend interface service environment and the second backend interface service environment are non-production environments; Determine whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same; If the return results of the existing functions in the first test result and the second test result are the same, and the return results of the newly added functions are different, then obtain the third test result of the first version of the interface code to be tested in the second backend interface service environment; Determine whether the return results of the existing functions in the first test result and the third test result are the same, and whether the return results of the newly added functions are the same; If the return results of the existing functions in the first test result and the third test result are the same and the return results of the newly added functions are the same, then obtain the fourth test result of the first version of the interface code to be tested in the third backend interface service environment, and the fifth test result of the current version of the interface code in the fourth backend interface service environment, wherein the third backend interface service environment and the fourth backend interface service environment are production environments. Determine whether the return results of the existing functions in the fourth test result and the fifth test result are the same, and whether the return results of the newly added functions are the same; If the return results of the existing functions in the fourth test result and the fifth test result are the same, but the return results of the newly added functions are different, then the sixth test result of the first version of the interface code to be tested in the fourth backend interface service environment is obtained. Determine whether the return results of the existing functions in the fourth test result and the sixth test result are the same, and whether the return results of the newly added functions are the same; If the return results of the existing functions in the fourth test result and the return results of the newly added functions are the same, then the first version of the interface code to be tested passes the test.

2. The multi-environment interface comparison test method according to claim 1, characterized in that, The step of determining whether the return results of existing functions in the first test result and the second test result are the same, and whether the return results of newly added functions are the same, further includes: If the return results of the existing functions in the first test result and the second test result are different, or the return results of the newly added functions are the same, then the first version of the interface code to be tested has defects. The first test result is updated using the test results of the second version of the interface code to be tested in the first backend interface service environment, wherein the second version of the interface code to be tested is obtained by modifying the defects of the first version of the interface code to be tested; Repeat the steps of determining whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same.

3. The multi-environment interface comparison test method according to claim 2, characterized in that, The step of determining whether the return results of the existing functions in the first test result and the third test result are the same, and whether the return results of the newly added functions are the same, further includes: If the return results of the existing functions in the first test result and the third test result are different, or the return results of the newly added functions are different, then the first version of the interface code to be tested has defects. The first test result is updated using the test results of the third version of the interface code to be tested in the first backend interface service environment, wherein the third version of the interface code to be tested is obtained by modifying the defects of the first version or the second version of the interface code to be tested; Repeat the steps of determining whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same.

4. The multi-environment interface comparison test method according to claim 3, characterized in that, The step of determining whether the return results of the existing functions in the fourth test result and the fifth test result are the same, and whether the return results of the newly added functions are the same, further includes: If the return results of the existing functions in the fourth test result and the fifth test result are different, or the return results of the newly added functions are the same, then the first version of the interface code to be tested has defects. The first test result is updated using the test results of the fourth version of the interface code to be tested in the first backend interface service environment, wherein the fourth version of the interface code to be tested is obtained by modifying the defects of the first version, the second version, or the third version of the interface code to be tested; Repeat the steps of determining whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same.

5. The multi-environment interface comparison test method according to claim 4, characterized in that, The step of determining whether the return results of the existing functions in the fourth test result and the sixth test result are the same, and whether the return results of the newly added functions are the same, further includes: If the return results of the existing functions in the fourth test result and the sixth test result are different, or the return results of the newly added functions are different, then the first version of the interface code to be tested has defects. The first test result is updated using the test results of the fifth version of the interface code to be tested in the first backend interface service environment, wherein the fifth version of the interface code to be tested is obtained by modifying the defects of the first version, the second version, the third version, or the fourth version of the interface code to be tested; Repeat the steps of determining whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same.

6. The multi-environment interface comparison test method according to claim 1, characterized in that, The first test results obtained from the first version of the interface code to be tested in the first backend interface service environment include: Obtain the first database environment corresponding to the first backend interface service environment, wherein the first database environment is a non-production environment; The first interface automated test case is run using a preset test tool or test framework, and the first interface automated test case obtains the first test result from the first database environment through the first backend interface service environment.

7. The multi-environment interface comparison test method according to claim 1, characterized in that, The fourth test result obtained by acquiring the first version of the interface code to be tested in the third backend interface service environment includes: Obtain the second database environment corresponding to the third backend interface service environment, wherein the second database environment is a production environment; The second interface automated test case is run using a preset test tool or test framework, and the second interface automated test case obtains the fourth test result from the second database environment through the third backend interface service environment.

8. A multi-environment interface comparison testing device, characterized in that, include: The first test process module is used to obtain the first test result of the first version of the interface code to be tested in the first backend interface service environment, and the second test result of the current version of the interface code in the second backend interface service environment, wherein the first backend interface service environment and the second backend interface service environment are non-production environments; The first result comparison module is used to determine whether the return results of the existing functions in the first test result and the second test result are the same, and whether the return results of the newly added functions are the same; The second test process module is used to obtain the third test result of the first version of the interface code to be tested in the second backend interface service environment if the return result of the existing function in the first test result and the return result of the new function are the same and different. The second result comparison module is used to determine whether the return results of the existing functions in the first test result and the third test result are the same, and whether the return results of the newly added functions are the same. The third test process module is used to obtain the fourth test result of the first version of the interface code to be tested in the third backend interface service environment and the fifth test result of the current version of the interface code in the fourth backend interface service environment if the return result of the existing function in the first test result and the return result of the newly added function are the same. The third backend interface service environment and the fourth backend interface service environment are production environments. The third result comparison module is used to determine whether the return results of the existing functions in the fourth test result and the fifth test result are the same, and whether the return results of the newly added functions are the same. The fourth test process module is used to obtain the sixth test result of the first version of the interface code to be tested in the fourth backend interface service environment if the return results of the existing functions in the fourth test result and the return results of the newly added functions are the same and different. The fourth result comparison module is used to determine whether the return results of the existing functions in the fourth test result and the sixth test result are the same, and whether the return results of the newly added functions are the same. The test verification module is used to ensure that if the return results of the existing functions in the fourth test result and the return results of the newly added functions are the same, then the first version of the interface code to be tested passes the test.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the multi-environment interface comparison test method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the multi-environment interface comparison test method as described in any one of claims 1 to 7.