Multi-environment interface testing method and device

Through the multi-environment interface testing method, the interface testing and comparison process is automatically completed, which solves the problems of cumbersome and inefficient existing interface testing methods, and significantly improves the testing efficiency.

CN119537249APending Publication Date: 2025-02-28AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411769874.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

Existing interface testing methods require manual testing in a variety of environments and scenarios, resulting in cumbersome testing, prone to errors and inefficient.

Method used

Provide a multi-environment interface testing method. By responding to the triggered test environment selection, comparison test environment selection and comparison function selection, the interface testing and comparison process is automatically completed, and the editing distance algorithm is used for accurate comparison.

Benefits of technology

It reduces the errors and time consumption of human operations, significantly improves the efficiency of interface testing, and can complete complex testing processes quickly and accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537249A_ABST
    Figure CN119537249A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-environment interface test method and device, and the method comprises the steps: determining a test environment in response to a triggered test environment selection operation; determining a comparison test environment in response to a triggered comparison test environment selection operation; determining a comparison function in response to the triggered comparison function selection operation; when an input to-be-tested interface message is received, inputting the to-be-tested interface message into the test environment for testing to obtain a test result; inputting the to-be-tested interface message into a comparison test environment for testing to obtain a comparison test result; and comparing the test result with the comparison test result according to the comparison function to obtain a comparison result. By responding to the trigger operation, the test environment and the comparison function which need to be used are determined, and a complex test process can be completed only by selecting the corresponding environment and function, so that errors and time consumption caused by manual operation are reduced, and the interface test efficiency is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of interface testing, and in particular to a method and device for interface testing in multiple environments. Background Art

[0002] In recent years, due to the development of technology and the growth of business, the old architecture system has gradually been unable to support the increasingly huge business growth needs, and many systems inside and outside the industry have begun to upgrade their architecture. With the continuous realization of functions during the architecture upgrade process, verifying the consistency of interface functions before and after the system upgrade has become a key focus.

[0003] At present, developers usually develop or reconstruct functional interfaces and conduct tests in different environments. At the same time, they also need to use tools to send the same request to the existing interface and the upgraded interface respectively, and then compare the results to obtain the test results. However, during the interface testing process, it is usually necessary to manually test in different environments and scenarios, and compare the return results of the interface before and after the upgrade one by one. This process involves verification of multiple environments and multiple scenarios, and can only rely on manual execution and comparison, which is cumbersome and error-prone, resulting in low efficiency of interface testing.

[0004] Therefore, how to improve the efficiency of interface testing has become an urgent problem to be solved in this field. Summary of the invention

[0005] The present application provides a multi-environment interface testing method and device, the purpose of which is to improve the efficiency of interface testing.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] A multi-environment interface testing method, comprising:

[0008] In response to a triggered test environment selection operation, determining a test environment;

[0009] In response to the triggered comparison test environment selection operation, determining a comparison test environment;

[0010] In response to the triggered comparison function selection operation, determining a comparison function; the comparison function includes a precise comparison function and a custom comparison function;

[0011] When receiving an input interface message to be tested, inputting the interface message to be tested into the test environment for testing to obtain a test result;

[0012] Input the interface message to be tested into the comparison test environment for testing, and obtain the comparison test result;

[0013] The test result and the comparison test result are compared according to the comparison function to obtain a comparison result.

[0014] Optionally, the test environment selection operation in response to the triggering, before determining the test environment, further includes:

[0015] In response to the triggered information filling operation, display the information filling page;

[0016] When the basic information of the interface to be tested input on the information filling page is received, the basic information of the interface to be tested is stored.

[0017] Optionally, the determining the comparison function in response to the triggered comparison function selection operation includes:

[0018] In response to the triggered precise comparison function selection operation, determining the comparison function as a precise comparison function;

[0019] In response to the triggered custom function selection operation, the comparison function is determined to be a custom comparison function.

