CN111538659B - Interface testing method, system, electronic equipment and storage medium of business scene - Google Patents

Interface testing method, system, electronic equipment and storage medium of business scene Download PDF

Info

Publication number
CN111538659B
CN111538659B CN202010317717.4A CN202010317717A CN111538659B CN 111538659 B CN111538659 B CN 111538659B CN 202010317717 A CN202010317717 A CN 202010317717A CN 111538659 B CN111538659 B CN 111538659B
Authority
CN
China
Prior art keywords
test case
test
post
interface
executing
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
CN202010317717.4A
Other languages
Chinese (zh)
Other versions
CN111538659A (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.)
Shanghai Ctrip Business Co Ltd
Original Assignee
Shanghai Ctrip Business 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 Shanghai Ctrip Business Co Ltd filed Critical Shanghai Ctrip Business Co Ltd
Priority to CN202010317717.4A priority Critical patent/CN111538659B/en
Publication of CN111538659A publication Critical patent/CN111538659A/en
Application granted granted Critical
Publication of CN111538659B publication Critical patent/CN111538659B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3684Test management for test design, e.g. generating new test cases
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of testing, and provides an interface testing method and system for a service scene, electronic equipment and a storage medium. The interface testing method comprises the following steps: obtaining a test case of the service scene according to the test request of the service scene; judging whether the test case has the associated pre-test case, if so, calling and executing the pre-test case, wherein the interface corresponding to the pre-test case is a pre-associated interface of the interface corresponding to the test case; according to the circulation parameters of the test cases, the test cases are executed in a circulating way; judging whether the test case has the related post test case, if so, calling and executing the post test case, wherein the interface corresponding to the post test case is a post related interface of the interface corresponding to the test case; and verifying the test data of the test case according to the check point of the test case. The invention can meet the interface test requirement of the service scene, correlate and execute each test case in the service scene, and realize flexible configuration of the execution mode and the check point.

Description

