Interface testing method, device, equipment and storage medium
By obtaining interface test process configuration requests and inheriting interface test standard process classes, and generating target interface test process classes, the problem that existing interface test code cannot be reused is solved and the efficiency of interface testing is improved.
Patent Information
- Application Number
- CN202111216112.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-19
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-10-19
AI Technical Summary
Existing interface tests develop test codes based on interfaces, which leads to the inability to reuse and reduces the efficiency of interface testing.
By obtaining interface test process configuration requests, finding interface test standard process classes, inheriting the created interface class, obtaining interface class configuration data, generating target interface test process classes, and repeatedly executing configuration requests until the user inputs the end signal, based on multiplexed code Conduct configuration development.
It realizes the generation of interface test process classes based on multiplexed code, which improves the efficiency of interface testing.
Smart Images

Figure CN113918461B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software testing technology, and in particular to an interface testing method, device, equipment and storage medium. Background Art
[0002] Interface testing is a test of the interfaces between system components. It is mainly used to detect the interaction points between external systems and internal subsystems. The focus of the test is to check the data exchange, transmission and control management process, as well as the mutual logical dependencies between systems. Existing interface testing develops test code based on the interface, which makes the code almost impossible to reuse and reduces the efficiency of interface testing. Summary of the invention
[0003] The main purpose of this application is to provide an interface testing method, device, equipment and storage medium, aiming to solve the technical problem that the interface testing in the prior art develops the test code based on the interface, which makes the code almost impossible to reuse and reduces the efficiency of the interface testing.
[0004] In order to achieve the above-mentioned invention object, the present application proposes an interface testing method, which comprises:
[0005] Obtain an interface test process configuration request, where the interface test process configuration request carries an interface type;
[0006] According to the interface type, searching for an interface test standard process class from the acquired interface test standard process class library to obtain a target interface test standard process class;
[0007] The created interface class is adopted to inherit the target interface test standard process class to obtain the interface class to be processed;
[0008] Acquire interface class configuration data according to the interface class to be processed, and obtain a target interface test process class;
[0009] Repeat the step of obtaining the interface test process configuration request until an interface test process configuration end signal input by the user is obtained;
[0010] Obtain a target test case table, perform interface testing according to the target test case table and each of the target interface test process classes, and obtain a target interface test result.
[0011] Furthermore, the step of adopting the created interface class to inherit the target interface test standard process class to obtain the interface class to be processed includes:
[0012] Create an interface class using the preset interface class creation rules to obtain the interface class to be analyzed;
[0013] The interface class to be analyzed is adopted to inherit all program statements of the target interface test standard process class to obtain the interface class to be processed.
[0014] Furthermore, the step of acquiring interface class configuration data according to the interface class to be processed to obtain a target interface test process class includes:
[0015] Display the interface class to be processed on the interface;
[0016] In the interface class to be processed displayed on the interface, obtain the interface class configuration data input by the user and obtain a single interface configuration end signal;
[0017] In response to the single interface configuration end signal, a process class is generated according to the interface class to be processed and the interface class configuration data displayed on the interface to obtain the target interface test process class.
[0018] Furthermore, after the step of obtaining the interface test process configuration request, the method further includes:
[0019] Get the interface test entry class configuration request;
[0020] Responding to the interface test entry class configuration request, obtaining the interface test entry standard class;
[0021] Display the interface test entry standard class on the interface;
[0022] In the interface test entry standard class displayed according to the interface, the interface test entry configuration data input by the user is obtained, wherein the interface test entry configuration data includes: the test case table storage address configuration result;
[0023] Generate an entry class according to the interface test entry standard class and the interface test entry configuration data displayed on the interface to obtain a target interface test entry class;
[0024] The step of obtaining the target test case table includes:
[0025] Obtain an interface test start request through the target interface test entry class;
[0026] In response to the interface test start request, a test case table is obtained from the storage space corresponding to the test case table storage address configuration result of the target interface test entry as the target test case table.
[0027] Further, the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain a target interface test result includes:
[0028] Obtaining a target interface test process class as the interface test process class to be tested;
[0029] Acquire each test case corresponding to the interface test process class to be tested from the target test case table to obtain a single interface test case set;
[0030] Execute the single interface test case set using the interface test process class to be tested to obtain the single interface test result corresponding to the interface test process class to be tested;
[0031] Repeat the step of acquiring the target interface test process class as the interface test process class to be tested until the acquisition of the target interface test process class is completed;
[0032] The target interface test result is determined according to each of the single interface test results.
[0033] Further, after the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result, the step further includes:
[0034] Get the regression test entry class configuration request;
[0035] In response to the regression test entry class configuration request, a regression test entry standard class is obtained as a regression test entry class to be processed;
[0036] Display the regression test entry class to be processed on the interface;
[0037] In the regression test entry class to be processed displayed on the interface, obtain the regression test entry configuration data input by the user;
[0038] Generate an entry class according to the regression test entry class to be processed and the regression test entry configuration data displayed on the interface to obtain a target regression test entry class;
[0039] After the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result, the method further includes:
[0040] Obtain a regression test start request through the target regression test entry class;
[0041] In response to the regression test start request, a regression test is performed according to the target interface test result, the target regression test entry class and each of the target interface test process classes to obtain a regression test result.
[0042] Furthermore, the regression test entry configuration data includes: case set selection configuration result, regression database identification configuration result, whether full regression configuration result and whether stored procedure call configuration result;
[0043] After the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result, the method further includes:
[0044] Update the interface test case set according to the interface identifiers corresponding to the target interface test process classes, the target test case table and the target interface test results;
[0045] The step of performing regression testing according to the target interface test result, the target regression test entry class and each of the target interface test process classes to obtain the regression test result comprises:
[0046] According to the target interface test result, the case set selection configuration result of the target regression test entry class, the regression database identification configuration result and the full regression configuration result, a test case is obtained from the interface test case set as a regression test case set;
[0047] Regression testing is performed according to the configuration results of whether to call stored procedures of each of the target interface test process classes, the regression test case set and the target regression test entry class to obtain the regression test result.
[0048] The present application also proposes an interface testing device, the device comprising:
[0049] A request acquisition module, used to acquire an interface test process configuration request, wherein the interface test process configuration request carries an interface type;
[0050] A target interface test standard process class determination module is used to search for an interface test standard process class from the acquired interface test standard process class library according to the interface type to obtain a target interface test standard process class;
[0051] The interface class determination module to be processed is used to adopt the created interface class to inherit the target interface test standard process class to obtain the interface class to be processed;
[0052] A target interface test process class determination module is used to obtain interface class configuration data according to the interface class to be processed to obtain a target interface test process class;
[0053] A loop control module, used for repeatedly executing the step of obtaining the interface test process configuration request until an interface test process configuration end signal input by the user is obtained;
[0054] The target interface test result determination module is used to obtain a target test case table, perform interface testing according to the target test case table and each of the target interface test process classes, and obtain a target interface test result.
[0055] The present application also proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0056] The present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0057] The interface testing method, apparatus, equipment and storage medium of the present application, wherein the method first searches for the interface testing standard process class from the obtained interface testing standard process class library according to the interface type to obtain the target interface testing standard process class, and then inherits the target interface testing standard process class by adopting the created interface class to obtain the interface class to be processed, obtains the interface class configuration data according to the interface class to be processed to obtain the target interface testing process class, and then repeatedly executes the step of obtaining the interface testing process configuration request until the interface testing process configuration end signal input by the user is obtained, and finally performs interface testing according to the target test case table and each of the target interface testing process classes to obtain the target interface test result, thereby realizing the generation of the target interface testing process class by obtaining the interface class configuration data based on the interface testing standard process class, thereby realizing configuration development based on reused code, improving the efficiency of generating the target interface testing process class, and improving the efficiency of interface testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 A flowchart of an interface testing method according to an embodiment of the present application;
[0059] Figure 2 This is a schematic block diagram of the structure of an interface testing device according to an embodiment of the present application;
[0060] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.
[0061] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0063] Reference Figure 1 In an embodiment of the present application, an interface testing method is provided, the method comprising:
[0064] S1: Obtain an interface test process configuration request, where the interface test process configuration request carries an interface type;
[0065] S2: according to the interface type, searching for an interface test standard process class from the acquired interface test standard process class library to obtain a target interface test standard process class;
[0066] S3: Using the created interface class, inheriting the target interface test standard process class to obtain the interface class to be processed;
[0067] S4: Acquire interface class configuration data according to the interface class to be processed to obtain a target interface test process class;
[0068] S5: Repeat the step of obtaining the interface test process configuration request until an interface test process configuration end signal input by the user is obtained;
[0069] S6: Obtain a target test case table, perform interface testing according to the target test case table and each of the target interface test process classes, and obtain a target interface test result.
[0070] This embodiment first searches for the interface test standard process class from the acquired interface test standard process class library according to the interface type to obtain the target interface test standard process class; secondly, adopts the created interface class to inherit the target interface test standard process class to obtain the interface class to be processed; obtains the interface class configuration data according to the interface class to be processed to obtain the target interface test process class; then repeatedly executes the step of obtaining the interface test process configuration request until the interface test process configuration end signal input by the user is obtained; finally, performs interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result; and realizes the generation of the target interface test process class by obtaining the interface class configuration data based on the interface test standard process class, thereby realizing configuration development based on reused code, improving the efficiency of generating the target interface test process class, and improving the efficiency of interface testing.
[0071] For S1, obtain the interface test process configuration request input by the user.
[0072] The interface test process configuration request is a configuration request for the interface test process class.
[0073] The interface type includes but is not limited to: a first interface type and a second interface type.
[0074] The steps of the interface of the first interface type include: obtaining input parameters, calling a Java (object-oriented programming language) interface, first format conversion, calling a stored procedure, second format conversion, and comparing output parameters with expected results.
[0075] The steps of the interface of the second interface type include: obtaining input parameters, calling the Java interface, first format conversion, calling the stored procedure, second format conversion, comparing the output parameters with the expected results, and comparing the table data.
[0076] Getting input parameters is to get the parameters required for calling the interface. Calling the Java interface is to call the Java type interface to perform logical execution and obtain the actual result in Java format. The first format conversion is to convert the parameters required for calling the interface from Java format to Oracle (relational database management system) format. Calling a stored procedure is to call a stored procedure (that is, Oracle's interface) to obtain the expected result in Oracle format from the database. The second format conversion is to convert the expected result obtained by calling the stored procedure from Oracle format to Java format. Comparing the expected results of the output is to compare the actual results in Java format with the expected results in Java format. Table data comparison is to compare the official data table and the backup data table, wherein first, the Oracle interface is called to store the expected result in the official data table, and then the official data table is backed up in the backup data table. After the backup is completed, the official data table is rolled back to the Oracle interface before the expected result is stored in the official data table. Then, when the Java type interface is called for logical execution, the official data table is modified, and the modified official data table and the backup data table are compared. When they are consistent, the result of the table data comparison is determined to be consistent, otherwise, the result of the table data comparison is determined to be inconsistent.
[0077] It is understandable that different interfaces may have different specific implementations of the same step. For example, in the step "obtaining input parameters", different interfaces may obtain input parameters in different formats. For another example, in the step "calling a Java interface", different interfaces may call different interfaces.
[0078] For S2, the interface testing standard process class library includes: a mapping relationship table and an interface testing standard process class set. The mapping relationship table includes: a type identifier and a process class identifier. The interface testing standard process class set includes one or more interface testing standard process classes, wherein each interface testing standard process class carries a process class identifier. The process class identifier can be data that uniquely identifies an interface testing standard process class, such as a process class name and a process class ID. Each interface testing standard process class corresponds to an interface.
[0079] Because the processes have commonalities, a test process has been established in the interface test standard process class, and the test process includes multiple steps. Because the steps have characteristics, only empty methods are written in the steps of the established test process for the step characteristics, where an empty method only constrains the parameter type without making specific implementations. In the steps of the established test process, the commonalities of the steps are written in non-empty methods.
[0080] Among them, the interface testing standard process class library can be obtained from a database or from a third-party application system; the interface type is searched for in each type identifier in the mapping relationship table in the interface testing standard process class library, and the process class identifier corresponding to the type identifier found in the mapping relationship table is used as the target process class identifier; the interface testing standard process class corresponding to the target process class identifier in the interface testing standard process class set in the interface testing standard process class library is used as the target interface testing standard process class.
[0081] For S3, the interface class is created using the preset interface class creation rules, and then the created interface class is used to inherit all the program statements of the target interface test standard process class, and the interface class that inherits all the program statements of the target interface test standard process class is used as the interface class to be processed. Thus, the interface class to be processed can achieve the same function as the target interface test standard process class.
[0082] For S4, the interface class configuration data input by the user is obtained according to the interface class to be processed, and the interface class to be processed with the interface class configuration data completed is used as the target interface test process class.
[0083] The interface class configuration data is the result of configuring the parameters of the interface class to be processed.
[0084] For S5, repeat steps S1 to S5 until the interface test process configuration end signal input by the user is obtained. When the interface test process configuration end signal is obtained, it means that the generation of the target interface test process class is completed. By repeating steps S1 to S5, the generation of the target interface test process class of the batch interface is completed.
[0085] The interface test process configuration end signal may be sent by a user or by a third-party application system.
[0086] For S6, a target test case table is obtained from a database, and each of the target interface test process classes is used to search for test cases from the target test case table to perform interface testing, and the result obtained from the interface testing is used as the target interface test result.
[0087] Optionally, the target test case table is stored in a table, for example, in EXCEL (Microsoft Office Excel); the target test case table includes multiple worksheets, each worksheet stores all test cases of an interface, and each row of data in each worksheet corresponds to one test case.
[0088] The test case includes, but is not limited to: a test case identifier and a test step, wherein the test step is used to store input parameters. The test case identifier can be data that uniquely identifies a test case, such as a test case name and a test case ID.
[0089] In one embodiment, the step of adopting the created interface class to inherit the target interface test standard process class to obtain the interface class to be processed includes:
[0090] S31: Create an interface class using a preset interface class creation rule to obtain an interface class to be analyzed;
[0091] S32: Using the interface class to be analyzed, inheriting all program statements of the target interface test standard process class, to obtain the interface class to be processed.
[0092] This embodiment uses the created interface class to inherit all program statements of the target interface test standard process class, thereby completing the replication of the target interface test standard process class, realizing code reuse, and providing a basis for obtaining interface class configuration data based on the interface class to be processed.
[0093] For S31, a preset interface class creation rule is used to create an interface class, and the created interface class is used as the interface class to be analyzed.
[0094] For S32, the interface class to be analyzed is adopted to inherit all program statements of the target interface test standard process class, and the interface class to be analyzed that inherits all program statements of the target interface test standard process class is used as the interface class to be processed.
[0095] In one embodiment, the step of acquiring interface class configuration data according to the interface class to be processed to obtain the target interface test process class includes:
[0096] S41: Displaying the interface class to be processed on an interface;
[0097] S42: acquiring the interface class configuration data input by the user from the interface class to be processed displayed on the interface, and acquiring a single interface configuration end signal;
[0098] S43: In response to the single interface configuration end signal, a process class is generated according to the interface class to be processed and the interface class configuration data displayed on the interface to obtain the target interface test process class.
[0099] This embodiment realizes obtaining the interface class configuration data based on the interface class to be processed displayed on the interface, thereby improving the efficiency of process generation and improving the efficiency of interface testing.
[0100] For S41, a preset interface display rule is used to display the interface class to be processed on the interface.
[0101] For S42, in the interface class to be processed displayed on the interface, obtain the user's configuration for each empty method, and use the configured data as the interface class configuration data; it can be a single interface configuration end signal input by the user, or it can be a single interface configuration end signal actively triggered by the program file implementing this application according to preset conditions. For example, when all parameters are configured, a single interface configuration end signal is actively triggered.
[0102] The single interface configuration end signal is a signal for completing the input of the interface class configuration data.
[0103] For S43, when the single interface configuration end signal is obtained, a process class is generated according to the interface class to be processed and the interface class configuration data displayed on the interface, and the generated process class is used as the target interface test process class. Thus, a process class containing personalized configuration is obtained, and configuration development based on reused code is realized.
[0104] In one embodiment, after the step of obtaining the interface test process configuration request, the method further includes:
[0105] S71: Obtain interface test entry class configuration request;
[0106] S72: Respond to the interface test entry class configuration request and obtain the interface test entry standard class;
[0107] S73: Displaying the interface test entry standard class on the interface;
[0108] S74: acquiring interface test entry configuration data input by a user in the interface test entry standard class displayed on the interface, wherein the interface test entry configuration data includes: a test case table storage address configuration result;
[0109] S75: Generate an entry class according to the interface test entry standard class and the interface test entry configuration data displayed on the interface to obtain a target interface test entry class;
[0110] The step of obtaining the target test case table includes:
[0111] S611: Obtain an interface test start request through the target interface test entry class;
[0112] S612: In response to the interface test start request, a test case table is obtained from the storage space corresponding to the test case table storage address configuration result of the target interface test entry as the target test case table.
[0113] This embodiment configures the entry class through the interface test entry standard class, thereby realizing configuration development based on reused code; and through a target interface test entry class, each of the target interface test process classes is called to perform interface testing, without the need to manually switch the target interface test process class, thereby reducing user operations and further improving the efficiency of interface testing.
[0114] For S71, an interface test entry class configuration request input by a user may be obtained.
[0115] The interface test entry class configuration request is a request to configure the interface test entry class.
[0116] For S72, when the interface test entry class configuration request is obtained, the interface test entry standard class can be obtained from the database, or the interface test entry standard class can be obtained from the database.
[0117] In the interface test entry standard class, in the steps of the test process of the component, only empty methods are written for the step characteristics, where the empty method only constrains the parameter type without specific implementation; in the steps of the test process of the component, the commonalities of the steps are written in non-empty methods.
[0118] For S73, the interface test entry standard class is displayed on the interface using a preset interface display rule.
[0119] For S74, in the interface test entry standard class displayed according to the interface, obtain the user's configuration for the empty method, and use the configured data as the interface test entry configuration data.
[0120] The test case table storage address configuration result is to use the test case table storage address as the value corresponding to the storage address keyword.
[0121] For S75, an entry class is generated according to the interface test entry standard class and the interface test entry configuration data displayed on the interface, and the generated entry class is used as the target interface test entry class. Thus, an entry class containing personalized configuration is obtained, and configuration development based on reused code is realized.
[0122] For S611, the interface test start request input by the user may be obtained through the target interface test entry class, and the interface test start request sent by the third-party application system may also be obtained through the target interface test entry class.
[0123] Interface test start request, that is, a request to start interface testing.
[0124] For S612, when the interface test start request is obtained, a test case table is obtained from the storage space corresponding to the test case table storage address configuration result of the target interface test entry, and the obtained test case table is used as the target test case table.
[0125] In one embodiment, the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result includes:
[0126] S613: Obtain one of the target interface test process classes as the interface test process class to be tested;
[0127] S614: Acquire each test case corresponding to the interface test process class to be tested from the target test case table to obtain a single interface test case set;
[0128] S615: Execute the single interface test case set using the interface test process class to be tested to obtain a single interface test result corresponding to the interface test process class to be tested;
[0129] S616: Repeat the step of acquiring the target interface test process class as the interface test process class to be tested until the acquisition of the target interface test process class is completed;
[0130] S617: Determine the target interface test result according to each of the single interface test results.
[0131] This embodiment improves the efficiency of interface testing by performing interface testing according to the target test case table and each of the target interface test process classes.
[0132] For S613, one of the target interface test process classes is obtained in turn as the interface test process class to be tested.
[0133] For S614, each test case corresponding to the interface test process class to be tested is obtained from the target test case table, and each obtained test case is used as a single interface test case set.
[0134] For S615, the interface test process class to be tested is used to execute each test case in the single interface test case set, and each test result obtained by the execution is used as the single interface test result corresponding to the interface test process class to be tested.
[0135] For S616, repeat step S613 to step S616 until the acquisition of the target interface test process class is completed. When the acquisition of the target interface test process class is completed, it means that the execution of each target interface test process class is completed.
[0136] For S617, each of the single interface test results is used as the target interface test result.
[0137] In one embodiment, after the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result, the step further includes:
[0138] S81: Obtaining regression test entry class configuration request;
[0139] S82: Responding to the regression test entry class configuration request, obtaining a regression test entry standard class as a regression test entry class to be processed;
[0140] S83: Displaying the regression test entry class to be processed on an interface;
[0141] S84: Obtaining the regression test entry configuration data input by the user in the regression test entry class to be processed displayed on the interface;
[0142] S85: Generate an entry class according to the regression test entry class to be processed and the regression test entry configuration data displayed on the interface to obtain a target regression test entry class;
[0143] After the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result, the method further includes:
[0144] S621: Obtain a regression test start request through the target regression test entry class;
[0145] S622: Respond to the regression test start request, perform regression testing according to the target interface test result, the target regression test entry class and each of the target interface test process classes, and obtain a regression test result.
[0146] This embodiment implements the configuration of the development target regression test entry class based on the regression test entry standard class, and realizes configuration development based on reused code; and a regression test start request is obtained through a regression test entry class to perform regression testing, without the need to manually switch the target interface test process class, thereby reducing user operations and further improving the efficiency of interface testing.
[0147] For S81, a regression test entry class configuration request input by a user is obtained.
[0148] The regression test entry class configuration request is a request to configure the regression test entry class.
[0149] For S82, when the regression test entry class configuration request is obtained, the regression test entry standard class can be obtained from the database or from a third-party application system, and the obtained regression test entry standard class is used as the regression test entry class to be processed.
[0150] In the regression test entry standard class, in the steps of the test process of the assembly, only empty methods are written for the step characteristics, where the empty method only constrains the parameter type without specific implementation; in the steps of the test process of the assembly, the commonalities of the steps are written in non-empty methods.
[0151] For S83, a preset interface display rule is used to display the regression test entry class to be processed on an interface.
[0152] For S84, in the regression test entry class to be processed displayed according to the interface, the user's configuration for the empty method is obtained, and the configured data is used as the regression test entry configuration data.
[0153] The regression test entry configuration data includes: case set selection configuration result and regression database identification configuration result. The case set selection configuration result is the configuration result of the SQL (Structured Query Language) for selecting the case set. The regression database identification configuration result is the configuration result of the identification of the database that needs to be regressed. This breaks away from the traditional regression method based on the interface dimension, realizes the database dimension, and combines the database query SQL to select the test cases that need to be regressed more quickly and flexibly, thereby improving the efficiency of regression testing.
[0154] For S85, an entry class is generated according to the regression test entry class to be processed and the regression test entry configuration data displayed on the interface, and the generated entry class is used as the target regression test entry class. Thus, an entry class containing personalized configuration is obtained, and configuration development based on reused code is realized.
[0155] For S621, the regression test start request input by the user may be obtained through the target regression test entry class, and the regression test start request sent by the third-party application system may also be obtained through the target regression test entry class.
[0156] Regression test start request, that is, a request to start interface regression testing.
[0157] For S622, when the regression test start request is obtained, the test case is obtained according to the target interface test result and the regression test entry configuration data of the target regression test entry class, and each obtained test case is executed through each target interface test process class to perform regression testing, and the result obtained from the regression test is used as the regression test result.
[0158] In one embodiment, the above regression test entry configuration data includes: case set selection configuration result, regression database identification configuration result, whether full regression configuration result and whether stored procedure call configuration result;
[0159] After the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result, the method further includes:
[0160] S631: updating the interface test case set according to the interface identifiers corresponding to the target interface test process classes, the target test case table and the target interface test results;
[0161] The step of performing regression testing according to the target interface test result, the target regression test entry class and each of the target interface test process classes to obtain the regression test result comprises:
[0162] S6221: According to the target interface test result, the case set selection configuration result of the target regression test entry class, the regression database identification configuration result and the full regression configuration result, obtain a test case from the interface test case set as a regression test case set;
[0163] S6222: Perform regression testing according to the configuration results of whether to call stored procedures of each of the target interface test process classes, the regression test case set, and the target regression test entry class to obtain the regression test results.
[0164] This embodiment first updates the interface test case set according to the interface identifiers corresponding to each of the target interface test process classes, the target test case table and the target interface test results, and then performs regression testing according to the interface test case set, the target interface test results, the target regression test entry class and each of the target interface test process classes in response to the regression test start request. Since the regression test entry configuration data includes whether the full regression configuration result is and whether the stored procedure configuration result is called, the efficiency of the regression test is improved.
[0165] Because the expected result of the test case requires the step of "calling a stored procedure", it is necessary in the interface testing stage. However, in the regression testing stage, because the expected result of the test case has been saved, there is no need to repeat the step of "calling a stored procedure" in the regression testing stage. It is understandable that some interfaces must also execute the step of "calling a stored procedure" in the regression testing stage. For example, the expected results of the Java interface related to time are different at different times, so the step of "calling a stored procedure" is also required in the regression test. Therefore, it is necessary to determine whether to call the stored procedure configuration result. There are two values for whether to configure the full regression result, one is yes and the other is no.
[0166] Because a Java interface corresponds to multiple test cases, in order to improve the efficiency of regression testing, during regression testing, only the test cases that are different from the last test can be regressed, so it is necessary to configure whether to perform full regression configuration results. There are two values for the full regression configuration result, one is Y and the other is N. When the full regression configuration result is Y, it is determined that all test cases corresponding to the Java interface need to be regressed. When the full regression configuration result is N, regression testing is performed on the failed test cases corresponding to the Java interface.
[0167] For S631, the interface identifier corresponding to each of the target interface test process classes, the test case corresponding to the interface identifier in the target test case table, and the single interface test result corresponding to the interface identifier in the target interface test result are used as associated data, and the associated data is updated to the interface test case set.
[0168] For S6221, determine the interface identifiers that failed the test from the target interface test results according to the regression database identifier configuration result, and use the determined interface identifiers as the interface identifier set to be regressed; when the full regression configuration result is a full regression, select the configuration result according to the case set of the target regression test entry class, and obtain all test cases corresponding to the interface identifier set to be regressed from the interface test case set as the regression test case set; when the full regression configuration result is a non-full regression, select the configuration result according to the case set of the target regression test entry class, and obtain each test case whose test result corresponding to the interface identifier set to be regressed is a failed test from the interface test case set as the regression test case set.
[0169] That is, when the full regression configuration result is full regression, all test cases of the interface need to be regressed. When the full regression configuration result is non-full regression, each test case of the interface with a failed test result needs to be regressed.
[0170] The step of determining the interface identifiers that failed the test from the target interface test results according to the regression database identifier configuration result includes: obtaining all interface test results corresponding to the regression database identifier configuration result from the target interface test results as the interface test result set to be screened; and obtaining the interface identifiers that failed the test from the interface test result set to be screened. Thus, regression testing is performed with the database as the dimension.
[0171] For S6222, the regression test case set is executed through each target interface test process class to perform regression testing. When performing regression testing, whether each interface executes the calling stored procedure is selected according to the configuration result of whether to call the stored procedure, and the result obtained by the regression test is used as the regression test result.
[0172] Reference Figure 2 , the present application also proposes an interface testing device, the device comprising:
[0173] A request acquisition module 100 is used to acquire an interface test process configuration request, wherein the interface test process configuration request carries an interface type;
[0174] The target interface test standard process class determination module 200 is used to search for the interface test standard process class from the acquired interface test standard process class library according to the interface type, and obtain the target interface test standard process class;
[0175] The interface class determination module 300 to be processed is used to inherit the target interface test standard process class by using the created interface class to obtain the interface class to be processed;
[0176] A target interface test process class determination module 400 is used to obtain interface class configuration data according to the interface class to be processed to obtain a target interface test process class;
[0177] A loop control module 500 is used to repeatedly execute the step of obtaining the interface test process configuration request until an interface test process configuration end signal input by the user is obtained;
[0178] The target interface test result determination module 600 is used to obtain a target test case table, perform interface testing according to the target test case table and each of the target interface test process classes, and obtain a target interface test result.
[0179] This embodiment first searches for the interface test standard process class from the acquired interface test standard process class library according to the interface type to obtain the target interface test standard process class; secondly, adopts the created interface class to inherit the target interface test standard process class to obtain the interface class to be processed; obtains the interface class configuration data according to the interface class to be processed to obtain the target interface test process class; then repeatedly executes the step of obtaining the interface test process configuration request until the interface test process configuration end signal input by the user is obtained; finally, performs interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result; and realizes the generation of the target interface test process class by obtaining the interface class configuration data based on the interface test standard process class, thereby realizing configuration development based on reused code, improving the efficiency of generating the target interface test process class, and improving the efficiency of interface testing.
[0180] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as interface testing methods. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an interface testing method is implemented. The interface testing method comprises: obtaining an interface testing process configuration request, wherein the interface testing process configuration request carries an interface type; searching for an interface testing standard process class from an obtained interface testing standard process class library according to the interface type to obtain a target interface testing standard process class; adopting a created interface class to inherit the target interface testing standard process class to obtain an interface class to be processed; obtaining interface class configuration data according to the interface class to be processed to obtain a target interface testing process class; repeatedly executing the step of obtaining the interface testing process configuration request until an interface testing process configuration end signal input by a user is obtained; obtaining a target test case table, performing an interface test according to the target test case table and each of the target interface testing process classes to obtain a target interface test result.
[0181] This embodiment first searches for the interface test standard process class from the acquired interface test standard process class library according to the interface type to obtain the target interface test standard process class; secondly, adopts the created interface class to inherit the target interface test standard process class to obtain the interface class to be processed; obtains the interface class configuration data according to the interface class to be processed to obtain the target interface test process class; then repeatedly executes the step of obtaining the interface test process configuration request until the interface test process configuration end signal input by the user is obtained; finally, performs interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result; and realizes the generation of the target interface test process class by obtaining the interface class configuration data based on the interface test standard process class, thereby realizing configuration development based on reused code, improving the efficiency of generating the target interface test process class, and improving the efficiency of interface testing.
[0182] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, an interface testing method is implemented, including the following steps: obtaining an interface testing process configuration request, wherein the interface testing process configuration request carries an interface type; according to the interface type, searching for an interface testing standard process class from an obtained interface testing standard process class library to obtain a target interface testing standard process class; using the created interface class to inherit the target interface testing standard process class to obtain an interface class to be processed; obtaining interface class configuration data according to the interface class to be processed to obtain a target interface testing process class; repeatedly executing the step of obtaining the interface testing process configuration request until an interface testing process configuration end signal input by a user is obtained; obtaining a target test case table, performing an interface test according to the target test case table and each of the target interface testing process classes to obtain a target interface test result.
[0183] The interface testing method executed above first searches for the interface testing standard process class from the acquired interface testing standard process class library according to the interface type to obtain the target interface testing standard process class; secondly, adopts the created interface class to inherit the target interface testing standard process class to obtain the interface class to be processed; obtains the interface class configuration data according to the interface class to be processed to obtain the target interface testing process class; then repeatedly executes the step of obtaining the interface testing process configuration request until the interface testing process configuration end signal input by the user is obtained; finally, performs interface testing according to the target test case table and each of the target interface testing process classes to obtain the target interface testing result; and realizes the generation of the target interface testing process class by obtaining the interface class configuration data based on the interface testing standard process class, thereby realizing configuration development based on reused code, improving the efficiency of generating the target interface testing process class, and improving the efficiency of interface testing.
[0184] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0185] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0186] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An interface testing method, It is characterized in that The method comprises: Obtain an interface test process configuration request, where the interface test process configuration request carries an interface type; According to the interface type, searching for an interface test standard process class from the acquired interface test standard process class library to obtain a target interface test standard process class; The created interface class is adopted to inherit the target interface test standard process class to obtain the interface class to be processed; Acquire interface class configuration data according to the interface class to be processed, and obtain a target interface test process class; Repeat the step of obtaining the interface test process configuration request until an interface test process configuration end signal input by the user is obtained; Obtain a target test case table, perform interface testing according to the target test case table and each of the target interface test process classes, and obtain a target interface test result; After the step of obtaining the interface test process configuration request, the method further includes: Get the interface test entry class configuration request; Responding to the interface test entry class configuration request, obtaining the interface test entry standard class; Display the interface test entry standard class on the interface; In the interface test entry standard class displayed according to the interface, the interface test entry configuration data input by the user is obtained, wherein the interface test entry configuration data includes: the test case table storage address configuration result; Generate an entry class according to the interface test entry standard class and the interface test entry configuration data displayed on the interface to obtain a target interface test entry class; The step of obtaining the target test case table includes: Obtain an interface test start request through the target interface test entry class; In response to the interface test start request, obtaining a test case table from a storage space corresponding to the test case table storage address configuration result of the target interface test entry as the target test case table; The step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain a target interface test result comprises: Obtaining a target interface test process class as the interface test process class to be tested; Acquire each test case corresponding to the interface test process class to be tested from the target test case table to obtain a single interface test case set; Execute the single interface test case set using the interface test process class to be tested to obtain the single interface test result corresponding to the interface test process class to be tested; Repeat the step of acquiring the target interface test process class as the interface test process class to be tested until the acquisition of the target interface test process class is completed; Determine the target interface test result according to each of the single interface test results; After the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result, the method further includes: Get the regression test entry class configuration request; In response to the regression test entry class configuration request, a regression test entry standard class is obtained as a regression test entry class to be processed; Display the regression test entry class to be processed on the interface; In the regression test entry class to be processed displayed on the interface, obtain the regression test entry configuration data input by the user; Generate an entry class according to the regression test entry class to be processed and the regression test entry configuration data displayed on the interface to obtain a target regression test entry class; After the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result, the method further includes: Obtain a regression test start request through the target regression test entry class; In response to the regression test start request, a regression test is performed according to the target interface test result, the target regression test entry class and each of the target interface test process classes to obtain a regression test result; The regression test entry configuration data includes: case set selection configuration result, regression database identification configuration result, whether full regression configuration result and whether stored procedure call configuration result; After the step of performing interface testing according to the target test case table and each of the target interface test process classes to obtain the target interface test result, the method further includes: Update the interface test case set according to the interface identifiers corresponding to the target interface test process classes, the target test case table and the target interface test results; The step of performing regression testing according to the target interface test result, the target regression test entry class and each of the target interface test process classes to obtain the regression test result comprises: According to the target interface test result, the case set selection configuration result of the target regression test entry class, the regression database identification configuration result and the full regression configuration result, obtain test cases from the interface test case set as the regression test case set; Regression testing is performed according to the configuration results of whether to call stored procedures of each of the target interface test process classes, the regression test case set and the target regression test entry class to obtain the regression test result.
2. The interface testing method according to claim 1, It is characterized in that The step of adopting the created interface class to inherit the target interface test standard process class to obtain the interface class to be processed includes: Create an interface class using the preset interface class creation rules to obtain the interface class to be analyzed; The interface class to be analyzed is adopted to inherit all program statements of the target interface test standard process class to obtain the interface class to be processed.
3. The interface testing method according to claim 1, It is characterized in that The step of acquiring interface class configuration data according to the interface class to be processed to obtain a target interface test process class includes: Display the interface class to be processed on the interface; In the interface class to be processed displayed on the interface, obtain the interface class configuration data input by the user and obtain a single interface configuration end signal; In response to the single interface configuration end signal, a process class is generated according to the interface class to be processed and the interface class configuration data displayed on the interface to obtain the target interface test process class.
4. An interface testing device, used to implement the method according to any one of claims 1 to 3, It is characterized in that The device comprises: A request acquisition module, used to acquire an interface test process configuration request, wherein the interface test process configuration request carries an interface type; A target interface test standard process class determination module is used to search for an interface test standard process class from the acquired interface test standard process class library according to the interface type to obtain a target interface test standard process class; The interface class determination module to be processed is used to adopt the created interface class to inherit the target interface test standard process class to obtain the interface class to be processed; A target interface test process class determination module is used to obtain interface class configuration data according to the interface class to be processed to obtain a target interface test process class; A loop control module, used for repeatedly executing the step of obtaining the interface test process configuration request until an interface test process configuration end signal input by the user is obtained; The target interface test result determination module is used to obtain a target test case table, perform interface testing according to the target test case table and each of the target interface test process classes, and obtain a target interface test result.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Automatic testing method and device
CN103049374A
Software testing method and system
CN106776307A
Interface testing method and equipment
CN109491894A
Test case generation method and device, computer equipment and storage medium
CN112527630A
Automatic identification of software test cases
US20160085663A1