[0020] Optionally, comparing the test result with the comparison test result according to the comparison function to obtain a comparison result includes:

[0021] When the comparison function is a precise comparison function, the test result and the comparison test result are calculated using an edit distance algorithm to obtain an edit distance between the test result and the comparison test result;

[0022] Determining whether the edit distance is less than a preset edit distance;

[0023] If the edit distance is less than the preset edit distance, determining that the comparison result is similar to the test result and the comparison test result;

[0024] If the edit distance is not less than the preset edit distance, it is determined that the comparison result is that the test result and the comparison test result are not similar.

[0025] Optionally, also include:

[0026] In response to the triggered performance detection function selection operation, obtaining a first timestamp of the interface message to be tested being input into the test environment and a second timestamp of the test result, as well as a third timestamp of the interface message to be tested being input into the comparison test environment and a fourth timestamp of the comparison test result;

[0027] Calculating a first difference between the first timestamp and the second timestamp;

[0028] calculating a second difference between the third timestamp and the fourth timestamp;

[0029] A difference between the first difference and the second difference is calculated to obtain a time difference, and the time difference is determined as a performance test result.

[0030] Optional, including:

[0031] A first determining unit, configured to determine a test environment in response to a triggered test environment selection operation;

[0032] A second determining unit, configured to determine a comparison test environment in response to a triggered comparison test environment selection operation;

[0033] A third determining unit, configured to determine a comparison function in response to a triggered comparison function selection operation; the comparison function includes a precise comparison function and a custom comparison function;

[0034] The first testing unit is used for, when receiving an input interface message to be tested, inputting the interface message to be tested into the testing environment for testing to obtain a test result;

[0035] The second testing unit is used to input the interface message to be tested into the comparison test environment for testing to obtain a comparison test result;

[0036] A comparison unit is used to compare the test result with the comparison test result according to the comparison function to obtain a comparison result.

[0037] Optionally, also include:

[0038] A display unit, used to display an information filling page in response to a triggered information filling operation;

[0039] The storage unit is used to store the basic information of the interface to be tested when the basic information of the interface to be tested input on the information filling page is received.

[0040] Optionally, also include:

[0041] a fourth determining unit, in response to the triggered precise comparison function selection operation, determining the comparison function to be a precise comparison function;

[0042] The fifth determining unit determines that the comparison function is a customized comparison function in response to the triggered customized function selection operation.

[0043] Optionally, the comparison unit is specifically used for:

[0044] When the comparison function is a precise comparison function, the test result and the comparison test result are calculated using an edit distance algorithm to obtain an edit distance between the test result and the comparison test result;

[0045] Determining whether the edit distance is less than a preset edit distance;

[0046] If the edit distance is less than the preset edit distance, determining that the comparison result is similar to the test result and the comparison test result;

[0047] If the edit distance is not less than the preset edit distance, it is determined that the comparison result is that the test result and the comparison test result are not similar.

[0048] Optionally, also include:

[0049] an acquisition unit, configured to acquire, in response to a triggered performance detection function selection operation, a first timestamp of the interface message to be tested being input into the test environment and a second timestamp of the test result, as well as a third timestamp of the interface message to be tested being input into the comparison test environment and a fourth timestamp of the comparison test result;

[0050] A first calculation unit, configured to calculate a first difference between the first timestamp and the second timestamp;

[0051] A second calculation unit, configured to calculate a second difference between the third timestamp and the fourth timestamp;

[0052] The result determination unit is used to calculate the difference between the first difference and the second difference to obtain a time difference, and determine the time difference as a performance test result.

[0053] The technical solution provided by the present application determines the test environment in response to the triggered test environment selection operation; determines the comparison test environment in response to the triggered comparison test environment selection operation; determines the comparison function in response to the triggered comparison function selection operation; when receiving the input interface message to be tested, the interface message to be tested is input into the test environment for testing to obtain the test result; the interface message to be tested is input into the comparison test environment for testing to obtain the comparison test result; the test result is compared with the comparison test result according to the comparison function to obtain the comparison result. By responding to the triggering operation, the test environment and comparison function to be used are determined, and the complex test process can be completed by simply selecting the corresponding environment and function, thereby reducing the errors and time consumption of human operation and significantly improving the efficiency of interface testing. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0055] Figure 1 A flowchart of a multi-environment interface testing method provided in an embodiment of the present application;