Interface testing method, system, electronic equipment and storage medium of business scene
Technical Field
The present invention relates to the field of testing technologies, and in particular, to a method, a system, an electronic device, and a storage medium for testing an interface of a service scenario.
Background
The interface test is a test for interfaces among system components and is used for checking whether the functions of parameter transmission, output result and the like of the interfaces are normal.
The existing interface testing tool can only test a certain interface and cannot be used for associating a plurality of interfaces. In a service scenario, a plurality of inter-related interfaces are involved, and one interface test needs to rely on a plurality of interfaces before and after to complete the test of the service scenario.
In addition, existing interface test tools cannot dynamically change behavior in the execution of interface tests, such as execution mode, checkpointing, etc. Therefore, the existing interface testing tool has single function and cannot meet the interface testing requirement in a business scene.
It should be noted that the information disclosed in the foregoing background section is only for enhancement of understanding of the background of the invention and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art.
Disclosure of Invention
In view of this, the present invention provides a method, a system, an electronic device, and a storage medium for testing an interface of a service scenario, which can meet the requirements of testing the interface of the service scenario, correlate each test case under the service scenario, and implement flexible configuration of an execution mode and a check point.
One aspect of the present invention provides a method for testing an interface of a service scenario, including: obtaining a test case of a service scene according to a test request of the service scene; judging whether the test case has an associated front-end test case, if so, calling and executing the front-end test case, wherein an interface corresponding to the front-end test case is a front-end associated interface of an interface corresponding to the test case; executing the test case in a circulating way according to the circulating parameters of the test case; judging whether the test case has an associated post-test case or not, if so, calling and executing the post-test case, wherein an interface corresponding to the post-test case is a post-associated interface of an interface corresponding to the test case; and verifying the test data of the test case according to the check point of the test case.
In some embodiments, the checkpoints include one or more checkpoints respectively configured in one or more testing procedures of the test case; the step of verifying the test data of the test case comprises the following steps: verifying whether test data of a test process preceding a check point conforms to configuration data based on the check point; if yes, judging that the test data of the test process before the check point is normal; and if not, judging that the test data of the test process before the check point is abnormal, and positioning the test process corresponding to the abnormal test data.
In some embodiments, the pre-test cases include one or more, and each pre-test case is invoked to be executed in sequence before the test case is executed according to the execution sequence of each pre-test case; the step of calling and executing the front test case comprises the following steps: judging whether a pre-test case has an associated pre-test case or not, if so, calling and executing the pre-test case before calling and executing the pre-test case; and judging whether the pre-test case has an associated pre-test case or not, if so, calling and executing the pre-test case after calling and executing the pre-test case.
In some embodiments, the loop parameters include a number of loop executions and a latency after each execution; and executing the test case in a circulating way according to the circulating execution times and the waiting time after each execution.
In some embodiments, the post test cases include one or more, and according to the execution sequence of each post test case, each post test case is invoked to be executed in turn after the test case is executed; the step of calling and executing the post test case comprises the following steps: judging whether a post test case has an associated re-pre-test case or not, if so, calling and executing the re-pre-test case before calling and executing the post test case; and judging whether the post test case has the associated post test case again, if so, calling and executing the post test case again after calling and executing the post test case.
In some embodiments, the interface test method further includes a step of configuring a front test case, the step of configuring the front test case including: according to the service scene, obtaining a front-end associated interface on which an interface corresponding to the test case depends in the service scene; obtaining a test case of the pre-associated interface as a pre-test case; and configuring the relation of the front test cases into the test cases, and setting the execution sequence of the front test cases to be earlier than that of the test cases.
In some embodiments, the interface test method further includes a step of configuring a post test case, the step of configuring the post test case including: obtaining a post-related interface on which an interface corresponding to the test case depends in the service scene according to the service scene; obtaining a test case of the post-related interface as a post-test case; and configuring the post test case association to the test case, and setting the execution sequence of the post test case to be later than that of the test case.
Another aspect of the present invention provides an interface test system for a service scenario, including: the triggering module is used for obtaining test cases of the service scene according to the test request of the service scene; the front-end execution module is used for judging whether the test case has the associated front-end test case or not, if so, calling and executing the front-end test case, wherein the interface corresponding to the front-end test case is a front-end associated interface of the interface corresponding to the test case; the test case execution module is used for circularly executing the test case according to the circulation parameters of the test case; the post execution module is used for judging whether the test case has the related post test case, if so, calling and executing the post test case, wherein the interface corresponding to the post test case is a post related interface of the interface corresponding to the test case; and the verification module is used for verifying the test data of the test case according to the check point of the test case.
Yet another aspect of the present invention provides an electronic device, comprising: a processor; a memory having stored therein executable instructions of the processor; wherein the processor is configured to perform the steps of the method for testing an interface of a business scenario described in any of the embodiments above via execution of the executable instructions.
A further aspect of the present invention provides a computer readable storage medium storing a program, wherein the program is executed to implement the steps of the method for testing an interface of a service scenario according to any of the above embodiments.
Compared with the prior art, the invention has the beneficial effects that at least:
in the execution process of the test cases, the correlation calling between the test cases and the test cases of the correlation interfaces of the interfaces corresponding to the test cases is realized by calling and executing the front test cases/the rear test cases;
executing the test case and verifying according to the circulation parameters of the test case and the check point, wherein the execution mode and the check point can be flexibly configured according to the requirements of the service scene;
therefore, the invention can realize the interface test of the whole service scene, correlate and execute each test case in the service scene, and realize the flexible configuration of the execution mode and the check point.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is evident that the figures described below are only some embodiments of the invention, from which other figures can be obtained without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram illustrating steps of an interface testing method of a service scenario in an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating steps of an execution process of a front-end test case according to an embodiment of the present invention;
FIGS. 3 and 4 are schematic page views illustrating a configuration process of a front test case in an embodiment of the present invention;
FIGS. 5 and 6 are schematic page views showing a configuration process of loop parameters in the embodiment of the present invention;
fig. 7 is a flow chart of an interface testing method of a service scenario in an embodiment of the present invention;
FIG. 8 is a schematic block diagram of an interface test system for a business scenario in an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention; and
fig. 10 shows a schematic configuration of a computer-readable storage medium in an embodiment of the present invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and thus a repetitive description thereof will be omitted.
Furthermore, the drawings are merely schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
Fig. 1 shows main steps of an interface testing method of a service scenario in an embodiment, and referring to fig. 1, the interface testing method of the service scenario in this embodiment mainly includes: in step S110, according to the test request of the service scenario, a test case of the service scenario is obtained; in step S120, it is determined whether the test case has an associated pre-test case, if yes, step S120-2 is executed, and the pre-test case is called and executed, where the interface corresponding to the pre-test case is a pre-associated interface of the interface corresponding to the test case; in step S130, according to the cycle parameters of the test cases, the test cases are executed in a cycle; in step S140, it is determined whether the test case has an associated post-test case, if yes, step S140-2 is executed, and the post-test case is called and executed, where the interface corresponding to the post-test case is a post-associated interface of the interface corresponding to the test case; and in step S150, verifying the test data of the test case according to the check point of the test case.
In one test case, one or more check points can be configured according to the requirements of a service scene, and the check points are respectively positioned in one or more steps of test procedures of the test case. When the check point is configured in the middle test process of the test case, verifying the test data of the test process which is already executed before in the process from the test case execution to the middle test process; when the check point is configured in the last test process of the test case, verifying the test data of all the test processes after the test process of the test case is executed. Specifically, the step of verifying the test data of the test case includes: verifying whether test data of a test process before a check point accords with configuration data based on the check point; if yes, judging that the test data of the test process before the check point is normal, and continuing the subsequent test process; if not, judging that the test data of the test process before the check point is abnormal, and locating the test process corresponding to the abnormal test data, and jumping to the abnormal test process or marking the abnormal test process and continuing the subsequent test process. By setting the check points, the abnormal problems of the interface can be found in time.
In the execution process of the test cases, the correlation calling between the test cases and the test cases of the correlation interfaces of the interfaces corresponding to the test cases is realized by calling and executing the front test cases and the rear test cases, so that the interface test of the whole service scene is realized. The front test cases and the rear test cases can be configured according to the requirements of a service scene, the front test cases and the rear test cases can comprise one or more, and in the interface test process of the service scene, each front test case is called and executed in sequence before the test cases are executed according to the execution sequence of each front test case respectively; and calling and executing each post test case in turn after the test case is executed according to the execution sequence of each post test case. Each pre-test case can be associated with the test case of the associated interface of the corresponding interface, so that the associated test case of the pre-test case is called in an associated manner in the process of executing each pre-test case. Similarly, each post test case can be associated with the test case of the associated interface of the corresponding interface, so that the associated test case of the post test case is called in an associated manner in the process of executing each post test case. Thus, the associated execution of each associated interface test case under the whole service scene is realized, so as to complete the complete service scene test.
Specifically, referring to the execution process of the front test case shown in fig. 2, the process of calling and executing a front test case in step S120-2 includes: step S120-21, judging whether the pre-test case has the associated pre-test case, if so, executing step S120-22, calling and executing the pre-test case; step S120-23 is executed, and the front test case is called and executed; after the pre-test case is called and executed, the steps S120-24 are executed, whether the pre-test case has an associated pre-test case is judged, if yes, the steps S120-25 are executed, and the pre-test case is called and executed so as to complete the calling and execution of the pre-test case and the associated test case. When the pre-front test case and the pre-back test case are called and executed, the call execution of the pre-front test case/the pre-back test case and the related test case is realized through similar related call steps.
Similarly, the step of calling and executing the post test case includes: judging whether a post test case has an associated re-pre test case, if so, calling and executing the re-pre test case before calling and executing the post test case; and judging whether the post test case has the associated post test case again, if so, calling and executing the post test case again after calling and executing the post test case so as to complete the calling and executing of the post test case and the associated test case. When the re-front test case and the re-rear test case are called and executed, the call execution of the re-front test case/the re-rear test case and the associated test case is realized through similar associated calling steps.
When the related front-end test cases are needed to be added in the test cases of the service scene, the configuration mode can be adopted. The step of configuring the front test case specifically comprises the following steps: according to the service scene, obtaining a front-end associated interface on which an interface corresponding to the test case depends in the service scene; obtaining a test case of a pre-associated interface as a pre-test case; and configuring the correlation of the pre-test cases into the test cases, and setting the execution sequence of the pre-test cases to be earlier than that of the test cases. Similarly, when the interfaces corresponding to the test cases of the service scene have the dependent post-related interfaces, the post-test cases corresponding to the post-related interfaces need to be configured in the test cases. The step of configuring the post test case specifically comprises the following steps: according to the service scene, obtaining a post-related interface on which an interface corresponding to the test case depends in the service scene; obtaining a test case of a rear-mounted associated interface as a rear-mounted test case; and configuring the post test case association into the test case, and setting the execution sequence of the post test case later than the execution sequence of the test case.
Fig. 3 and 4 show a page for configuring a front test case in the embodiment, and referring to fig. 3, in the specific configuration, in the TestCenter (which is a test management tool), in the configuration page 310 of the current test case 31, which is identified as, for example, "Http case [483478]", the front/rear configuration tab 311 is selected, and one front test case 313 is added by the "add" option 312, and the Id thereof is, for example, "case [482957]". The type of the front test case 313 may be selected as "service_action" or "service_query", and in this embodiment, the type of the front test case 313 is configured as "service_action", for example. In the configuration column of the pre-test case 313, the execution order thereof may be configured, for example, to select to execute the pre-test case 313 before a certain step of the test case 31. The pre-test case 313 may optionally be executed before or after the checkpoints of test case 31. In the configuration column of the pre-test case 313, the pre-test case 313 may also be deleted by an "operation" item, or the pre-test case and/or the pre-post-test case may be reconfigured for the pre-test case 313. In the configuration page 310, other parameters of the test case 31 may also be configured in the tab column by tabs such as "input variable," "configuration checkpoint," "available environment variable," "output variable," and the like. Finally clicking on the "execute" item 314 pops up the execution configuration page 3130 of the front test case 313 shown in FIG. 4. Referring to fig. 4, a pre-test case 313 to be executed is selected, and the execution order of the pre-test case 313 is set in a field 315 in which the execution order is set. Clicking the "execute" key 316 obtains the response content of the execution configuration of the pre-test case 313. Whether to generate a configuration or cancel a reconfiguration may be finally determined according to the response contents.
The configuration process of the post test case is the same as that of the pre test case shown in fig. 3 and 4, and thus the description will not be repeated. The post test case is configured to be executed at a certain step after the test case, the type of the post test case is selected, for example, the type is "service_query", and the post test case is configured with a pre-test case and/or a post test case according to the requirement. Through the configuration of the front test case and the rear test case, the problem that one interface is associated with a plurality of interfaces in a service scene is solved, the fact that one case is associated with a plurality of cases is achieved, the front and rear execution sequences of the plurality of test cases are configured according to the service scene, and finally complete service scene test is achieved.
Further, in the interface test of the service scenario, a certain test process needs to wait for a period of time before executing a subsequent test process or a check point, or a certain test process needs to be repeatedly executed for a plurality of times before executing a subsequent associated interface test case and check point. The interface test requirements of the service scene can be flexibly adapted by configuring the circulation parameters and check points of the test cases. Configuration of checkpoints as described above, one or more checkpoints may be configured during one or more testing steps of a test case according to the requirements of a business scenario. The cycle parameters of the test case specifically comprise cycle execution times and waiting time after each execution; and in the process of executing the test cases, executing the test cases circularly according to the times of executing the circularly and the waiting time after each execution.
Fig. 5 and 6 illustrate the configuration process of Loop parameters in the embodiment, referring to fig. 5, in the configuration page 310 of the test case 31 (labeled "Http case [470054 ]"), loop configuration is added to the "input variable" tag 317 to solve the problem that the interface test needs to be repeatedly executed. The input variables can be added singly or edited in batches. If an input variable references a parameter in a pre-test case that has been configured, replication may be directly referenced. In the configuration column of the input variables, the configuration page 3180 of the Loop parameters shown in fig. 6 can be popped out by selecting the Loop type 318. In fig. 5, other parameters of the input variables, such as variable names, default values, etc., may also be configured. Referring to fig. 6, in the configuration page 3180 of the Loop parameter, the required execution number is input in the "execution number" box, a specific time value is input in the "waiting time after each execution" box, and the Loop parameter configuration is completed after the determination. The Loop parameter configuration realizes the problems that the interface test needs to be repeatedly executed in certain scenes and needs to wait for a period of time after each execution is finished. For example, after the interface test is performed, a period of time is required for the data to fall into the database to perform the verification of the SQL query type.
Through the configuration of the pre-test case/post-test case and the loop parameters, in a specific application example, referring to the flowchart shown in fig. 7, in the interface regression test after the configuration is completed, step S710 triggers the test case a according to the triggering condition, which may be a timing task or be triggered by the test case association of other interfaces. Then, step S720-1 executes "service_action 1" configured in test case A, and step S720-2 calls pre-test case B. Then, step S720-3 executes "service_action 2" configured in test case A, and step S720-4 calls the front test case C. After the call execution of each front test case is completed, step S730-1 is configured according to the Loop parameter, for example, "Loop execution is performed 2 times, and after each execution, the execution waits 3 seconds", and by executing the test case a in step S730-2 and waiting for two loops of 3 seconds after the execution of step S730-3, the execution of the test case a is completed. And then calling each post test case configured by the execution test case A, wherein the method specifically comprises the following steps: step S740-1 executes "service_query1" configured in test case A, and the post test case D is called through step S740-2. Then step S740-3 executes "service_query2" configured in test case A, and the post test case E is called through step S740-4. And finally, verifying the check point configured in the test case A through the step S750, and completing the execution and verification of the test case A and the associated test cases thereof, thereby completing the interface test of the whole business scene.
According to the interface test method, in the execution process of the test cases of the service scene, the front test cases and/or the rear test cases of the execution test cases are related and called, the interface test corresponding to the test cases and the interface test corresponding to the front test cases and/or the rear test cases are related and dependent on the service scene, and therefore the test of the whole service scene is achieved. The front test case, the rear test case, the cycle parameters and check points of the test cases can be flexibly configured, and the execution sequence, the cycle execution times and the waiting time after the execution of each test case are set so as to meet the service scene requirement.
The embodiment of the invention also provides an interface test system of the service scene, which is used for realizing the interface test method of the service scene described in each embodiment. Fig. 8 shows main modules of an interface test system of a service scenario in an embodiment, and referring to fig. 8, the interface test system of a service scenario in this embodiment mainly includes: the triggering module 510 is configured to obtain a test case of the service scenario according to the test request of the service scenario. The triggering module 510 may be configured to implement the triggering steps of the test case described in the interface test method embodiment of any of the above-described service scenarios. The pre-execution module 520 is configured to determine whether the test case has an associated pre-test case, and if so, call to execute the pre-test case, where the interface corresponding to the pre-test case is a pre-associated interface of the interface corresponding to the test case. The pre-execution module 520 may be configured to implement the call execution steps of the pre-test case described in the interface test method embodiment of any of the above-described service scenarios. The test case execution module 530 is configured to execute the test case in a cyclic manner according to the cyclic parameters of the test case. The test case execution module 530 may be configured to implement the execution steps of the test case described in the interface test method embodiment of any of the above-described service scenarios. The post-execution module 540 is configured to determine whether the test case has an associated post-test case, and if so, call to execute the post-test case, where the interface corresponding to the post-test case is a post-associated interface of the interface corresponding to the test case. The post-execution module 540 may be configured to implement the call execution steps of the post-test case described in the interface test method embodiment of any of the above-described service scenarios. And a verification module 550, configured to verify the test data of the test case according to the check point of the test case. The verification module 550 may be configured to implement the verification step of the test data described in the interface test method embodiment of any of the above-described service scenarios.
According to the interface test system, in the execution process of the test cases of the service scene, the front test cases and/or the rear test cases of the execution test cases are related and called, the interface tests corresponding to the test cases and the interface tests corresponding to the front test cases and/or the rear test cases are related and dependent on the service scene, and therefore the test of the whole service scene is achieved. The front test case, the rear test case, the cycle parameters and check points of the test cases can be flexibly configured, and the execution sequence, the cycle execution times and the waiting time after the execution of each test case are set so as to meet the service scene requirement.
The embodiment of the invention also provides an electronic device, which comprises a processor and a memory, wherein executable instructions are stored in the memory, and the processor is configured to execute the steps of the interface testing method of the business scenario in the embodiment through executing the executable instructions.
As described above, the electronic device of the invention can realize that the front test case and/or the rear test case of the execution test case are related and called in the execution process of the test case of the service scene, and realize that the interface test corresponding to the test case and the interface test corresponding to the front test case and/or the rear test case are related and dependent on the service scene, thereby realizing the test of the whole service scene. The front test case, the rear test case, the cycle parameters and check points of the test cases can be flexibly configured, and the execution sequence, the cycle execution times and the waiting time after the execution of each test case are set so as to meet the service scene requirement.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and it should be understood that fig. 9 is only a schematic diagram illustrating each module, and these modules may be virtual software modules or actual hardware modules, and the combination, splitting and addition of the remaining modules are all within the scope of the present invention.
Those skilled in the art will appreciate that the various aspects of the invention may be implemented as a system, method, or program product. Accordingly, aspects of the invention may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" platform.
The electronic device 600 of the present invention is described below with reference to fig. 9. The electronic device 600 shown in fig. 9 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 9, the electronic device 600 is in the form of a general purpose computing device. Components of electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one memory unit 620, a bus 630 connecting the different platform components (including memory unit 620 and processing unit 610), a display unit 640, etc.
The storage unit stores therein a program code executable by the processing unit 610, so that the processing unit 610 performs the steps of the interface test method of the service scenario described in the above embodiment. For example, the processing unit 610 may perform the steps shown in fig. 1, 2, and 7.
The storage unit 620 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 6201 and/or cache memory unit 6202, and may further include Read Only Memory (ROM) 6203.
The storage unit 620 may also include a program/utility 6204 having one or more program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 630 may be a local bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 700, which external devices 700 may be one or more of a keyboard, pointing device, bluetooth device, etc. These external devices 700 enable a user to interactively communicate with the electronic device 600. The electronic device 600 can also communicate with one or more other computing devices, including a router, modem, and the like. Such communication may occur through an input/output (I/O) interface 650. Also, electronic device 600 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 600, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage platforms, and the like.
The embodiment of the invention also provides a computer readable storage medium for storing a program, which when executed, implements the steps of the interface testing method of the service scenario described in the above embodiment. In some possible implementations, the aspects of the present invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps of the interface testing method of the traffic scenario described in the above embodiments, when the program product is run on the terminal device.
As described above, the computer readable storage medium of the present invention can implement that, in the execution process of the test cases of the service scenario, the front test cases and/or the rear test cases of the execution test cases are related and called, and the interface tests corresponding to the test cases and the interface tests corresponding to the front test cases and/or the rear test cases are related and dependent on the service scenario, thereby implementing the test of the whole service scenario. The front test case, the rear test case, the cycle parameters and check points of the test cases can be flexibly configured, and the execution sequence, the cycle execution times and the waiting time after the execution of each test case are set so as to meet the service scene requirement.
Fig. 10 is a schematic structural view of a computer-readable storage medium of the present invention. Referring to fig. 10, a program product 800 for implementing the above-described method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the readable storage medium include, but are not limited to: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device, such as through the Internet using an Internet service provider.
The foregoing is a further detailed description of the invention in connection with the preferred embodiments, and it is not intended that the invention be limited to the specific embodiments described. It will be apparent to those skilled in the art that several simple deductions or substitutions may be made without departing from the spirit of the invention, and these should be considered to be within the scope of the invention.

Claims (7)

1. The interface testing method for the service scene is characterized by comprising the following steps:
obtaining a test case of a service scene according to a test request of the service scene;
judging whether the test case has an associated front-end test case, if so, calling and executing the front-end test case, wherein an interface corresponding to the front-end test case is a front-end associated interface of an interface corresponding to the test case;
the front test cases comprise one or more front test cases, and each front test case is called and executed in sequence before the test case is executed according to the execution sequence of each front test case; the step of calling and executing the front test case comprises the following steps: judging whether a pre-test case has an associated pre-test case or not, if so, calling and executing the pre-test case before calling and executing the pre-test case; judging whether the pre-test case has an associated pre-test case or not, if so, calling and executing the pre-test case after calling and executing the pre-test case;
the test case is circularly executed according to the circulation parameters of the test case, wherein the circulation parameters are configurable, the circulation parameters comprise circulation execution times and waiting time after each execution, and the circulation execution of the test case comprises circulation execution of the test case according to the circulation execution times and the waiting time after each execution;
judging whether the test case has an associated post-test case or not, if so, calling and executing the post-test case, wherein an interface corresponding to the post-test case is a post-associated interface of an interface corresponding to the test case;
the post test cases comprise one or more post test cases, and each post test case is called and executed in sequence after the test case is executed according to the execution sequence of each post test case; the step of calling and executing the post test case comprises the following steps: judging whether a post test case has an associated re-pre-test case or not, if so, calling and executing the re-pre-test case before calling and executing the post test case; judging whether the post test case has the associated post test case, if so, calling and executing the post test case after calling and executing the post test case; and
and verifying the test data of the test case according to the check point of the test case.
2. The interface testing method of claim 1, wherein the checkpoints comprise one or more checkpoints respectively configured in one or more testing procedures of the test case;
the step of verifying the test data of the test case comprises the following steps:
verifying whether test data of a test process preceding a check point conforms to configuration data based on the check point;
if yes, judging that the test data of the test process before the check point is normal; and
if not, judging that the test data of the test process before the check point is abnormal, and locating the test process corresponding to the abnormal test data.
3. The interface test method of claim 1, further comprising the step of configuring a front test case, the step of configuring the front test case comprising:
according to the service scene, obtaining a front-end associated interface on which an interface corresponding to the test case depends in the service scene;
obtaining a test case of the pre-associated interface as a pre-test case;
and configuring the relation of the front test cases into the test cases, and setting the execution sequence of the front test cases to be earlier than that of the test cases.
4. The interface test method of claim 1, further comprising the step of configuring a post test case, the step of configuring the post test case comprising:
obtaining a post-related interface on which an interface corresponding to the test case depends in the service scene according to the service scene;
obtaining a test case of the post-related interface as a post-test case;
and configuring the post test case association to the test case, and setting the execution sequence of the post test case to be later than that of the test case.
5. An interface test system for a business scenario, comprising:
the triggering module is used for obtaining test cases of the service scene according to the test request of the service scene;
the front-end execution module is used for judging whether the test case has the associated front-end test case or not, if so, calling and executing the front-end test case, wherein the interface corresponding to the front-end test case is a front-end associated interface of the interface corresponding to the test case;
the front test cases comprise one or more front test cases, and each front test case is called and executed in sequence before the test case is executed according to the execution sequence of each front test case; the step of calling and executing the front test case by the front execution module comprises the following steps: judging whether a pre-test case has an associated pre-test case or not, if so, calling and executing the pre-test case before calling and executing the pre-test case; judging whether the pre-test case has an associated pre-test case or not, if so, calling and executing the pre-test case after calling and executing the pre-test case;
the test case execution module is used for circularly executing the test case according to the circulation parameters of the test case, wherein the circulation parameters are configurable, the circulation parameters comprise circulation execution times and waiting time after each execution, and the circulation execution of the test case comprises circulation execution of the test case according to the circulation execution times and the waiting time after each execution;
the post execution module is used for judging whether the test case has the related post test case, if so, calling and executing the post test case, wherein the interface corresponding to the post test case is a post related interface of the interface corresponding to the test case;
the post test cases comprise one or more post test cases, and each post test case is called and executed in sequence after the test case is executed according to the execution sequence of each post test case; the step of calling and executing the post test case by the post execution module comprises the following steps: judging whether a post test case has an associated re-pre-test case or not, if so, calling and executing the re-pre-test case before calling and executing the post test case; judging whether the post test case has the associated post test case, if so, calling and executing the post test case after calling and executing the post test case; and
and the verification module is used for verifying the test data of the test case according to the check point of the test case.
6. An electronic device, comprising:
a processor;
a memory having stored therein executable instructions of the processor;
wherein the processor is configured to perform the steps of the interface testing method of the traffic scenario of any one of claims 1 to 4 via execution of the executable instructions.
7. A computer-readable storage medium storing a program, wherein the program when executed implements the steps of the interface testing method of a business scenario according to any one of claims 1 to 4.
CN202010317717.4A 2020-04-21 2020-04-21 Interface testing method, system, electronic equipment and storage medium of business scene Active CN111538659B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010317717.4A CN111538659B (en) 2020-04-21 2020-04-21 Interface testing method, system, electronic equipment and storage medium of business scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010317717.4A CN111538659B (en) 2020-04-21 2020-04-21 Interface testing method, system, electronic equipment and storage medium of business scene

