CN112948234B - Interface test method and device and electronic equipment - Google Patents

Interface test method and device and electronic equipment Download PDF

Info

Publication number
CN112948234B
CN112948234B CN202010869225.6A CN202010869225A CN112948234B CN 112948234 B CN112948234 B CN 112948234B CN 202010869225 A CN202010869225 A CN 202010869225A CN 112948234 B CN112948234 B CN 112948234B
Authority
CN
China
Prior art keywords
test
branch code
case
result
information
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.)
Active
Application number
CN202010869225.6A
Other languages
Chinese (zh)
Other versions
CN112948234A (en
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.)
Shenzhen Mingyuan Cloud Chain Internet Technology Co ltd
Original Assignee
Shenzhen Mingyuan Cloud Chain Internet Technology Co 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 Shenzhen Mingyuan Cloud Chain Internet Technology Co ltd filed Critical Shenzhen Mingyuan Cloud Chain Internet Technology Co ltd
Priority to CN202010869225.6A priority Critical patent/CN112948234B/en
Publication of CN112948234A publication Critical patent/CN112948234A/en
Application granted granted Critical
Publication of CN112948234B publication Critical patent/CN112948234B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The application provides an interface test method, an interface test device and electronic equipment, and relates to the technical field of testing, wherein the method comprises the following steps: and determining at least one branch code identifier to be tested corresponding to the target test case, and performing case test on each branch code identifier according to the common case test information and the difference case test information corresponding to the branch code identifier to obtain a test result. The target test case comprises common case test information and difference case test information. The target test case provided by the application can complete the test work of a plurality of branch codes in one execution process, and compared with the total test information quantity of the original plurality of test cases, the total test information quantity of the target test case is smaller, so that the workload of later-period maintenance of the target test case is also smaller.

Description

Interface test method and device and electronic equipment
Technical Field
The present disclosure relates to testing technologies, and in particular, to an interface testing method and apparatus, and an electronic device, and belongs to the technical field of interface testing.
Background
With the advent of the information-oriented society, the functional software industry has also developed at a high speed, and business, flow, communication and other things are or have been realized by functional software in various industries. Such as communication software, payment software, financial software, etc., the functions of which are implemented by software code calling different Application Programming Interfaces (APIs).
In order to meet the differentiated requirements of different users, the existing functional software can provide different branch codes for different users in one set of functional software, and the same API can be called by different branch codes. The functional software needs to be subjected to API test before being formally delivered to a user for use. The flow of the API test is that firstly a programmer needs to write a test case according to the API to be tested, and then test software is used for running the test case to obtain a test result. If the same API corresponds to a plurality of branch codes, a set of test cases needs to be independently written for each branch code, so that the corresponding branch codes can be correctly identified when the test cases run.
However, as the upgrade iteration speed of the functional software becomes faster and faster, and the API test is required for each upgrade, the workload of maintaining the test cases becomes greater and greater.
Disclosure of Invention
In view of this, the present application provides an interface testing method, an interface testing device, and an electronic device, which are used to reduce the workload of maintaining test cases.
In order to achieve the above object, in a first aspect, an embodiment of the present application provides an interface testing method, including:
determining at least one branch code identifier to be tested corresponding to a target test case, wherein the target test case comprises common case test information and difference case test information, the common case test information is the same test information among a plurality of branch code identifiers of the same API, and the difference case test information is different test information between each branch code identifier and other branch code identifiers;
and for each branch code identification, carrying out case test according to the common case test information and the difference case test information corresponding to the branch code identification to obtain a test result.
Optionally, determining at least one branch code identifier to be tested corresponding to the target test case includes:
and determining at least one branch code identifier to be tested corresponding to the target test case according to the pre-defined branch code file to be tested corresponding to the target test case.
Optionally, the to-be-tested branch code file includes a test sequence number of each branch code identifier, and for each branch code identifier, the case test is performed according to the common case test information and the difference case test information corresponding to the branch code identifier, so as to obtain a test result, where the test result includes:
and traversing the test serial number of each branch code identifier in the branch code file to be tested according to a preset traversal rule, and carrying out case test on the branch code identifier corresponding to each traversed test serial number according to the common case test information and the difference case test information corresponding to the branch code identifier to obtain a test result.
Optionally, performing a use case test to obtain a test result, including:
sending a test request to a server, wherein the test request carries a branch code identifier;
and receiving an operation result corresponding to the branch code identifier returned by the server, and comparing the operation result with an expected result corresponding to the preset branch code identifier to obtain a test result of the branch code.
Optionally, the comparing the running result with an expected result corresponding to the preset branch code identifier to obtain a test result of the branch code, includes:
comparing the running result with an expected result corresponding to a preset branch code identifier;
if the running result is consistent with the expected result corresponding to the branch code identification, determining that the test result of the branch code is successful;
and if the operation result is inconsistent with the expected result corresponding to the branch code identification, determining that the test result of the branch code is test failure.
Optionally, the method further comprises:
executing the next target test case;
and after executing each target test case, generating a test report according to the test result of each target test case.
In a second aspect, an embodiment of the present application provides an interface testing apparatus, applied to a client, including:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining at least one branch code identifier to be tested corresponding to a target test case, the target test case comprises common case test information and difference case test information, the common case test information is the same test information among a plurality of branch code identifiers of the same API, and the difference case test information is the test information which is different between each branch code identifier and other branch code identifiers;
and the test module is used for carrying out case test on each branch code identifier according to the common case test information and the difference case test information corresponding to the branch code identifier to obtain a test result.
Optionally, the determining module is specifically configured to:
and determining at least one branch code identifier to be tested corresponding to the target test case according to the pre-defined branch code file to be tested corresponding to the target test case.
Optionally, the to-be-tested branch code file includes a test sequence number of each branch code identifier, and the test module is specifically configured to:
and traversing the test serial number of each branch code identifier in the branch code file to be tested according to a preset traversal rule, and carrying out case test on the branch code identifier corresponding to each traversed test serial number according to the common case test information and the difference case test information corresponding to the branch code identifier to obtain a test result.
Optionally, the test module is specifically configured to:
sending a test request to a server, wherein the test request carries a branch code identifier;
and receiving an operation result corresponding to the branch code identifier returned by the server, and comparing the operation result with an expected result corresponding to the preset branch code identifier to obtain a test result of the branch code.
Optionally, the test module is specifically configured to:
comparing the operation result with an expected result corresponding to a preset branch code identifier;
if the running result is consistent with the expected result corresponding to the branch code identification, determining that the test result of the branch code is successful;
and if the running result is inconsistent with the expected result corresponding to the branch code identification, determining that the test result of the branch code is test failure.
Optionally, the apparatus further comprises:
the execution module is used for executing the next target test case;
and the report module is used for generating a test report according to the test result of each target test case after each target test case is executed.
In a third aspect, an embodiment of the present application provides an electronic device, including: a memory for storing a computer program and a processor; the processor is adapted to perform the method of the first aspect described above or any of the embodiments of the first aspect when the computer program is invoked.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method of the first aspect or any of the implementation manners of the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip system, which includes a processor, where the processor is coupled to a memory, and when the processor executes a computer program stored in the memory, the processor implements the method of the first aspect or any implementation manner of the first aspect.
The interface testing method, the interface testing device and the electronic equipment provided by the embodiment of the application can determine at least one branch code identifier to be tested corresponding to a target test case, and perform case testing according to the common case testing information and the difference case testing information corresponding to the branch code identifier for each branch code identifier to obtain a testing result. The target test case comprises common case test information and difference case test information, the common case test information is the same test information among a plurality of branch code identifications of the same API, and the difference case test information is the test information which is different between each branch code identification and other branch code identifications. The target test case can complete the test work of a plurality of branch codes in the one-time execution process, and compared with the total test information quantity of the original plurality of test cases, the total test information quantity of the target test case is smaller, so that the workload of later-period maintenance of the target test case is also smaller.
Drawings
Fig. 1 is a schematic flowchart of a functional software calling API provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a public API and branch code relationship provided by an embodiment of the present application;
fig. 3 is a schematic flowchart of an interface testing method according to an embodiment of the present application;
fig. 4 is a schematic processing flow diagram of a client according to an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a processing flow of a server according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an interface testing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The functional software referred to in the embodiments of the present application is divided into a client part and a server part, the client part is provided in an electronic device of a user, the server part is provided in a server, the functional software has a plurality of branch codes, and each branch code can call the same or different API to implement a corresponding function. When a user uses the client, the client can send a request instruction to the server, the server can judge the corresponding branch code according to the request instruction, then execute the branch code to complete the requirement corresponding to the request instruction, and finally the server can send the execution result of the branch code to the client to realize the requirement of the user. For example, fig. 1 is a schematic flow diagram of a functional software API call process provided in an embodiment of the present application, in fig. 1, a set of functional software may respectively support two users with different requirements for use, in order to meet the requirements of different users, two branch codes are stored in a server, each branch code may support one or more users for use, and each branch code may call a common API used by all branch codes or call a special API used by only the branch code.
As can be seen from the above, one branch code may correspond to a plurality of APIs, and one common API may also correspond to a plurality of branch codes. Fig. 2 is a schematic diagram of a relationship between a public API and a branch code provided in an embodiment of the present application, in fig. 2, a functional software is provided with two public APIs, a public API1 and a public API2, where each public API corresponds to a branch code a and a branch code B, respectively. Fig. 2 is only illustrated by taking two public APIs and two branch codes as an example, and the specific number of the public APIs and the branch codes is not limited in any way. It is to be understood that one branch code may correspond to one API, and one API may correspond to multiple branch codes.
In order to ensure the normal operation of the test cases, only one set of test cases can be written for each branch code in the prior art, but when the speed of upgrading and iterating the functional software becomes faster and faster, the maintenance workload of the test cases becomes larger and larger.
In order to solve the above problem, the present application provides an interface testing method, which is used for reducing the workload of maintaining test cases. The interface testing method provided by the embodiment of the application can be applied to electronic equipment such as desktop computers, notebook computers and mobile terminals, and the embodiment of the application does not limit the specific types of the electronic equipment at all.
The technical solution of the present application will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 3 is a schematic flowchart of an interface testing method provided in an embodiment of the present application, and as shown in fig. 3, the method includes the following steps:
s110, determining at least one branch code identification to be tested corresponding to the target test case.
The tester can run the target test case in the client or simulate the client through the API test platform to complete the API test work, wherein one target test case can realize the test work of a plurality of branch codes of the same API.
Specifically, the target test case may include common case test information and differential case test information, where the common case test information is the same test information among multiple branch code identifiers of the same API, and the differential case test information is different test information between each branch code identifier and other branch code identifiers. For example, the target test case may include test information such as a test target, a test environment, input data, a test step, an expected result, a test script, and the like, wherein the test environment, the test step, and the test script may be common case test information, and the test target, the input data, and the expected result may be differential case test information. The specific content of the common case test information and the differential case test information can be set according to actual requirements, which is not limited in the present application.
The API test platform is also provided with a pre-defined branch code file to be tested corresponding to the target test case, and the branch code file to be tested can comprise branch code identifications of all branch codes and test serial numbers of all branch code identifications. The electronic equipment can determine at least one branch code identifier to be tested corresponding to the target test case according to a to-be-tested branch code file corresponding to the predefined target test case. The branch code file to be tested can also comprise the branch code name of each branch code and the name of the tested API, so that a tester can know the tested API, the branch code identification and the branch code corresponding to each test serial number clearly when maintaining the branch code file to be tested. For example, as shown in table 1, table 1 is a corresponding relationship among a branch code identifier, a branch code name, and a test serial number in a branch code file to be tested, and the electronic device may determine, according to the branch code file to be tested, that the target test case may be used for testing a branch code a and a branch code B, where the branch code identifier corresponding to the branch code a is 1.0, and the branch code identifier corresponding to the branch code B is 2.0.
TABLE 1
Test sequence number Branch code name Branch code identification API names
1 Branch code A 1.0 API1
2 Branch code B 2.0 API1
It should be noted that, for a case that one branch code corresponds to one API, the branch code identifier may be used to indicate the corresponding branch code; for the case that one branch code corresponds to multiple APIs, the branch code identification may be used to indicate the corresponding branch code and API at the same time, i.e. the server may determine the branch code and API at the same time through the branch code identification, for example, when the branch code identification is 1.0, it indicates the branch code a and API1, and when the branch code identification is 2.0, it indicates the branch code B and API1. Referring to fig. 1, such a server may implement the process of determining branch codes and APIs based on a branch code identification. It may be understood that an API identifier may also be additionally set to indicate a corresponding API, and the branch code identifier is used to indicate a corresponding branch code, which may be selected according to needs in specific implementation, and this embodiment is not particularly limited to this.
The API test platform in the embodiment of the present application is a meter (a pressure test tool), and when the API test platform is specifically implemented, other API test platforms may also be used to execute the test case, which is not limited in this application. In addition, the format of the branch code file to be tested in the embodiment of the present application may be Comma-Separated Values (CSV).
And S120, for each branch code identification, carrying out case test according to the common case test information and the difference case test information corresponding to the branch code identification to obtain a test result.
Because a target test case comprises the common case test information and the difference case test information corresponding to a plurality of branch codes, and one branch code identifier corresponds to one branch code, for each branch code identifier, the API test platform can combine the common case test information and the difference case test information corresponding to the branch code identifier to form the case test information corresponding to the branch code identifier, and perform case test on the branch code based on the information to obtain a test result.
In the embodiment of the application, the test information of the original multiple test cases is combined into one target test case, the API test platform can execute the target test case only once, and can complete the test work of multiple branch codes according to the test information of the common case and the test information of the differential case.
Specifically, the API test platform may traverse the test sequence number of each branch code identifier in the branch code file to be tested according to a preset traversal rule, and for each branch code identifier corresponding to the traversed test sequence number, may perform a case test according to the common case test information and the difference case test information corresponding to the branch code identifier, so as to obtain a test result.
Further, the API test platform may send a test request to the server after traversing to the current branch code identifier to be tested, where the test request carries the traversed branch code identifier. After receiving the test request, the server may parse and extract the branch code identifier carried therein, and execute the corresponding branch code according to the branch code identifier. After the branch code is executed, the server may return an executed operation result to the client, and the API test platform of the client may receive an operation result corresponding to the branch code identifier returned by the server, and compare the operation result with an expected result corresponding to a preset branch code identifier to obtain a test result of the branch code. If the running result is consistent with the expected result corresponding to the branch code identification, determining that the test result of the branch code is successful; and if the operation result is inconsistent with the expected result corresponding to the branch code identification, determining that the test result of the branch code is test failure.
In the embodiment of the present application, a complete example is used to explain the process of the above-mentioned use case test, and fig. 4 is a schematic diagram of a client processing flow provided in the embodiment of the present application, as shown in fig. 4, after the API test platform starts to execute the target test case, the number of branch code identifiers to be tested may be determined according to the branch code identifiers to be tested determined in step S110, and is set as the number of loop traversals, where, referring to table 1, the branch code identifiers to be tested are 1.0 and 2.0, so the number of loop traversals (i.e., counter in fig. 4) is 2. Then, the API test platform may determine whether the current counter is 1 (i.e., determine the current traversal number) through the if statement, if the current counter is 1 (i.e., the current is the first traversal), determine, according to the to-be-tested branch code file, the branch code a with the test sequence number of 1 (i.e., the traversal number is the test sequence number) as the branch code currently needing to be tested, and if the current counter is not 1, continue to determine whether the current counter is 2, where the current counter is 1, the branch code currently needing to be tested is the branch code a, and the corresponding branch code identifier (i.e., API _ version in fig. 4) is 1.0. The API test platform may then place the branch code identification currently needed for testing (i.e., API _ version = 1.0) in the test request (i.e., http:// host: port/apiapipi _ version =1.0 in FIG. 4) and then send the test request to the server.
Next, referring to fig. 5, fig. 5 is a schematic diagram of a processing flow of the server provided in the embodiment of the present application, after the server receives the test request sent by the client, the server may parse and extract the branch code identifier carried therein, and then, the server may determine whether the current api _ version is 1.0 through an if statement, execute the corresponding branch code a if the current api _ version is 1.0, and continue to determine whether the current api _ version is 2.0 if the current api _ version is not 1.0, where the current api _ version is 1.0, and therefore execute the corresponding branch code a. After the server executes the branch code, the corresponding API may also be determined according to the branch code identifier, where the current API _ version is 1.0, and thus the corresponding API is API1. Then, the branch code a may call the API1 to generate an operation result, the server may return the operation result to the client, and the client may determine a test result of the branch code according to the received operation result. After the current branch code indicates that the test is finished, the API test platform may add 1 to the counter, then continue to determine whether the current counter is 2 through the if statement, and in the case that the counter is 2, the API test platform may set the branch code identifier (i.e., API _ version = 2.0) in the test request (i.e., http:// host: port/API. After the counter is added by 1 again by the API test platform, if the counter is 3 at this time, it may be determined that all the branch code identifiers of the current target test case have been tested, the current target test case is ended, and then the next target test case is executed.
And S130, executing the next target test case.
After the API test platform finishes executing the current target test case, the API test platform may continue to execute the next target test case to complete all target test cases corresponding to the API. Because each target test case can complete the test of a plurality of branch codes, the number of the test cases can be greatly reduced, and the workload of a tester for subsequently maintaining the test cases is further reduced.
And S140, after each target test case is executed, generating a test report according to the test result of each target test case.
After the API test platform executes all target test cases, a test report including all test results of this time can be generated according to the test result of each target test case.
In the embodiment of the application, the electronic device can determine at least one branch code identifier to be tested corresponding to the target test case, and for each branch code identifier, perform case testing according to the common case testing information and the difference case testing information corresponding to the branch code identifier to obtain a testing result. The target test case comprises common case test information and difference case test information, the common case test information is the same test information among a plurality of branch code identifications of the same API, and the difference case test information is the test information which is different between each branch code identification and other branch code identifications. The target test case can complete the test work of a plurality of branch codes in the one-time execution process, and compared with the total test information quantity of the original plurality of test cases, the total test information quantity of the target test case is smaller, so that the workload of later-period maintenance of the target test case is also smaller.
Based on the same inventive concept, as an implementation of the foregoing method, an embodiment of the present application provides an interface testing apparatus, where the apparatus embodiment corresponds to the foregoing method embodiment, and for convenience of reading, details in the foregoing method embodiment are not repeated in this apparatus embodiment one by one, but it should be clear that the apparatus in this embodiment can correspondingly implement all the contents in the foregoing method embodiment.
Fig. 6 is a schematic structural diagram of an interface testing apparatus according to an embodiment of the present application, and as shown in fig. 6, the apparatus according to the embodiment is applied to a client, and includes:
the determining module 110 is configured to determine at least one branch code identifier to be tested corresponding to a target test case, where the target test case includes common case test information and difference case test information, the common case test information is the same test information among multiple branch code identifiers of the same API, and the difference case test information is different test information between each branch code identifier and other branch code identifiers;
the test module 120 is configured to perform, for each branch code identifier, a case test according to the common case test information and the difference case test information corresponding to the branch code identifier, so as to obtain a test result.
Optionally, the determining module 110 is specifically configured to:
and determining at least one branch code identifier to be tested corresponding to the target test case according to the pre-defined branch code file to be tested corresponding to the target test case.
Optionally, the branch code file to be tested includes a test sequence number of each branch code identifier, and the test module 120 is specifically configured to:
traversing the test serial number of each branch code mark in the branch code file to be tested according to a preset traversal rule, and carrying out case test on the branch code mark corresponding to each traversed test serial number according to the common case test information and the different case test information corresponding to the branch code mark to obtain a test result.
Optionally, the test module 120 is specifically configured to:
sending a test request to a server, wherein the test request carries a branch code identifier;
and receiving an operation result corresponding to the branch code identifier returned by the server, and comparing the operation result with an expected result corresponding to the preset branch code identifier to obtain a test result of the branch code.
Optionally, the test module 120 is specifically configured to:
comparing the running result with an expected result corresponding to a preset branch code identifier;
if the running result is consistent with the expected result corresponding to the branch code identification, determining that the test result of the branch code is successful;
and if the running result is inconsistent with the expected result corresponding to the branch code identification, determining that the test result of the branch code is test failure.
Optionally, the apparatus further comprises:
an execution module 130, configured to execute a next target test case;
the report module 140 is configured to generate a test report according to the test result of each target test case after each target test case is executed.
The interface testing apparatus provided in this embodiment can perform the above method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Based on the same inventive concept, the embodiment of the application also provides the electronic equipment. Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 7, the electronic device according to the embodiment includes: a memory 21 and a processor 20, the memory 21 being for storing computer programs; the processor 20 is arranged to perform the method of the above-described method embodiment when invoking the computer program 22.
The electronic device provided by this embodiment may perform the above method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the method described in the above method embodiments.
An embodiment of the present application further provides a chip system, which includes a processor, where the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the method described in the foregoing method embodiment when the processor executes the computer program.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable storage medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In some jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and proprietary practices.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/device and method may be implemented in other ways. For example, the above-described apparatus/device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in an electrical, mechanical or other form.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (8)

1. An interface testing method is applied to a client side and comprises the following steps:
determining at least one branch code identifier to be tested corresponding to a target test case, wherein the target test case comprises common case test information and difference case test information, the common case test information is the same test information among a plurality of branch code identifiers of the same application program interface API, and the difference case test information is different test information between each branch code identifier and other branch code identifiers;
for each branch code identification, carrying out case testing according to the common case testing information and the difference case testing information corresponding to the branch code identification to obtain a testing result;
the determining at least one branch code identifier to be tested corresponding to the target test case includes:
determining at least one branch code identifier to be tested corresponding to the target test case according to a pre-defined branch code file to be tested corresponding to the target test case;
the to-be-tested branch code file comprises a test serial number of each branch code identifier, and for each branch code identifier, carrying out case test according to the common case test information and the difference case test information corresponding to the branch code identifier to obtain a test result, wherein the test result comprises the following steps:
traversing the test serial number of each branch code identification in the branch code file to be tested according to a preset traversal rule, and carrying out case test on the branch code identification corresponding to each traversed test serial number according to the common case test information and the difference case test information corresponding to the branch code identification to obtain a test result.
2. The method according to claim 1, wherein the performing a case test to obtain a test result comprises:
sending a test request to a server, wherein the test request carries the branch code identifier;
and receiving an operation result corresponding to the branch code identifier returned by the server, and comparing the operation result with an expected result corresponding to the preset branch code identifier to obtain a test result of the branch code.
3. The method of claim 2, wherein the comparing the running result with an expected result corresponding to the preset branch code identifier to obtain a test result of the branch code comprises:
comparing the running result with an expected result corresponding to the preset branch code identifier;
if the running result is consistent with the expected result corresponding to the branch code identification, determining that the test result of the branch code is successful;
and if the running result is inconsistent with the expected result corresponding to the branch code identification, determining that the test result of the branch code is test failure.
4. The method according to any one of claims 1-3, further comprising:
executing the next target test case;
and after executing each target test case, generating a test report according to the test result of each target test case.
5. An interface testing device, applied to a client, includes:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining at least one branch code identifier to be tested corresponding to a target test case, the target test case comprises common case test information and difference case test information, the common case test information is the same test information among a plurality of branch code identifiers of the same application program interface API, and the difference case test information is the test information which is different between each branch code identifier and other branch code identifiers;
the test module is used for carrying out case test on each branch code identifier according to the common case test information and the difference case test information corresponding to the branch code identifier to obtain a test result;
the determining at least one branch code identifier to be tested corresponding to the target test case includes:
determining at least one branch code identifier to be tested corresponding to the target test case according to a pre-defined branch code file to be tested corresponding to the target test case;
the to-be-tested branch code file comprises a test serial number of each branch code identifier, and for each branch code identifier, carrying out case test according to the common case test information and the difference case test information corresponding to the branch code identifier to obtain a test result, wherein the test result comprises the following steps:
traversing the test serial number of each branch code mark in the branch code file to be tested according to a preset traversal rule, and carrying out case test on the branch code mark corresponding to each traversed test serial number according to the common case test information and the different case test information corresponding to the branch code mark to obtain a test result.
6. An electronic device, comprising: a memory for storing a computer program and a processor; the processor is adapted to perform the method of any of claims 1-4 when the computer program is invoked.
7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-4.
8. A chip system, characterized in that the chip system comprises a processor coupled with a memory, the processor executing a computer program stored in the memory to implement the method according to any of the claims 1-4.
CN202010869225.6A 2020-08-26 2020-08-26 Interface test method and device and electronic equipment Active CN112948234B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010869225.6A CN112948234B (en) 2020-08-26 2020-08-26 Interface test method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010869225.6A CN112948234B (en) 2020-08-26 2020-08-26 Interface test method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112948234A CN112948234A (en) 2021-06-11
CN112948234B true CN112948234B (en) 2023-02-21

Family

ID=76234549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010869225.6A Active CN112948234B (en) 2020-08-26 2020-08-26 Interface test method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112948234B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377679A (en) * 2021-07-13 2021-09-10 北京乐学帮网络技术有限公司 Code determination method and device, electronic equipment and storage medium
CN114968787B (en) * 2022-05-27 2023-09-19 中移互联网有限公司 Method and device for testing based on node relation and electronic equipment
CN116304399B (en) * 2023-05-19 2023-08-11 建信金融科技有限责任公司 Visual processing method, device and system for test cases

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109388568A (en) * 2018-09-29 2019-02-26 百度在线网络技术(北京)有限公司 Code test method and device
CN109783354A (en) * 2018-12-14 2019-05-21 深圳壹账通智能科技有限公司 Function test method, terminal device and the medium of application system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070294430A1 (en) * 2006-06-20 2007-12-20 Microsoft Corporation Generating a device address persistent across different instantiations of an electronic device
US8677355B2 (en) * 2010-12-17 2014-03-18 Microsoft Corporation Virtual machine branching and parallel execution
US9684507B2 (en) * 2015-03-31 2017-06-20 Ca, Inc. Effective defect management across multiple code branches
CN108664384B (en) * 2017-03-29 2021-05-07 富士通株式会社 Data processing apparatus and data processing method
US10810115B2 (en) * 2017-12-21 2020-10-20 Verizon Patent And Licensing Inc. Systems and methods using artificial intelligence to identify, test, and verify system modifications

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109388568A (en) * 2018-09-29 2019-02-26 百度在线网络技术(北京)有限公司 Code test method and device
CN109783354A (en) * 2018-12-14 2019-05-21 深圳壹账通智能科技有限公司 Function test method, terminal device and the medium of application system

Also Published As

Publication number Publication date
CN112948234A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
CN112948234B (en) Interface test method and device and electronic equipment
CN110225104B (en) Data acquisition method and device and terminal equipment
CN108111364B (en) Service system testing method and device
CN110908865A (en) Memory leakage monitoring method and device and electronic equipment
WO2019227641A1 (en) Application testing method, apparatus, terminal device and medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN114253864A (en) Service testing method and device, electronic equipment and storage medium
CN112799953A (en) Interface testing method and device, computer equipment and storage medium
CN114816993A (en) Full link interface test method, system, medium and electronic equipment
CN113297084A (en) Test method, test system, electronic equipment and storage medium
CN108228611B (en) Document information copying method and device
CN112559024A (en) Method and device for generating transaction code change list
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN111352997A (en) Test environment verification method and system
CN111865726B (en) Service message testing method, device, computer system and storage medium
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
CN113238940A (en) Interface test result comparison method, device, equipment and storage medium
CN114003497A (en) Method, device and equipment for testing service system and storage medium
CN111324537A (en) Test script-based test method and device and computer equipment
CN114968829B (en) Full link pressure test method, electronic device and storage medium
CN113254328B (en) White box testing method, system, mobile terminal and storage medium
CN112749073B (en) Service testing method and device, storage medium and electronic equipment
CN109918122B (en) White list maintenance method and device and terminal equipment
CN115617675A (en) Automatic testing method, device and equipment of application program and storage medium
CN116302405A (en) Data desensitization method and device

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
GR01 Patent grant
GR01 Patent grant