[0056] Figure 2 A flow chart of a test result comparison method provided in an embodiment of the present application;

[0057] Figure 3 A flow chart of a performance testing method provided in an embodiment of the present application;

[0058] Figure 4 A schematic diagram of a test tool interface provided in an embodiment of the present application;

[0059] Figure 5 A schematic diagram of the architecture of a multi-environment interface testing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0061] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0062] like Figure 1 As shown, it is a flowchart of a multi-environment interface testing method provided by an embodiment of the present application, comprising the following steps:

[0063] S101: In response to a triggered test environment selection operation, determine a test environment.

[0064] The information required by the test interface is displayed on the test page so that the user can make a selection, and the test environment is determined in response to the triggered test environment selection operation.

[0065] Optionally, for a transaction interface that needs to be tested under multiple environments and multiple data conditions (ie, an interface to be tested), the user can simultaneously check multiple required test environments, that is, determine multiple test environments in response to a triggered multiple test environment selection operation.

[0066] Optionally, before step S101, it is necessary to first write the basic information of the test interface, and subsequent related operations will be tested based on the currently filled basic information, ensuring that the interface information used for each test is consistent, avoiding test deviation or duplication of work caused by inconsistent information. Therefore, another embodiment of the present application provides a basic information storage method, including:

[0067] In response to the triggered information filling operation, the information filling page is displayed.

[0068] The information filling page indicates a page for filling in the information of the interface to be tested.

[0069] When the basic information of the interface to be tested input on the information filling page is received, the basic information of the interface to be tested is stored.

[0070] The basic information includes but is not limited to: the version number of the interface transaction to be tested and the transaction code of the interface transaction to be tested.

[0071] S102: In response to the triggered comparison test environment selection operation, determine a comparison test environment.

[0072] It is understandable that when there are multiple test environments, for situations where alignment is required, testing is required during system migration to ensure consistency, and the number of comparison test environments also needs to be multiple. The number of test environments is consistent with the number of comparison test environments, and one test environment corresponds to one comparison test environment.

[0073] S103: In response to the triggered comparison function selection operation, determine the comparison function.

[0074] Among them, the comparison function includes precise comparison function and customized comparison function.

[0075] It is understandable that, according to the provided custom comparison function, the function in the custom item can be selected to increase or subsequent comparison options, and the custom function script can be imported in the setting of the custom item to achieve compatibility of personalized functions.

[0076] Optionally, in another embodiment of the present application, a specific implementation of step S103 includes:

[0077] In response to the triggered precise comparison function selection operation, the comparison function is determined to be a precise comparison function.

[0078] Among them, the precise comparison function generally compares data content, timestamps, time-related fields, structures, etc.

[0079] In response to the triggered custom function selection operation, the comparison function is determined to be a custom comparison function.

[0080] It should be noted that you can also set up custom add-on plug-ins in the custom comparison function. These plug-ins can include various functions, such as data validation, data conversion, etc. As long as the imported script meets the language and input and output required by the tool, you can easily import, enable and disable the plug-in.

[0081] S104: When the input interface message to be tested is received, the interface message to be tested is input into the test environment for testing to obtain a test result.

[0082] The test result indicates the feedback information returned by the test environment (such as HTTP status code, corresponding data, and response time).

[0083] Optionally, you can use a preset tool (such as Postman, JMeter, Curl) to input the interface message to be tested into the test environment for testing.

[0084] It should be noted that by providing a message filling interface, a request message of the corresponding interface can be input on the message filling interface, or by providing a message selection interface, a corresponding input request message can be selected on the message selection interface or a recorded historical message can be directly selected, and the request message of the interface, or the input request message, or the recorded historical message can be used as the interface message to be tested, and the interface message to be tested can be input into the test environment for testing to obtain the test result.

[0085] S105: Input the interface message to be tested into the comparison test environment for testing, and obtain the comparison test result.

[0086] The comparison test result indicates feedback information returned by the comparison test environment.

[0087] S106: Compare the test result with the comparison test result according to the comparison function to obtain a comparison result.

[0088] Among them, the comparison function includes precise comparison function and customized comparison function.

[0089] It can be understood that when the comparison function is a precise comparison function and a custom comparison function, the test results and the comparison test results are precisely compared. After the precise comparison is completed, the comparison is performed again according to the comparison content pre-selected in the custom comparison function, and the comparison results can be more in line with expectations, thereby eliminating the influence of unnecessary factors.

[0090] It can be seen that the custom comparison function is a personalized function based on the precise comparison function, and the final comparison result is a personalized customized function result.

[0091] Optionally, in another embodiment of the present application, the specific implementation of step S106 is as follows: Figure 2 As shown, the following steps are included:

[0092] S201: When the comparison function is a precise comparison function, the test result and the comparison test result are calculated using an edit distance algorithm to obtain an edit distance between the test result and the comparison test result.

[0093] The specific expression of the edit distance algorithm is shown in formula (1).

[0094] (1)

[0095] In formula (1), LD a,b (i,j) represents the edit distance between the first i characters in the test result and the first j characters in the comparison test result, i is the position index of the character in the test result, j is the position index of the character in the comparison test result, max(i,j): when min(i,j)=0, that is, when one of the test result or the comparison test result has reached the end and the other has not, the edit distance is the number of characters remaining in the other sequence, LDa,b(i−1,j)+1 is to delete the i-th character in the test result, LDa,b(i,j−1)+1 is to delete the j-th character in the comparison test result, LDa,b(i−1,j−1)+1 is to delete the j-th character in the comparison test result, if the i-th character of the test result is the same as the j-th character of the comparison test result, no additional operation is required, if they are different, a replacement operation is required.

[0096] It can be understood that the minimum number of edits required to convert a test result into a comparison test result can be obtained through the edit distance algorithm.

[0097] S202: Determine whether the edit distance is less than a preset edit distance.

[0098] If the edit distance is less than the preset edit distance, step S203 is executed; if the edit distance is not less than the preset edit distance, step S204 is executed.

[0099] Specifically, the edit distance is 2, the preset edit distance is 1, and it is determined whether the edit distance is greater than the preset edit distance. Obviously, the edit distance is greater than the preset edit distance, so step S203 is continued.

[0100] S203: Determine that the comparison result is similar to the test result and the comparison test result.

[0101] It can be understood that if the edit distance is less than the preset edit distance, it is determined that the comparison result is similar to the test result and the comparison test result. The smaller the edit distance, the smaller the number of operations, and the higher the similarity between the comparison result and the test result.

[0102] S204: Determine that the comparison result is that the test result and the comparison test result are not similar.

[0103] It can be understood that if the edit distance is not less than the preset edit distance, the comparison result is determined to be similar to the test result and the comparison test result. The larger the edit distance, the more times the operation is performed, and the less similar the comparison result is to be the test result and the comparison test result.

[0104] Optionally, when testing an interface, performance testing is a crucial step, mainly to ensure that the interface can stably and quickly respond to user requests in actual use. Therefore, a performance testing method is provided in another embodiment of the present application, such as Figure 3 As shown, the following steps are included:

[0105] S301: In response to a triggered performance detection function selection operation, obtain a first timestamp of the interface message to be tested input into the test environment and a second timestamp of the test result, as well as a third timestamp of the interface message to be tested input into the comparison test environment and a fourth timestamp of the comparison test result.