Publications (2)

Publication Number Publication Date
CN111538659A CN111538659A (en) 2020-08-14
CN111538659B true CN111538659B (en) 2024-03-01

Family

ID=71953521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010317717.4A Active CN111538659B (en) 2020-04-21 2020-04-21 Interface testing method, system, electronic equipment and storage medium of business scene

Country Status (1)

Country Link
CN (1) CN111538659B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181845A (en) * 2020-10-13 2021-01-05 湖南快乐阳光互动娱乐传媒有限公司 Interface testing method and device
CN112463588A (en) * 2020-11-02 2021-03-09 北京健康之家科技有限公司 Automatic test system and method, storage medium and computing equipment
CN112579455A (en) * 2020-12-23 2021-03-30 安徽航天信息有限公司 Interface automatic testing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844421A (en) * 2017-10-31 2018-03-27 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium
CN107861870A (en) * 2017-11-02 2018-03-30 平安科技(深圳)有限公司 Interface testing and test data generating method, device, terminal and storage medium
CN108153670A (en) * 2017-11-30 2018-06-12 北京奇艺世纪科技有限公司 A kind of interface test method, device and electronic equipment
CN108491322A (en) * 2018-03-06 2018-09-04 平安科技(深圳)有限公司 Automated testing method, device and storage medium
CN110287117A (en) * 2019-06-27 2019-09-27 江苏满运软件科技有限公司 RESTful interface test method, system, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10339485B2 (en) * 2012-12-14 2019-07-02 International Business Machines Corporation Efficiently generating test cases

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844421A (en) * 2017-10-31 2018-03-27 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium
CN107861870A (en) * 2017-11-02 2018-03-30 平安科技(深圳)有限公司 Interface testing and test data generating method, device, terminal and storage medium
CN108153670A (en) * 2017-11-30 2018-06-12 北京奇艺世纪科技有限公司 A kind of interface test method, device and electronic equipment
CN108491322A (en) * 2018-03-06 2018-09-04 平安科技(深圳)有限公司 Automated testing method, device and storage medium
CN110287117A (en) * 2019-06-27 2019-09-27 江苏满运软件科技有限公司 RESTful interface test method, system, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Larry V. Kirkland Etc..Recurrent TPS development issues or ascertaining the excellence of an automated unit test.2016 IEEE AUTOTESTCON.2016,全文. *
卓欣欣 ; 白晓颖 ; 许静 ; 李恩鹏 ; 刘喻 ; 康介恢 ; 宋文莉 ; .服务接口测试自动化工具的研究.计算机研究与发展.2018,(02),全文. *
李俊蒂.一种通用型配网管理终端自动调试及检验系统的研发.中国优秀硕士论文电子期刊网.2018,全文. *

