CN113918461A - Interface test method, device, equipment and storage medium - Google Patents

Interface test method, device, equipment and storage medium Download PDF

Info

Publication number
CN113918461A
CN113918461A CN202111216112.7A CN202111216112A CN113918461A CN 113918461 A CN113918461 A CN 113918461A CN 202111216112 A CN202111216112 A CN 202111216112A CN 113918461 A CN113918461 A CN 113918461A
Authority
CN
China
Prior art keywords
interface
class
test
target
interface test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111216112.7A
Other languages
Chinese (zh)
Inventor
夏文静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202111216112.7A priority Critical patent/CN113918461A/en
Publication of CN113918461A publication Critical patent/CN113918461A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to the technical field of software testing, and discloses an interface testing method, device, equipment and storage medium, wherein the method comprises the following steps: according to the interface type, searching an interface test standard flow class from the obtained interface test standard flow class library to obtain a target interface test standard flow class; inheriting a target interface test standard process class by adopting the created interface class to obtain an interface class to be processed; acquiring interface type configuration data according to the interface type to be processed to obtain a target interface test flow type; repeatedly executing the step of obtaining the interface test flow configuration request until obtaining an interface test flow configuration finishing signal input by a user; and performing interface test according to the target test case list and each target interface test flow class to obtain a target interface test result. The method and the device realize configuration development based on the multiplexed codes, improve the generation efficiency of the target interface test flow class and improve the efficiency of interface test.

Description