[0106] It can be understood that the first timestamp of the interface message to be tested input into the test environment and the second timestamp of the test result, as well as the third timestamp of the interface message to be tested input into the comparison test environment and the fourth timestamp of the comparison test result are obtained, that is, the request time and response time of the interface message to be tested input into the test environment and the comparison test environment are obtained, so as to subsequently determine the performance test result based on the request time and response time.

[0107] S302: Calculate a first difference between the first timestamp and the second timestamp.

[0108] The specific form of calculating the first difference between the first timestamp and the second timestamp is shown in formula (2).

[0109] First difference = second timestamp - first timestamp (2)

[0110] S303: Calculate a second difference between the third timestamp and the fourth timestamp.

[0111] The specific form of calculating the second difference between the third timestamp and the fourth timestamp is as shown in formula (3).

[0112] Second difference = fourth timestamp - third timestamp (3)

[0113] S304: Calculate the difference between the first difference and the second difference to obtain a time difference, and determine the time difference as a performance test result.

[0114] It should be noted that the performance test results are determined by the timestamp comparison algorithm, that is, the performance test results are calculated through the above steps S302 to S304, so that the key indicators such as the response performance, throughput, and error rate of the system can be fully understood according to the performance test results. Through these analyses, the bottlenecks can be identified, and then optimization measures can be taken to improve the performance and stability of the system.

[0115] also, Figure 1 The content shown can be applied to the test tool, see Figure 4 A schematic diagram of a test tool interface is shown, including transaction set, transaction configuration, test configuration, input message, and test result.

[0116] (1) Transaction collection page (package): used to identify the button for creating a new transaction interface. Collection: a transaction collection used to classify the detailed information of multiple transaction interfaces. Transaction (tab): a saved detailed information of a single transaction interface.

[0117] (2) Transaction configuration version number: the version number corresponding to the target exchange (v1, v2, etc.). Transaction code: the transaction code corresponding to the target exchange.

[0118] (3) Test configuration environment: The test environment that the target exchange needs to execute. The left side is the test environment for display, which is linked to the return results below; the right side is the test environment for comparison, which is linked to the comparison results below. Users can freely select, add and delete the environment to be tested.

[0119] (4) Input message: This module is mainly used to input the test message of the target transaction (i.e. the interface message to be tested), and allows users to save and manage their history records. This history record can include requests, responses, comments, etc. Users can easily view, edit and delete history records. In addition, the system also provides template functions and encapsulation functions, allowing users to create their own request and response templates. These templates can contain constants, variables and expressions, such as adding default message headers, and automatically encapsulating only input attributes into message formats such as json and xml for use in subsequent requests. Users can save and share templates to facilitate team collaboration.

[0120] (5) Test results: Results returned by each environment: Test results returned by the target transaction in the selected test environment. Comparison results: Comparison test results of the target transaction in the selected test environment and the test environment used for comparison. The comparison test results will be displayed accordingly according to the enabled plug-in functions, and different colors will be used to identify different areas, instead of simply outputting different display forms, for example: original color represents the same, shaded yellow represents ignored, shaded blue represents different, and shaded red represents missing.

[0121] Among them, ignoring mainly appears in the custom comparison function. For example, the user's new interface does add return values ​​compared to the old interface, and the extra return results are normal. At this time, in order to prevent the comparison results from marking this place, options and functions that can be selected to ignore are provided. For example, in different environments, if there are indeed different return results, only the attribute names are compared and the corresponding values ​​are ignored. This method can also be used by default.

[0122] Custom output item: a specific display of the specific function selected in the custom item.

[0123] It should be noted that, combined with Figure 4 The test tool shown receives the interface message to be tested, and in response to the triggered sending operation, obtains the test result, compares the test result and compares the result.

[0124] In summary, by responding to trigger operations (such as "test environment selection operation" and "comparison function selection operation"), the test environment and comparison function to be used are determined. Simply by selecting the corresponding environment and function, the complex test process can be completed, thereby reducing human operation errors and time consumption, and significantly improving the efficiency of interface testing.

[0125] like Figure 5As shown, it is a schematic diagram of the architecture of a multi-environment interface testing device provided in an embodiment of the present application, and the interface testing device includes: a first determination unit 100, a second determination unit 200, a third determination unit 300, a first test unit 400, a second test unit 500 and a comparison unit 600.

[0126] The first determining unit 100 is configured to determine a test environment in response to a triggered test environment selection operation.

[0127] The second determining unit 200 is configured to determine a comparison test environment in response to a triggered comparison test environment selection operation.

[0128] The third determination unit 300 is used to determine the comparison function in response to the triggered comparison function selection operation; the comparison function includes a precise comparison function and a custom comparison function.

[0129] The first testing unit 400 is used to input the interface message to be tested into the testing environment for testing and obtain a test result when receiving the interface message to be tested.

[0130] The second testing unit 500 is used to input the interface message to be tested into the comparison test environment for testing to obtain the comparison test result.

[0131] The comparison unit 600 is used to compare the test result with the comparison test result according to the comparison function to obtain a comparison result.

[0132] The comparison unit 600 is specifically used for: when the comparison function is a precise comparison function, using the edit distance algorithm to calculate the test result and the comparison test result to obtain the edit distance between the test result and the comparison test result; judging whether the edit distance is less than the preset edit distance; if the edit distance is less than the preset edit distance, determining that the comparison result is that the test result and the comparison test result are similar; if the edit distance is not less than the preset edit distance, determining that the comparison result is that the test result and the comparison test result are not similar.

[0133] In summary, by responding to trigger operations (such as "test environment selection operation" and "comparison function selection operation"), the test environment and comparison function to be used are determined. Simply by selecting the corresponding environment and function, the complex test process can be completed, thereby reducing human operation errors and time consumption, and significantly improving the efficiency of interface testing.

[0134] Preferably, combined Figure 5 As shown in the figure, the interface testing device also includes: a display unit and a storage unit.

[0135] The display unit is used to display the information filling page in response to the triggered information filling operation.

[0136] The storage unit is used to store the basic information of the interface to be tested when the basic information of the interface to be tested inputted on the information filling page is received.

[0137] Preferably, combined Figure 5 According to the content shown, the interface testing device also includes: a fourth determining unit and a fifth determining unit.

[0138] The fourth determining unit determines that the comparison function is a precise comparison function in response to a triggered precise comparison function selection operation.

[0139] The fifth determining unit determines that the comparison function is a customized comparison function in response to the triggered customized function selection operation.

[0140] Preferably, combined Figure 5 According to the content shown, the interface testing device also includes: an acquisition unit, a first calculation unit, a second calculation unit and a result determination unit.

[0141] An acquisition unit is used to obtain a first timestamp of the interface message to be tested input into the test environment and a second timestamp of the test result in response to a triggered performance detection function selection operation, as well as a third timestamp of the interface message to be tested input into the comparison test environment and a fourth timestamp of the comparison test result.

[0142] The first calculation unit is used to calculate a first difference between the first timestamp and the second timestamp.

[0143] The second calculation unit is used to calculate a second difference between the third timestamp and the fourth timestamp.

[0144] The result determination unit is used to calculate the difference between the first difference and the second difference to obtain a time difference, and determine the time difference as a performance test result.

[0145] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0146] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0147] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A multi-environment interface testing method, characterized in that: include: In response to a triggered test environment selection operation, determining a test environment; In response to the triggered comparison test environment selection operation, determining a comparison test environment; In response to the triggered comparison function selection operation, determining a comparison function; the comparison function includes a precise comparison function and a custom comparison function; When receiving an input interface message to be tested, inputting the interface message to be tested into the test environment for testing to obtain a test result; Input the interface message to be tested into the comparison test environment for testing, and obtain the comparison test result; The test result and the comparison test result are compared according to the comparison function to obtain a comparison result.