Also Published As

Publication number Publication date
CN111538659A (en) 2020-08-14

Similar Documents

Publication Publication Date Title
CN111538659B (en) Interface testing method, system, electronic equipment and storage medium of business scene
CN106649084B (en) The acquisition methods and device of function call information, test equipment
US7996816B2 (en) Method and apparatus for dynamically binding service component implementations for specific unit test cases
CN109951547B (en) Transaction request parallel processing method, device, equipment and medium
US10146668B1 (en) Modeling code coverage in software life cycle
CN112765023B (en) Test case generation method and device
CN112463144B (en) Distributed storage command line service method, system, terminal and storage medium
CN107729246B (en) Auxiliary test method, device and equipment for target application and storage medium
CN110673936B (en) Breakpoint continuous operation method and device for arrangement service, storage medium and electronic equipment
CN107045475B (en) Test method and device
US9201897B1 (en) Global data storage combining multiple back-end storage devices
CN113505895B (en) Machine learning engine service system, model training method and configuration method
CN113220403B (en) Method and device for h5 intercepting Android return event and electronic equipment
CN113656304A (en) Method and device for testing front-end application program and storage medium
CN111061522B (en) Method, device, equipment and storage medium for generating front-end card assembly based on back end
CN110045952B (en) Code calling method and device
US20230101154A1 (en) Resumable instruction generation
CN114911541A (en) Configuration information processing method and device, electronic equipment and storage medium
CN110221952B (en) Service data processing method and device and service data processing system
CN113609014A (en) Interface field checking method and device, storage medium and electronic equipment
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
CN113220586A (en) Automatic interface pressure test execution method, device and system
CN112559346A (en) Service testing method and device
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN113868030B (en) CPU test tool self-adaptive matching method, system, terminal and storage medium

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