Interface test method, device, equipment and storage medium
Technical Field
The present application relates to the field of software testing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for testing an interface.
Background
The interface test is a test for testing interfaces among components of a system, and is mainly used for detecting interaction points between an external system and the system and between subsystems inside the system. The existing interface test takes an interface as a dimension to develop a test code, so that the code can hardly be reused, and the efficiency of the interface test is reduced.
Disclosure of Invention
The present application mainly aims to provide an interface testing method, apparatus, device and storage medium, and aims to solve the technical problems that in the interface testing of the prior art, the interface is used as a dimension to develop a testing code, so that the code can hardly be reused, and the efficiency of the interface testing is reduced.
In order to achieve the above object, the present application provides an interface testing method, including:
acquiring an interface test flow configuration request, wherein the interface test flow configuration request carries an interface type;
searching an interface test standard process class from the obtained interface test standard process class library according to the interface type to obtain a target interface test standard process class;
inheriting the target interface test standard process class by adopting the created interface class to obtain an interface class to be processed;
acquiring interface class configuration data according to the interface class to be processed to obtain a target interface test flow class;
repeatedly executing the step of obtaining the interface test flow configuration request until obtaining an interface test flow configuration finishing signal input by a user;
and acquiring a target test case table, and performing interface test according to the target test case table and each target interface test flow class to obtain a target interface test result.
Further, the step of inheriting the target interface test standard process class by using the created interface class to obtain the interface class to be processed includes:
adopting a preset interface class creation rule to create an interface class to obtain an interface class to be analyzed;
and adopting the interface class to be analyzed to inherit all program statements of the target interface test standard process class to obtain the interface class to be processed.
Further, the step of obtaining interface class configuration data according to the interface class to be processed to obtain a target interface test flow class includes:
performing interface display on the interface class to be processed;
acquiring the interface class configuration data input by a user and acquiring a single interface configuration ending signal in the interface class to be processed displayed on the interface;
and responding to the single interface configuration ending signal, and generating a flow type according to the interface type to be processed displayed by the interface and the interface type configuration data to obtain the target interface test flow type.
Further, after the step of obtaining the interface test flow configuration request, the method further includes:
acquiring an interface test entry class configuration request;
responding the interface test entry class configuration request to acquire an interface test entry standard class;
performing interface display on the interface test entry standard class;
in the interface test entry standard class displayed according to the interface, obtaining interface test entry configuration data input by a user, wherein the interface test entry configuration data comprises: storing address configuration results in the test case table;
generating 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 comprises the following steps:
acquiring an interface test starting request through the target interface test entry class;
and responding to the interface test starting request, and acquiring a test case table as the target test case table from a storage space corresponding to the test case table storage address configuration result of the target interface test entry.
Further, the step of performing an interface test according to the target test case table and each target interface test flow class to obtain a target interface test result includes:
acquiring the target interface test flow class as an interface test flow class to be tested;
obtaining each test case corresponding to the interface test flow to be tested from the target test case table to obtain a single-interface test case set;
executing the single-interface test case set by adopting the interface test flow class to be tested to obtain a single-interface test result corresponding to the interface test flow class to be tested;
repeatedly executing the step of obtaining one target interface test flow class as an interface test flow class to be tested until the target interface test flow class is obtained;
and determining the target interface test result according to each single interface test result.
Further, after the step of performing an interface test according to the target test case table and each target interface test flow class to obtain a target interface test result, the method further includes:
acquiring a regression test entry class configuration request;
responding to the regression testing entry class configuration request, and acquiring a regression testing entry standard class as a regression testing entry class to be processed;
performing interface display on the regression testing entry class to be processed;
acquiring regression testing entry configuration data input by a user in the regression testing entry class to be processed displayed on the interface;
generating an entry class according to the regression testing entry class to be processed and the regression testing entry configuration data displayed on the interface to obtain a target regression testing entry class;
after the step of performing the interface test according to the target test case table and each target interface test flow class to obtain the target interface test result, the method further comprises the following steps:
acquiring a regression test starting request through the target regression test entry class;
and responding to the regression test starting request, and performing regression test according to the target interface test result, the target regression test entry class and each target interface test flow class to obtain a regression test result.
Further, the regression test entry configuration data includes: selecting a configuration result, identifying the configuration result by a regression database, judging whether to regress the configuration result and calling a configuration result of a storage process by the case set;
after the step of performing the interface test according to the target test case table and each target interface test flow class to obtain the target interface test result, the method further comprises the following steps:
updating an interface test case set according to the interface identification, the target test case table and the target interface test result which are respectively corresponding to each target interface test flow class;
the step of performing regression testing according to the target interface testing result, the target regression testing entry class and each target interface testing process class to obtain a regression testing result includes:
obtaining test cases from the interface test case set 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 result of whether the regression configuration is performed in full quantity or not, and using the test cases as a regression test case set;
and performing regression testing according to whether the target interface testing process class, the regression testing case set and the target regression testing entry class call the configuration result of the storage process to obtain the regression testing result.
The present application further provides an interface testing device, the device comprising:
the device comprises a request acquisition module, a request processing module and a processing module, wherein the request acquisition module is used for acquiring an interface test flow configuration request, and the interface test flow configuration request carries an interface type;
the target interface test standard process type determining module is used for searching an interface test standard process type from the obtained interface test standard process type library according to the interface type to obtain a target interface test standard process type;
the interface class determination module to be processed is used for inheriting the target interface test standard process class by adopting the created interface class to obtain the interface class to be processed;
the target interface testing flow class determining module is used for acquiring interface class configuration data according to the interface class to be processed to obtain a target interface testing flow class;
the cycle control module is used for repeatedly executing the step of acquiring the interface test flow configuration request until an interface test flow configuration finishing signal input by a user is acquired;
and the target interface test result determining module is used for acquiring a target test case table, and performing interface test according to the target test case table and each target interface test flow class to obtain a target interface test result.
The present application further proposes a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of any of the above methods when executing the computer program.
The present application also proposes a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of any of the above.
The interface test method, the device, the equipment and the storage medium of the application are characterized in that firstly, according to the interface type, an interface test standard flow class is searched from an obtained interface test standard flow class library to obtain a target interface test standard flow class, secondly, the target interface test standard flow class is inherited by adopting the created interface class to obtain the interface class to be processed, interface class configuration data is obtained according to the interface class to be processed to obtain the target interface test flow class, then, the step of obtaining an interface test flow configuration request is repeatedly executed until an interface test flow configuration finishing signal input by a user is obtained, finally, an interface test is carried out according to the target test case list and each target interface test flow class to obtain a target interface test result, and the generation of the target interface test flow class based on the interface test standard flow class configuration data is realized, therefore, configuration development based on the multiplexed codes is realized, the generation efficiency of the target interface test flow class is improved, and the interface test efficiency is improved.
Drawings
Fig. 1 is a schematic flowchart of an interface testing method according to an embodiment of the present application;
FIG. 2 is a block diagram of an interface testing apparatus according to an embodiment of the present disclosure;
fig. 3 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, an embodiment of the present application provides an interface testing method, where the method includes:
s1: acquiring an interface test flow configuration request, wherein the interface test flow configuration request carries an interface type;
s2: searching an interface test standard process class from the obtained interface test standard process class library according to the interface type to obtain a target interface test standard process class;
s3: inheriting the target interface test standard process class by adopting the created interface class to obtain an interface class to be processed;
s4: acquiring interface class configuration data according to the interface class to be processed to obtain a target interface test flow class;
s5: repeatedly executing the step of obtaining the interface test flow configuration request until obtaining an interface test flow configuration finishing signal input by a user;
s6: and acquiring a target test case table, and performing interface test according to the target test case table and each target interface test flow class to obtain a target interface test result.
In this embodiment, a target interface test standard flow class is obtained by searching an interface test standard flow class from an obtained interface test standard flow class library according to the interface type, then the target interface test standard flow class is obtained by inheriting the target interface test standard flow class by using the created interface class, the interface class to be processed is obtained, interface class configuration data is obtained according to the interface class to be processed, a target interface test flow class is obtained, then the step of obtaining the interface test flow configuration request is repeatedly executed until an interface test flow configuration end signal input by a user is obtained, finally an interface test is performed according to the target test case table and each target interface test flow class, a target interface test result is obtained, and the generation of the target interface test flow class based on the interface test standard flow class obtained interface class configuration data is realized, therefore, configuration development based on the multiplexed codes is realized, the generation efficiency of the target interface test flow class is improved, and the interface test efficiency is improved.
For S1, the interface test flow configuration request input by the user is obtained.
The interface test flow configuration request is a configuration request for performing interface test flow class.
Interface types include, but are not limited to: a first interface type and a second interface type.
The steps of the interface of the first interface type in turn comprise: obtaining input parameters, calling a Java (object-oriented programming language) interface, converting a first format, calling a storage process, converting a second format and comparing the input expected results with the output expected results.
The steps of the interface of the second interface type in turn comprise: obtaining input parameters, calling a Java interface, converting a first format, calling a storage process, converting a second format, comparing the input expected results and the table data.
The parameter acquisition and entry are parameters required by the calling interface. And calling the Java interface, namely calling the Java type interface to perform logic execution to obtain an actual result of the Java format. The first format conversion is to convert parameters required for the call interface from Java format to Oracle (relational database management system) format. The call to the stored procedure is the expected result of the call to the stored procedure (i.e., the interface to Oracle) to get the Oracle format from the database. And second format conversion, which is used for converting the expected result obtained by calling the storage process from an Oracle format into a Java format. And the comparison of the expected results is carried out, namely the actual results in the Java format are compared with the expected results in the Java format. And comparing the formal data table and the backup data table, namely comparing the formal data table and the backup data table, wherein an Oracle interface is called to store an expected result into the formal data table, the formal data table is backed up into the backup data table, the formal data table is rolled back to the Oracle interface after the backup is finished, the expected result is stored into the formal data table, the formal data table is modified when a Java type interface is called to carry out logic execution, the formal data table and the backup data table which are modified are compared, when the formal data table and the backup data table are consistent, the comparison result of the table data is determined to be consistent, otherwise, the comparison result of the table data is determined to be inconsistent.
It is understood that different interfaces may differ in the specific implementation of the same step. For example, in the step "get entry", the entry format obtained by different interfaces may be different. For another example, the step "call Java interface", the interfaces called by different interfaces may be different.
For S2, the interface test standard flow class library includes: the mapping relation table and the interface testing standard process set. The mapping relation table comprises: type identification and flow type identification. The interface test standard process set comprises one or more interface test standard process types, wherein each interface test standard process type carries a process type identification. The process type identifier may be a process type name, a process type ID, or other data uniquely identifying an interface test standard process type. Each interface testing standard flow class corresponds to one interface.
Because the processes have commonality, a test process has been established in the interface test standard process class, and the test process comprises a plurality of steps; because the steps have characteristics, only a null method is written for the step characteristics in the step of the established test flow, wherein the null method only restricts the parameter types and is not specifically realized; in the steps of the established test flow, the method is written in a non-empty method aiming at the step commonality.
The interface testing standard process class library can be obtained from a database, and can also be obtained from a third-party application system; searching the interface type in each type identifier of a mapping relation table in the interface test standard process class library, and taking the process class identifier corresponding to the type identifier searched in the mapping relation table as a target process class identifier; and marking the target process class in the interface test standard process class set of the interface test standard process class library to be the corresponding interface test standard process class as the target interface test standard process class.
For S3, creating an interface class by using a preset interface class creation rule, and then inheriting all program statements of the target interface test standard flow class by using the created interface class, and inheriting the interface class of all program statements of the target interface test standard flow class as an interface class to be processed. Therefore, the interface class to be processed can realize the same function of the target interface test standard flow class.
And S4, acquiring interface class configuration data input by a user according to the interface class to be processed, and taking the interface class to be processed for completing the interface class configuration data as a target interface test flow class.
And the interface class configuration data is the result of the configuration of the parameters of the interface class to be processed.
For S5, steps S1 to S5 are repeatedly executed until an interface test flow configuration end signal input by the user is acquired. When an interface test flow configuration end signal is acquired, generation of a target interface test flow class is completed. The generation of the target interface test flow class of the batch interface is completed by repeatedly performing steps S1 to S5.
The interface test flow configuration ending signal may be sent by a user or sent by a third-party application system.
And S6, acquiring a target test case table from a database, searching test cases from the target test case table by adopting each target interface test flow class for interface test, and taking a result obtained by the interface test as a target interface test result.
Optionally, the target test case table is stored by using a table, for example, by using excel (microsoft Office excel); the target test case table comprises a plurality of worksheets, all test cases of one interface are stored in each worksheet, and each row of data in each worksheet corresponds to one test case.
The test cases include, but are not limited to: the method comprises a test case identification step and a test step, wherein the test step is used for storing and inputting parameters. The test case identifier may be data that uniquely identifies one test case, such as a test case name and a test case ID.
In an embodiment, the step of inheriting the target interface test standard process class by using the created interface class to obtain the interface class to be processed includes:
s31: adopting a preset interface class creation rule to create an interface class to obtain an interface class to be analyzed;
s32: and adopting the interface class to be analyzed to inherit all program statements of the target interface test standard process class to obtain the interface class to be processed.
In this embodiment, the created interface class is used to inherit all program statements of the target interface test standard flow class, so that the copy of the target interface test standard flow class is completed, code multiplexing is realized, and a basis is provided for acquiring interface class configuration data based on the interface class to be processed.
And S31, creating the interface class by adopting a preset interface class creating rule, and taking the created interface class as the interface class to be analyzed.
For S32, the interface class to be analyzed is adopted, all program statements of the target interface test standard flow class are inherited, and the interface class to be analyzed, which inherits all program statements of the target interface test standard flow class, is taken as the interface class to be processed.
In an embodiment, the step of obtaining the interface class configuration data according to the interface class to be processed to obtain the target interface test flow class includes:
s41: performing interface display on the interface class to be processed;
s42: acquiring the interface class configuration data input by a user and acquiring a single interface configuration ending signal in the interface class to be processed displayed on the interface;
s43: and responding to the single interface configuration ending signal, and generating a flow type according to the interface type to be processed displayed by the interface and the interface type configuration data to obtain the target interface test flow type.
According to the interface generation method and device, the interface class to be processed based on the interface display is used for obtaining the interface class configuration data, so that the process generation efficiency is improved, and the interface testing efficiency is improved.
And S41, interface display is carried out on the interface class to be processed by adopting a preset interface display rule.
For S42, acquiring the configuration of each empty method of the user in the interface class to be processed shown by the interface, and taking the configured data as the interface class configuration data; the single interface configuration end signal may be a single interface configuration end signal input by a user, or a single interface configuration end signal actively triggered by the program file according to a preset condition. For example, when the configuration of all parameters is completed, the single-interface configuration end signal is triggered actively.
The single interface configuration end signal is a signal for completing the input of the interface type configuration data.
For step S43, when the single-interface configuration end signal is acquired, generating a process class according to the interface class to be processed and the interface class configuration data displayed on the interface, and taking the generated process class as the target interface test process class. Therefore, the process class containing personalized configuration is obtained, and configuration development based on the multiplexed code is realized.
In an embodiment, after the step of obtaining the interface test flow configuration request, the method further includes:
s71: acquiring an interface test entry class configuration request;
s72: responding the interface test entry class configuration request to acquire an interface test entry standard class;
s73: performing interface display on the interface test entry standard class;
s74: in the interface test entry standard class displayed according to the interface, obtaining interface test entry configuration data input by a user, wherein the interface test entry configuration data comprises: storing address configuration results in the test case table;
s75: generating 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 comprises the following steps:
s611: acquiring an interface test starting request through the target interface test entry class;
s612: and responding to the interface test starting request, and acquiring a test case table as the target test case table from a storage space corresponding to the test case table storage address configuration result of the target interface test entry.
In the embodiment, the entry class is configured through the standard class of the interface test entry, so that the configuration development based on the multiplexed code is realized; and the target interface test flow classes are called through one target interface test entry class to carry out interface test, so that the target interface test flow classes do not need to be manually switched, user operation is reduced, and the efficiency of the interface test is further improved.
For S71, an interface test entry class configuration request entered by the user may be obtained.
The interface test entry class configuration request is a request for configuring an interface test entry class.
For S72, when the interface test entry class configuration request is obtained, the interface test entry standard class may be obtained from the database, or the interface test entry standard class may be obtained from the database.
In the interface test entry standard class, only a null method is written for step characteristics in the steps of the established test flow, wherein the null method only restricts the parameter types and is not specifically realized; in the steps of the established test flow, the method is written in a non-empty method aiming at the step commonality.
And S73, interface display is carried out on the interface test entry standard class by adopting a preset interface display rule.
For S74, in the interface test entry standard class shown according to the interface, the configuration of the user for the null method is obtained, and the configured data is used as the interface test entry configuration data.
And (3) the storage address configuration result of the test case table is that the storage address of the test case table is used as a value corresponding to the storage address key word.
For S75, generating an entry class according to the interface test entry standard class and the interface test entry configuration data displayed on the interface, and taking the generated entry class as a target interface test entry class. Thereby, the entry class containing personalized configuration is obtained, and the configuration development based on the multiplexed code is realized.
For S611, the interface test start request input by the user may be obtained through the target interface test entry class, or the interface test start request sent by the third-party application system may be obtained through the target interface test entry class.
An interface test start request, that is, a request to start an interface test.
For step S612, when the interface test start request is obtained, 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, and taking the obtained test case table as the target test case table.
In an embodiment, the step of performing an interface test according to the target test case table and each target interface test flow class to obtain a target interface test result includes:
s613: acquiring the target interface test flow class as an interface test flow class to be tested;
s614: obtaining each test case corresponding to the interface test flow to be tested from the target test case table to obtain a single-interface test case set;
s615: executing the single-interface test case set by adopting the interface test flow class to be tested to obtain a single-interface test result corresponding to the interface test flow class to be tested;
s616: repeatedly executing the step of obtaining one target interface test flow class as an interface test flow class to be tested until the target interface test flow class is obtained;
s617: and determining the target interface test result according to each single interface test result.
In this embodiment, the interface test is performed according to the target test case table and each target interface test flow class, so that the efficiency of the interface test is improved.
For step S613, one target interface test flow class is sequentially obtained as the interface test flow class to be tested.
And S614, obtaining each test case corresponding to the interface test flow class to be tested from the target test case table, and using each obtained test case as a single-interface test case set.
And for step S615, executing each test case in the single-interface test case set by using the interface test flow class to be tested, and taking each test result obtained by the execution as a single-interface test result corresponding to the interface test flow class to be tested.
For S616, repeating steps S613 to S616 until the acquisition of the target interface test flow class is completed. When the acquisition of the target interface test flow class is completed, it means that the execution of each target interface test flow class is completed.
For S617, each of the single interface test results is taken as the target interface test result.
In an embodiment, after the step of performing the interface test according to the target test case table and each target interface test flow class to obtain the target interface test result, the method further includes:
s81: acquiring a regression test entry class configuration request;
s82: responding to the regression testing entry class configuration request, and acquiring a regression testing entry standard class as a regression testing entry class to be processed;
s83: performing interface display on the regression testing entry class to be processed;
s84: acquiring regression testing entry configuration data input by a user in the regression testing entry class to be processed displayed on the interface;
s85: generating an entry class according to the regression testing entry class to be processed and the regression testing entry configuration data displayed on the interface to obtain a target regression testing entry class;
after the step of performing the interface test according to the target test case table and each target interface test flow class to obtain the target interface test result, the method further comprises the following steps:
s621: acquiring a regression test starting request through the target regression test entry class;
s622: and responding to the regression test starting request, and performing regression test according to the target interface test result, the target regression test entry class and each target interface test flow class to obtain a regression test result.
The embodiment realizes the configuration and development of the target regression testing entry class based on the regression testing entry standard class and realizes the configuration and development based on the multiplexed code; and a regression test starting request is obtained through a regression test entry class to carry out regression test, a target interface test flow class does not need to be manually switched, user operation is reduced, and interface test efficiency is further improved.
For S81, a regression test entry class configuration request entered by the user is obtained.
The regression test entry class configuration request is a request for configuring a regression test entry class.
For S82, when the regression testing entry class configuration request is obtained, the regression testing entry standard class may be obtained from the database, or the regression testing entry standard class may be obtained from the third-party application system, and the obtained regression testing entry standard class is used as the regression testing entry class to be processed.
In a regression test entry standard class, only a null method is written for step characteristics in the steps of the constructed test flow, wherein the null method only restricts parameter types and is not specifically realized; in the steps of the established test flow, the method is written in a non-empty method aiming at the step commonality.
And S83, interface display is carried out on the regression testing entry class to be processed by adopting a preset interface display rule.
For S84, in the regression testing entry class to be processed shown according to the interface, the configuration of the user for the null method is obtained, and the configured data is used as the regression testing entry configuration data.
Regression test entry configuration data includes: and selecting a configuration result and identifying the configuration result by the regression database through the case set. The case set selection configuration result is the configuration result of SQL (structured query language) of the case set selection. And the configuration result of the identification of the regression database is the configuration result of the identification of the database needing regression. Therefore, the traditional regression mode with the interface as the dimension is separated, the database as the dimension is realized, the SQL is inquired by combining the database, the test case needing regression is selected more quickly and flexibly, and the efficiency of regression testing is improved.
For S85, generating an entry class according to the regression testing entry class to be processed and the regression testing entry configuration data displayed on the interface, and taking the generated entry class as a target regression testing entry class. Thereby, the entry class containing personalized configuration is obtained, and the configuration development based on the multiplexed code is realized.
For S621, the regression test start request input by the user may be obtained through the target regression test entry class, or the regression test start request sent by the third-party application system may also be obtained through the target regression test entry class.
The regression test start request is a request to start the regression test of the interface.
For S622, when the regression test start request is obtained, test cases are obtained according to the target interface test result and the regression test entry configuration data of the target regression test entry class, each obtained test case is executed through each target interface test flow class to perform regression test, and a result obtained by regression test is used as a regression test result.
In one embodiment, the regression test entry configuration data includes: selecting a configuration result, identifying the configuration result by a regression database, judging whether to regress the configuration result and calling a configuration result of a storage process by the case set;
after the step of performing the interface test according to the target test case table and each target interface test flow class to obtain the target interface test result, the method further comprises the following steps:
s631: updating an interface test case set according to the interface identification, the target test case table and the target interface test result which are respectively corresponding to each target interface test flow class;
the step of performing regression testing according to the target interface testing result, the target regression testing entry class and each target interface testing process class to obtain a regression testing result includes:
s6221: obtaining test cases from the interface test case set 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 result of whether the regression configuration is performed in full quantity or not, and using the test cases as a regression test case set;
s6222: and performing regression testing according to whether the target interface testing process class, the regression testing case set and the target regression testing entry class call the configuration result of the storage process to obtain the regression testing result.
In this embodiment, the interface test case set is updated according to the interface identifier, the target test case table, and the target interface test result corresponding to each target interface test flow class, and then a regression test is performed according to the interface test case set, the target interface test result, the target regression test entry class, and each target interface test flow class by responding to the regression test start request.
The step "call store procedure" may be necessary during the interface testing phase because the expected results of the test cases require the step "call store procedure", but may not need to be repeated during the regression testing phase because the expected results of the test cases are already preserved during the regression testing phase. It will be appreciated that some interfaces must also perform the step "call store procedure" during the regression testing phase, for example, the Java interface is time dependent, and the expected results at different times are different, and therefore the step "call store procedure" is also performed during the regression testing. Therefore, it is necessary to determine whether to invoke the stored procedure configuration result. Whether the value of the total regression configuration result is two, one is yes, and the other is no.
Because one Java interface corresponds to a plurality of test cases, in order to improve the regression test efficiency, different test cases can be regressed only for the last test in the regression test, and therefore, whether to perform the configuration of the total regression configuration result is required. And if the full regression configuration result is N, performing regression testing on the failed test case corresponding to the Java interface.
For S631, the interface identifier corresponding to each target interface test flow class, 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.
For S6221, determining interface identifiers which fail to pass the test from the target interface test results according to the regression database identifier configuration results, and taking each determined interface identifier as an interface identifier set to be regressed; when the total regression configuration result is the total regression, selecting a configuration result according to the case set of the target regression testing entry class, and acquiring all testing cases corresponding to the interface identification set to be regressed from the interface testing case set to serve as a regression testing case set; and when the total regression configuration result is non-total regression, selecting a configuration result according to the case set of the target regression test entry class, and acquiring each test case which has a test result corresponding to the interface identification set to be regressed as a failed test case set from the interface test case set to serve as a regression test case set.
That is, when the configuration result of whether or not the full regression is the full regression, it is necessary to perform the regression test on all the test cases of the interface. And when the result of whether the total regression configuration is the non-total regression configuration, performing regression testing on each test case with the test result of the interface being failed.
Wherein, the step of determining the interface identifier which fails the test from the target interface test result according to the regression database identifier configuration result comprises: acquiring all interface test results corresponding to the regression database identifier configuration result from the target interface test result, and taking the interface test results as an interface test result set to be screened; and acquiring the interface identification which fails the test from the interface test result set to be screened. Therefore, regression testing with the database as the dimension is realized.
For S6222, the regression test case set is executed through each target interface test flow class to perform a regression test, and when performing the regression test, whether each interface executes the calling storage process is selected according to the configuration result of whether the calling storage process is called, and a result obtained by the regression test is used as the regression test result.
With reference to fig. 2, the present application also proposes an interface testing device, said device comprising:
a request obtaining module 100, configured to obtain an interface test flow configuration request, where the interface test flow configuration request carries an interface type;
a target interface test standard flow class determination module 200, configured to search an interface test standard flow class from the obtained interface test standard flow class library according to the interface type, to obtain a target interface test standard flow class;
the to-be-processed interface class determining module 300 is configured to inherit the target interface test standard process class by using the created interface class, so as to obtain the to-be-processed interface class;
a target interface test flow class determining module 400, configured to obtain interface class configuration data according to the interface class to be processed, so as to obtain a target interface test flow class;
the circulation control module 500 is configured to repeatedly execute the step of obtaining the interface test flow configuration request until obtaining an interface test flow configuration end signal input by the user;
the target interface test result determining module 600 is configured to obtain a target test case table, perform an interface test according to the target test case table and each target interface test flow class, and obtain a target interface test result.
In this embodiment, a target interface test standard flow class is obtained by searching an interface test standard flow class from an obtained interface test standard flow class library according to the interface type, then the target interface test standard flow class is obtained by inheriting the target interface test standard flow class by using the created interface class, the interface class to be processed is obtained, interface class configuration data is obtained according to the interface class to be processed, a target interface test flow class is obtained, then the step of obtaining the interface test flow configuration request is repeatedly executed until an interface test flow configuration end signal input by a user is obtained, finally an interface test is performed according to the target test case table and each target interface test flow class, a target interface test result is obtained, and the generation of the target interface test flow class based on the interface test standard flow class obtained interface class configuration data is realized, therefore, configuration development based on the multiplexed codes is realized, the generation efficiency of the target interface test flow class is improved, and the interface test efficiency is improved.
Referring to fig. 3, a computer device, which may be a server and whose internal structure may be as shown in fig. 3, is also provided in the embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile 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 for storing data such as interface test methods and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an interface testing method. The interface testing method comprises the following steps: acquiring an interface test flow configuration request, wherein the interface test flow configuration request carries an interface type; searching an interface test standard process class from the obtained interface test standard process class library according to the interface type to obtain a target interface test standard process class; inheriting the target interface test standard process class by adopting the created interface class to obtain an interface class to be processed; acquiring interface class configuration data according to the interface class to be processed to obtain a target interface test flow class; repeatedly executing the step of obtaining the interface test flow configuration request until obtaining an interface test flow configuration finishing signal input by a user; and acquiring a target test case table, and performing interface test according to the target test case table and each target interface test flow class to obtain a target interface test result.
In this embodiment, a target interface test standard flow class is obtained by searching an interface test standard flow class from an obtained interface test standard flow class library according to the interface type, then the target interface test standard flow class is obtained by inheriting the target interface test standard flow class by using the created interface class, the interface class to be processed is obtained, interface class configuration data is obtained according to the interface class to be processed, a target interface test flow class is obtained, then the step of obtaining the interface test flow configuration request is repeatedly executed until an interface test flow configuration end signal input by a user is obtained, finally an interface test is performed according to the target test case table and each target interface test flow class, a target interface test result is obtained, and the generation of the target interface test flow class based on the interface test standard flow class obtained interface class configuration data is realized, therefore, configuration development based on the multiplexed codes is realized, the generation efficiency of the target interface test flow class is improved, and the interface test efficiency is improved.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing an interface testing method, including the steps of: acquiring an interface test flow configuration request, wherein the interface test flow configuration request carries an interface type; searching an interface test standard process class from the obtained interface test standard process class library according to the interface type to obtain a target interface test standard process class; inheriting the target interface test standard process class by adopting the created interface class to obtain an interface class to be processed; acquiring interface class configuration data according to the interface class to be processed to obtain a target interface test flow class; repeatedly executing the step of obtaining the interface test flow configuration request until obtaining an interface test flow configuration finishing signal input by a user; and acquiring a target test case table, and performing interface test according to the target test case table and each target interface test flow class to obtain a target interface test result.
The executed interface test method comprises the steps of firstly searching an interface test standard flow class from an acquired interface test standard flow class library according to the interface type to obtain a target interface test standard flow class, secondly inheriting the target interface test standard flow class by adopting the created interface class to obtain an interface class to be processed, acquiring interface class configuration data according to the interface class to be processed to obtain a target interface test flow class, then repeatedly executing the step of acquiring an interface test flow configuration request until an interface test flow configuration finishing signal input by a user is acquired, and finally performing interface test according to the target test case list and each target interface test flow class to obtain a target interface test result, so that the generation of the target interface test flow class based on the interface test standard flow class configuration data is realized, therefore, configuration development based on the multiplexed codes is realized, the generation efficiency of the target interface test flow class is improved, and the interface test efficiency is improved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. An interface testing method, the method comprising:
acquiring an interface test flow configuration request, wherein the interface test flow configuration request carries an interface type;
searching an interface test standard process class from the obtained interface test standard process class library according to the interface type to obtain a target interface test standard process class;
inheriting the target interface test standard process class by adopting the created interface class to obtain an interface class to be processed;
acquiring interface class configuration data according to the interface class to be processed to obtain a target interface test flow class;
repeatedly executing the step of obtaining the interface test flow configuration request until obtaining an interface test flow configuration finishing signal input by a user;
and acquiring a target test case table, and performing interface test according to the target test case table and each target interface test flow class to obtain a target interface test result.
2. The interface testing method according to claim 1, wherein the step of inheriting the target interface testing standard process class by using the created interface class to obtain the interface class to be processed includes:
adopting a preset interface class creation rule to create an interface class to obtain an interface class to be analyzed;
and adopting the interface class to be analyzed 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, wherein the step of obtaining interface class configuration data according to the interface class to be processed to obtain a target interface testing flow class comprises:
performing interface display on the interface class to be processed;
acquiring the interface class configuration data input by a user and acquiring a single interface configuration ending signal in the interface class to be processed displayed on the interface;
and responding to the single interface configuration ending signal, and generating a flow type according to the interface type to be processed displayed by the interface and the interface type configuration data to obtain the target interface test flow type.
4. The interface testing method according to claim 1, wherein after the step of obtaining the interface testing flow configuration request, the method further comprises:
acquiring an interface test entry class configuration request;
responding the interface test entry class configuration request to acquire an interface test entry standard class;
performing interface display on the interface test entry standard class;
in the interface test entry standard class displayed according to the interface, obtaining interface test entry configuration data input by a user, wherein the interface test entry configuration data comprises: storing address configuration results in the test case table;
generating 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 comprises the following steps:
acquiring an interface test starting request through the target interface test entry class;
and responding to the interface test starting request, and acquiring a test case table as the target test case table from a storage space corresponding to the test case table storage address configuration result of the target interface test entry.
5. The interface test method according to claim 1, wherein the step of performing the interface test according to the target test case table and each target interface test flow class to obtain a target interface test result includes:
acquiring the target interface test flow class as an interface test flow class to be tested;
obtaining each test case corresponding to the interface test flow to be tested from the target test case table to obtain a single-interface test case set;
executing the single-interface test case set by adopting the interface test flow class to be tested to obtain a single-interface test result corresponding to the interface test flow class to be tested;
repeatedly executing the step of obtaining one target interface test flow class as an interface test flow class to be tested until the target interface test flow class is obtained;
and determining the target interface test result according to each single interface test result.
6. The interface testing method according to claim 1, wherein after the step of performing the interface test according to the target test case table and each target interface test flow class to obtain the target interface test result, the method further comprises:
acquiring a regression test entry class configuration request;
responding to the regression testing entry class configuration request, and acquiring a regression testing entry standard class as a regression testing entry class to be processed;
performing interface display on the regression testing entry class to be processed;
acquiring regression testing entry configuration data input by a user in the regression testing entry class to be processed displayed on the interface;
generating an entry class according to the regression testing entry class to be processed and the regression testing entry configuration data displayed on the interface to obtain a target regression testing entry class;
after the step of performing the interface test according to the target test case table and each target interface test flow class to obtain the target interface test result, the method further comprises the following steps:
acquiring a regression test starting request through the target regression test entry class;
and responding to the regression test starting request, and performing regression test according to the target interface test result, the target regression test entry class and each target interface test flow class to obtain a regression test result.
7. The interface testing method of claim 6, wherein the regression test entry configuration data comprises: selecting a configuration result, identifying the configuration result by a regression database, judging whether to regress the configuration result and calling a configuration result of a storage process by the case set;
after the step of performing the interface test according to the target test case table and each target interface test flow class to obtain the target interface test result, the method further comprises the following steps:
updating an interface test case set according to the interface identification, the target test case table and the target interface test result which are respectively corresponding to each target interface test flow class;
the step of performing regression testing according to the target interface testing result, the target regression testing entry class and each target interface testing process class to obtain a regression testing result includes:
obtaining test cases from the interface test case set 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 result of whether the regression configuration is performed in full quantity or not, and using the test cases as a regression test case set;
and performing regression testing according to whether the target interface testing process class, the regression testing case set and the target regression testing entry class call the configuration result of the storage process to obtain the regression testing result.
8. An interface testing apparatus, the apparatus comprising:
the device comprises a request acquisition module, a request processing module and a processing module, wherein the request acquisition module is used for acquiring an interface test flow configuration request, and the interface test flow configuration request carries an interface type;
the target interface test standard process type determining module is used for searching an interface test standard process type from the obtained interface test standard process type library according to the interface type to obtain a target interface test standard process type;
the interface class determination module to be processed is used for inheriting the target interface test standard process class by adopting the created interface class to obtain the interface class to be processed;
the target interface testing flow class determining module is used for acquiring interface class configuration data according to the interface class to be processed to obtain a target interface testing flow class;
the cycle control module is used for repeatedly executing the step of acquiring the interface test flow configuration request until an interface test flow configuration finishing signal input by a user is acquired;
and the target interface test result determining module is used for acquiring a target test case table, and performing interface test according to the target test case table and each target interface test flow class to obtain a target interface test result.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202111216112.7A 2021-10-19 2021-10-19 Interface test method, device, equipment and storage medium Pending CN113918461A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111216112.7A CN113918461A (en) 2021-10-19 2021-10-19 Interface test method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111216112.7A CN113918461A (en) 2021-10-19 2021-10-19 Interface test method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113918461A true CN113918461A (en) 2022-01-11