2. The method according to claim 1, characterized in that The test environment selection operation in response to the triggering, before determining the test environment, further includes: In response to the triggered information filling operation, display the information filling page; When the basic information of the interface to be tested input on the information filling page is received, the basic information of the interface to be tested is stored.

3. The method according to claim 1, characterized in that The determining of the comparison function in response to the triggered comparison function selection operation includes: In response to the triggered precise comparison function selection operation, determining the comparison function as a precise comparison function; In response to the triggered custom function selection operation, the comparison function is determined to be a custom comparison function.

4. The method according to claim 1, characterized in that The step of comparing the test result with the comparison test result according to the comparison function to obtain a comparison result includes: When the comparison function is a precise comparison function, the test result and the comparison test result are calculated using an edit distance algorithm to obtain an edit distance between the test result and the comparison test result; Determining whether the edit distance is less than a preset edit distance; If the edit distance is less than the preset edit distance, determining that the comparison result is similar to the test result and the comparison test result; If the edit distance is not less than the preset edit distance, it is determined that the comparison result is that the test result and the comparison test result are not similar.

5. The method according to claim 1, characterized in that Also includes: In response to the triggered performance detection function selection operation, obtaining a first timestamp of the interface message to be tested being input into the test environment and a second timestamp of the test result, as well as a third timestamp of the interface message to be tested being input into the comparison test environment and a fourth timestamp of the comparison test result; Calculating a first difference between the first timestamp and the second timestamp; calculating a second difference between the third timestamp and the fourth timestamp; A difference between the first difference and the second difference is calculated to obtain a time difference, and the time difference is determined as a performance test result.

6. A multi-environment interface testing device, characterized in that: include: A first determining unit, configured to determine a test environment in response to a triggered test environment selection operation; A second determining unit, configured to determine a comparison test environment in response to a triggered comparison test environment selection operation; A third determining unit, configured to determine a comparison function in response to a triggered comparison function selection operation; the comparison function includes a precise comparison function and a custom comparison function; The first testing unit is used for, when receiving an input interface message to be tested, inputting the interface message to be tested into the testing environment for testing to obtain a test result; The second testing unit is used to input the interface message to be tested into the comparison test environment for testing to obtain a comparison test result; A comparison unit is used to compare the test result with the comparison test result according to the comparison function to obtain a comparison result.

7. The device according to claim 6, characterized in that Also includes: A display unit, used to display an information filling page in response to a triggered information filling operation; The storage unit is used to store the basic information of the interface to be tested when the basic information of the interface to be tested input on the information filling page is received.

8. The device according to claim 6, characterized in that Also includes: a fourth determining unit, in response to the triggered precise comparison function selection operation, determining the comparison function to be a precise comparison function; The fifth determining unit determines that the comparison function is a customized comparison function in response to the triggered customized function selection operation.

9. The device according to claim 6, characterized in that The comparison unit is specifically used for: When the comparison function is a precise comparison function, the test result and the comparison test result are calculated using an edit distance algorithm to obtain an edit distance between the test result and the comparison test result; Determining whether the edit distance is less than a preset edit distance; If the edit distance is less than the preset edit distance, determining that the comparison result is similar to the test result and the comparison test result; If the edit distance is not less than the preset edit distance, it is determined that the comparison result is that the test result and the comparison test result are not similar.

10. The device according to claim 6, characterized in that Also includes: an acquisition unit, configured to acquire, in response to a triggered performance detection function selection operation, a first timestamp of the interface message to be tested being input into the test environment and a second timestamp of the test result, as well as a third timestamp of the interface message to be tested being input into the comparison test environment and a fourth timestamp of the comparison test result; A first calculation unit, configured to calculate a first difference between the first timestamp and the second timestamp; A second calculation unit, configured to calculate a second difference between the third timestamp and the fourth timestamp; The result determination unit is used to calculate the difference between the first difference and the second difference to obtain a time difference, and determine the time difference as a performance test result.