Family

ID=79241336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111216112.7A Pending CN113918461A (en) 2021-10-19 2021-10-19 Interface test method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113918461A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461525A (en) * 2022-02-08 2022-05-10 中国农业银行股份有限公司 Automatic testing method and device for configuration type interface, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461525A (en) * 2022-02-08 2022-05-10 中国农业银行股份有限公司 Automatic testing method and device for configuration type interface, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112148509A (en) Data processing method, device, server and computer readable storage medium
CN111984228B (en) Interface document processing method and device, computer equipment and storage medium
CN112380130A (en) Application testing method and device based on call dependency relationship
CN109361628B (en) Message assembling method and device, computer equipment and storage medium
CN113282513B (en) Interface test case generation method and device, computer equipment and storage medium
CN113918461A (en) Interface test method, device, equipment and storage medium
CN112328250A (en) User interface generation method and device, computer equipment and storage medium
CN113434395A (en) Automatic generation method, device, equipment and medium of test case
CN112363937A (en) Method and device for testing differential coverage rate, computer equipment and storage medium
CN112181423A (en) Project construction method and device based on configuration file, computer equipment and medium
CN113126955A (en) Random data generation method and device, intelligent terminal and storage medium
CN114510536A (en) Data verification method and device, computer equipment and storage medium
CN112527286A (en) Service code generation method and device, computer equipment and storage medium
CN111158642A (en) Data construction method and device, computer equipment and storage medium
CN115757172A (en) Test execution method and device, storage medium and computer equipment
CN113064584B (en) Idempotent implementation method, device, equipment and medium
CN113885897A (en) Packaging method, device and equipment of client installation package and storage medium
CN112463164B (en) SoC program execution display positioning method, device, computer equipment and storage medium
CN111651195B (en) System dependent packet conflict detection method and device
CN113157754A (en) Method, device and equipment for displaying flow form data and storage medium
CN112667273A (en) Authority management method and device of page button, computer equipment and storage medium
CN112732742B (en) Query page creating method and device, computer equipment and storage medium
CN114546399A (en) Code auditing method, device, equipment and storage medium for machine learning
CN114595159B (en) Test data generation method, device, equipment and storage medium
CN114860340A (en) Starting control method, device, equipment and storage medium for configuring logic code

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination