CN113590483A - Case operation method and device - Google Patents

Case operation method and device Download PDF

Info

Publication number
CN113590483A
CN113590483A CN202110871136.XA CN202110871136A CN113590483A CN 113590483 A CN113590483 A CN 113590483A CN 202110871136 A CN202110871136 A CN 202110871136A CN 113590483 A CN113590483 A CN 113590483A
Authority
CN
China
Prior art keywords
scene
use case
return value
determining
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110871136.XA
Other languages
Chinese (zh)
Inventor
刘爱慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information 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 Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202110871136.XA priority Critical patent/CN113590483A/en
Publication of CN113590483A publication Critical patent/CN113590483A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

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

Abstract

The application discloses a case operation method and a case operation device, which relate to the technical field of computers, and the specific implementation mode comprises the steps of receiving a case operation request and obtaining a scene identifier in the case operation request; determining an external interface to be simulated according to the scene identifier, and generating a corresponding simulated interface return value according to the scene identifier and the external interface; and running the use case, and calling a corresponding simulation interface return value according to the scene identifier to generate a use case running result. Therefore, the matching scene identification and the corresponding simulation interface return value are preset, and the corresponding simulation interface return value is dynamically taken out according to the scene identification when the use case is executed, so that the simulation interface return value is prevented from being frequently modified in the execution process, the error probability of the simulation interface return value is reduced, and the use case operation efficiency is improved.

Description

Case operation method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for running a use case.
Background
In the testing process, the system often depends on the external interface, and when the external interface is not developed, the system needs to be tested in a mode of simulating a return value of the external interface. And each time the execution of the use case is carried out, if the use case is data-driven, the return value of the simulated external interface needs to be manually modified and then the test is carried out.
In the process of implementing the present application, the inventor finds that at least the following problems exist in the prior art:
when the use case is executed once, the data returned by the simulation interface needs to be manually maintained according to different scenes every time, so that the workload is large, errors are easy to occur, and the progress of the use case test is slow.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for running a use case, which can solve the problems that in the prior art, each time a use case is executed, it is necessary to manually maintain data of a return value of a simulation interface according to different scenarios, a workload is large, an error is prone to occur, and a progress of a use case test is slow.
In order to achieve the above object, according to an aspect of the embodiments of the present application, there is provided a use case running method, including:
receiving a use case operation request, and acquiring a scene identifier in the use case operation request;
determining an external interface to be simulated according to the scene identifier, and generating a corresponding simulated interface return value according to the scene identifier and the external interface;
and running the use case, and calling a corresponding simulation interface return value according to the scene identifier to generate a use case running result.
Optionally, determining an external interface to be simulated according to the scene identifier includes:
determining an external interface to be called according to the scene identification;
and determining the external interface which is empty in return value and needs to be called as the external interface which needs to be simulated.
Optionally, generating a corresponding analog interface return value according to the scene identifier and the external interface, including:
determining scene use case requirement information according to the scene identification;
determining an input parameter format and an output parameter format of an external interface;
and generating a corresponding simulation interface return value according to the scene use case requirement information, the input parameter format and the output parameter format.
Optionally, determining the scene use case requirement information according to the scene identifier includes:
determining a corresponding scene keyword according to the scene identifier;
and determining scene use case requirement information based on the corresponding scene keywords.
Optionally, before running the use case, the method further includes:
and storing the scene keywords corresponding to the same scene identifier and the return values of the simulation interfaces in a one-to-one correspondence manner.
Optionally, according to the scene identifier, invoking a corresponding simulation interface return value to generate a use case operation result, including:
and calling a corresponding simulation interface return value according to the scene keyword corresponding to the scene identifier, and further generating a use case operation result.
In addition, the present application further provides a use case running apparatus, including:
the receiving unit is configured to receive a use case operation request and acquire a scene identifier in the use case operation request;
the generating unit is configured to determine an external interface to be simulated according to the scene identifier, and generate a corresponding simulated interface return value according to the scene identifier and the external interface;
and the operation unit is configured to operate the use case, and then calls the corresponding simulation interface return value according to the scene identifier to generate a use case operation result.
Optionally, the generating unit is further configured to:
determining an external interface to be called according to the scene identification;
and determining the external interface which is empty in return value and needs to be called as the external interface which needs to be simulated.
Optionally, the generating unit is further configured to:
determining scene use case requirement information according to the scene identification;
determining an input parameter format and an output parameter format of an external interface;
and generating a corresponding simulation interface return value according to the scene use case requirement information, the input parameter format and the output parameter format.
Optionally, the generating unit is further configured to:
determining a corresponding scene keyword according to the scene identifier;
and determining scene use case requirement information based on the corresponding scene keywords.
Optionally, the use case running apparatus further includes a storage unit configured to:
and storing the scene keywords corresponding to the same scene identifier and the return values of the simulation interfaces in a one-to-one correspondence manner.
Optionally, the execution unit is further configured to:
and calling a corresponding simulation interface return value according to the scene keyword corresponding to the scene identifier, and further generating a use case operation result.
In addition, the present application further provides a use case operation electronic device, including: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by one or more processors, the one or more processors realize the use case operation method.
In addition, the present application also provides a computer readable medium, on which a computer program is stored, which when executed by a processor implements the use case execution method as described above.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of receiving a use case operation request, and obtaining a scene identifier in the use case operation request; determining an external interface to be simulated according to the scene identifier, and generating a corresponding simulated interface return value according to the scene identifier and the external interface; and running the use case, and calling a corresponding simulation interface return value according to the scene identifier to generate a use case running result. Therefore, the matching scene identification and the corresponding simulation interface return value are preset, and the corresponding simulation interface return value is dynamically taken out according to the scene identification when the use case is executed, so that the simulation interface return value is prevented from being frequently modified in the execution process, the error probability of the simulation interface return value is reduced, the workload is reduced, and the use case operation efficiency is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a further understanding of the application and are not to be construed as limiting the application. Wherein:
fig. 1 is a schematic diagram of a main flow of a use case operation method according to a first embodiment of the present application;
FIG. 2 is a schematic diagram of a main flow of a use case execution method according to a second embodiment of the present application;
fig. 3 is a schematic view of an application scenario of a use case operation method according to a third embodiment of the present application;
FIG. 4 is a schematic diagram of the main elements of a use case execution apparatus according to an embodiment of the present application;
FIG. 5 is an exemplary system architecture diagram to which embodiments of the present application may be applied;
fig. 6 is a schematic structural diagram of a computer system suitable for implementing the terminal device or the server according to the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a use case operation method according to a first embodiment of the present application, and as shown in fig. 1, the use case operation method includes:
step S101, receiving a use case operation request, and acquiring a scene identifier in the use case operation request.
In this embodiment, an execution main body (for example, a server) of the use case running method may receive a use case running request sent by a user through a terminal device in a wired connection or wireless connection manner. A use case is a textual episode description that essentially discovers and records functional requirements by writing episodes that use the system to achieve a user's goals. Each use case provides one or more scenes, each scene has a corresponding scene identifier, and the scene describes how the system interacts with an end user or other systems, namely who can use the system to do what, so as to obtain a clear business goal. A Use Case (Use Case) is the definition and description of a coherent functional unit of a system or subsystem without revealing the internal structure of the system or subsystem. The Use Case describes a part of the overall system function, which is a relatively complete functional flow in logic. The use case running request may include scene identifications corresponding to the scenes. After receiving the use case operation request, the execution subject may obtain each scene identifier in the use case operation request.
And S102, determining an external interface to be simulated according to the scene identifier, and generating a corresponding simulated interface return value according to the scene identifier and the external interface.
Before running the use case, the execution main body needs to firstly judge whether the external interface needs to be called or not and whether the external interface needs to be simulated or not. And when the execution main body determines that the external interface needs to be called and does not need to be simulated, keeping the normal external interface calling and running the use case.
When the execution main body determines that the external interface needs to be called and needs to be simulated, that is, in some optional implementation manners of this embodiment, the external interface that needs to be simulated may be an interface that is needed for the operation of the use case and has not been developed yet, and in order not to affect the operation of the use case, the execution main body needs to simulate a return value of the external interface.
In some optional implementations of this embodiment, determining the external interface to be simulated according to the scene identifier includes:
determining an external interface to be called according to the scene identification; and determining the external interface which is empty in return value and needs to be called as the external interface which needs to be simulated. The return value is null, which may be that the external interface has been developed, but the execution subject does not obtain the return value based on the external interface. It may be that the external interface fails or otherwise causes the return value to be null. Then at this point the executing agent may determine the external interface as one that requires emulation.
And step S103, running the use case, and calling a corresponding simulation interface return value according to the scene identifier to generate a use case running result.
After the execution main body generates the simulation interface return value corresponding to each scene identifier in the use case operation request, before the use case is operated, the use case operation method further comprises the following steps: and determining scene keywords corresponding to the scene identification, and storing the scene keywords corresponding to the same scene identification and the return value of the simulation interface in a one-to-one correspondence manner.
In this embodiment, according to the scene identifier, invoking a corresponding return value of the simulation interface to generate a use case operation result, including: and calling a corresponding simulation interface return value according to the scene keyword corresponding to the scene identifier, and further generating a use case operation result. Specifically, the execution main body can integrally execute a scene required in the use case according to data driving, and in the execution process, a corresponding preset simulation interface return value is automatically acquired according to an input scene keyword so as to run the use case.
The embodiment obtains the scene identifier in the case operation request by receiving the case operation request; determining an external interface to be simulated according to the scene identifier, and generating a corresponding simulated interface return value according to the scene identifier and the external interface; and running the use case, and calling a corresponding simulation interface return value according to the scene identifier to generate a use case running result. Therefore, the matching scene identification and the corresponding simulation interface return value are preset, and the corresponding simulation interface return value is dynamically taken out according to the scene identification when the use case is executed, so that the simulation interface return value is prevented from being frequently modified in the execution process, the error probability of the simulation interface return value is reduced, the workload is reduced, and the use case operation efficiency is improved.
Fig. 2 is a schematic main flow diagram of a use case operation method according to a second embodiment of the present application, and as shown in fig. 2, the use case operation method includes:
step S201, receiving a use case operation request, and acquiring a scene identifier in the use case operation request.
Step S202, an external interface needing to be simulated is determined according to the scene identification, and a corresponding simulated interface return value is generated according to the scene identification and the external interface.
The principle of step S201 to step S202 is similar to that of step S101 to step S102, and is not described here again.
Specifically, step S202 can also be realized by step S2021 to step S2023:
step S2021, determining scene use case requirement information according to the scene identification.
The scenario use case requirement information in this embodiment may be information of when, where, and under what conditions a user encounters a problem when developing a new system or modifying software, and needs are generated to solve the problem. The scene use case requirement information may specifically include a requirement source, a requirement processing mode, a requirement for a requirement, and information obtained after analyzing the requirement. The requirement processing is to comprehensively and completely record the expression content of the user, including the expression content described and undescribed by the language (environment generated by the requirement of the user, work background of the requirement proposing person, condition of organization where the requirement proposing person is located, and the like). And the requirement analysis can restore the requirement of the user through the scene. The scene is the transformation of the demand, makes the demand more specific, and describes in more detail in a narrative mode. A demand can be broken down into several scenarios. The scenarios of the use cases may include situations under different conditions, such as normal, special, and abnormal conditions.
Determining scene use case requirement information according to the scene identification, wherein the determining of the scene use case requirement information comprises the following steps:
and determining a corresponding scene keyword according to the scene identifier.
After the execution subject obtains the scene identifier, a scene keyword corresponding to the scene identifier may also be determined. The scene keyword may be a brief description of a scene corresponding to the scene identifier. For example, the scenario identifier is 01, and the corresponding scenario keyword may be "transfer success". It is understood that the scene id is only one code, and the user cannot know the meaning of the scene id from the scene id. Therefore, the execution subject can match a keyword for each scene identifier in the use case running request to indicate the meaning of the scene identifier. Therefore, when a certain node of the use case operation outputs the scene identification, the user can accurately understand the meaning of the scene identification so as to make adaptive scene adjustment.
And determining scene use case requirement information based on the corresponding scene keywords.
For example, the scenario keyword may be "transfer normal" or "transfer abnormal", and the corresponding scenario use case requirement information may include, but is not limited to, an input parameter format and an output parameter format of an interface that needs to be simulated, and corresponding input parameter values and output parameter values that need to be given, and a parameter format corresponding to a system module interface that receives a return value of a simulation interface. The content included in the scene use case requirement information is not specifically limited. The input parameter format and the output parameter format of the interface to be simulated can be the same or different.
Step S2022, determine the input parameter format and the output parameter format of the external interface.
The input parameter format of the external interface can be a numerical value format, and the corresponding output parameter format can be a numerical value format or a text format; the input parameter format of the external interface may be a text format, and the corresponding output parameter format may be a text format or a numerical format. The execution main body can determine the parameter format corresponding to the system module interface for receiving the simulation interface return value in the scene use case requirement information as the output parameter format of the interface needing to be simulated. Then, the execution subject may select an input parameter format corresponding to the determined output parameter format from the adaptable parameter formats preset by the interface to be simulated as a format for simulating the input parameters of the external interface.
For example, when the parameter format corresponding to the system module interface that receives the return value of the simulation interface in the scene use case requirement information is a numerical value format, that is, when the output parameter format is a numerical value format in the parameter format adapted to the interface to be simulated, the preset format of the corresponding input parameter is a text format, and thus it can be determined that the required input parameter format is a text format and the output parameter format is a numerical value format when the external interface is simulated.
Step S2023, generating a corresponding simulation interface return value according to the scene case requirement information, the input parameter format and the output parameter format.
After determining the scene use case requirement information, the input parameter format and the output parameter format, the execution main body may assign values to the input parameters according to a logic algorithm in the interface to be simulated based on the scene use case requirement information, such as information that needs to be summed, subtracted or multiplied, and the like, and the required parameter format, and the like, and generate corresponding simulated interface return values.
For example, when transferring money, the amount of money transferred needs to be calculated first, and then the data drive can be performed to run the use case, and then the amount of money transferred calculated through the external interface is the return value of the interface to be simulated, and it can be determined that the input parameter format and the output parameter format of the interface to be simulated are respectively in a numerical value format. For example, if it is determined that the format of the return value of the simulation interface to be called is a numerical format according to the scenario keywords "transfer normal" and "transfer abnormal", assuming that the internal logic algorithm function of the interface to be simulated is a + b, the execution body may assign the input parameters a and b according to the scenario use case requirement information (for example, format information of the return value of the called simulation interface, that is, the output parameter format of the interface to be simulated), where, for example, the input parameters a and b are 1 and 8 in the case that the input parameter format is a numerical format, and the return value of the simulation interface is 9 in the case that the output parameter format is also a numerical format.
According to the method and the device, the corresponding return value of the simulation interface is generated according to the scene use case requirement information, the input parameter format and the output parameter format, so that the return value of the simulation interface can be generated more accurately.
Step S203, the use case is run, and then the corresponding simulation interface return value is called according to the scene identification, so as to generate a use case running result.
The principle of step S203 is similar to that of step S103, and is not described here.
Specifically, an overall embodiment of the present application may be divided into 5 steps, which are respectively to determine an external interface to be simulated (which needs to be called during use case operation); setting scene keywords and a return value of a simulation interface; storing scene keywords and return values of the simulation interface; running a use case; and dynamically taking values to obtain results. The system modules corresponding to the 5 steps are independent from each other, running codes are not mixed together, and calling among services is based on interfaces or services.
Specifically, an external interface to be simulated (called during use case operation) is determined, output parameters and input parameters of the interface to be simulated are determined first, and whether the input parameters and the output parameters of the interface to be simulated are directly filled in through a simulation tool or through a program simulation interface, the format of the output parameters and the format of the input parameters of the interface to be simulated are determined, and corresponding data are generated according to the requirements of a scene use case.
Specifically, setting scene keywords and return values of the simulation interface, determining use cases according to scene requirements, designing the number of the use cases and parameter values required to be transmitted according to data driving, describing each scene by using one keyword, needing a different return value of the external interface for each scene, writing the return values in advance, namely, each scene has the corresponding return value of the simulation interface. An example, such as method a, calls method a (of the external interface), and needs to import two parameters BC, when B is 1, return 1.1, and when B is 2, return 2.2. The values 1.1 and 2.2 are analog interface return values (i.e., mock values), and can be set corresponding to 1 and 2.
And storing the scene keywords and the return values of the simulation interfaces, and storing the return values of the simulation interfaces and the scene keywords in a one-to-one correspondence manner.
And (4) running the use case, integrally executing the required scene according to data driving, and automatically acquiring a preset simulation interface return value according to the transmitted scene key words in the execution process no matter manual or automatic, so as to run the use case.
And dynamically taking values to obtain a result, and dynamically taking out the return value of the simulation interface corresponding to the scene identifier to run the test case so as to ensure the normal running of the test case and further obtain a running result.
In the embodiment, the return values of the simulation interfaces are preset through multi-scene setting, so that the situation that the return values of the simulation interfaces are required to be set one by one in the execution process is avoided; and the use cases can be processed in batch, the probability of errors of the return value of the simulation interface is reduced, and the efficiency of running the use cases is improved.
Fig. 3 is a schematic view of an application scenario of a use case operation method according to a third embodiment of the present application. The use case operation method is applied to scenes needing external interfaces when use cases are operated. As shown in fig. 3, the server 303 receives the use case execution request 301, and obtains the scene identifier 302 in the use case execution request 301. The server 303 determines an external interface 304 to be simulated according to the scene identifier 302, and generates a corresponding simulated interface return value 305 according to the scene identifier 302 and the external interface 304. The server 303 runs the use case 306, and then calls the corresponding simulation interface return value 307 according to the scene identifier 302 to generate a use case running result 308.
Fig. 4 is a schematic diagram of main units of a use case execution apparatus according to an embodiment of the present application. As shown in fig. 4, the use case execution apparatus includes a receiving unit 401, a generating unit 402, and an executing unit 403.
The receiving unit 401 is configured to receive a use case operation request, and obtain a scene identifier in the use case operation request.
And the generating unit 402 is configured to determine an external interface to be simulated according to the scene identifier, and generate a corresponding simulated interface return value according to the scene identifier and the external interface.
And the running unit 403 is configured to run the use case, and further call the corresponding simulation interface return value according to the scene identifier to generate a use case running result.
In some embodiments, the generating unit 402 is further configured to: determining an external interface to be called according to the scene identification; and determining the external interface which is empty in return value and needs to be called as the external interface which needs to be simulated.
In some embodiments, the generating unit 402 is further configured to: determining scene use case requirement information according to the scene identification; determining an input parameter format and an output parameter format of an external interface; and generating a corresponding simulation interface return value according to the scene use case requirement information, the input parameter format and the output parameter format.
In some embodiments, the generating unit 402 is further configured to: determining a corresponding scene keyword according to the scene identifier; and determining scene use case requirement information based on the corresponding scene keywords.
In some embodiments, the use case execution apparatus further includes a storage unit, not shown in fig. 4, configured to: and storing the scene keywords corresponding to the same scene identifier and the return values of the simulation interfaces in a one-to-one correspondence manner.
In some embodiments, the execution unit 403 is further configured to: and calling a corresponding simulation interface return value according to the scene keyword corresponding to the scene identifier, and further generating a use case operation result.
It should be noted that, in the present application, the use case operation method and the use case operation device have a corresponding relationship in the specific implementation content, and therefore, the repeated content is not described again.
Fig. 5 illustrates an exemplary system architecture 500 to which the use case running method or the use case running apparatus according to the embodiment of the present application may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for use case execution requests submitted by users using the terminal devices 501, 502, 503. The background management server can receive a use case operation request and acquire a scene identifier in the use case operation request; determining an external interface to be simulated according to the scene identifier, and generating a corresponding simulated interface return value according to the scene identifier and the external interface; and running the use case, and calling a corresponding simulation interface return value according to the scene identifier to generate a use case running result. Therefore, the matching scene identification and the corresponding simulation interface return value are preset, and the corresponding simulation interface return value is dynamically taken out according to the scene identification when the use case is executed, so that the simulation interface return value is prevented from being frequently modified in the execution process, the error probability of the simulation interface return value is reduced, and the use case operation efficiency is improved.
It should be noted that the use case running method provided in the embodiment of the present application is generally executed by the server 505, and accordingly, the use case running apparatus is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a terminal device of an embodiment of the present application. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the computer system 600 are also stored. The CPU601, ROM602, and RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output section 607 including a signal processing section such as a Cathode Ray Tube (CRT), a liquid crystal credit authorization inquiry processor (LCD), and the like, and a speaker and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to embodiments disclosed herein, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments disclosed herein include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer 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. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a generating unit, and an executing unit. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs, and when the one or more programs are executed by one device, the device receives a use case operation request and acquires a scene identifier in the use case operation request; determining an external interface to be simulated according to the scene identifier, and generating a corresponding simulated interface return value according to the scene identifier and the external interface; and running the use case, and calling a corresponding simulation interface return value according to the scene identifier to generate a use case running result. Therefore, the matching scene identification and the corresponding simulation interface return value are preset, and the corresponding simulation interface return value is dynamically taken out according to the scene identification when the use case is executed, so that the simulation interface return value is prevented from being frequently modified in the execution process, the error probability of the simulation interface return value is reduced, and the use case operation efficiency is improved.
According to the technical scheme of the embodiment of the application, the scene identification in the case operation request is obtained by receiving the case operation request; determining an external interface to be simulated according to the scene identifier, and generating a corresponding simulated interface return value according to the scene identifier and the external interface; and running the use case, and calling a corresponding simulation interface return value according to the scene identifier to generate a use case running result. Therefore, the matching scene identification and the corresponding simulation interface return value are preset, and the corresponding simulation interface return value is dynamically taken out according to the scene identification when the use case is executed, so that the simulation interface return value is prevented from being frequently modified in the execution process, the error probability of the simulation interface return value is reduced, and the use case operation efficiency is improved.
The above-described embodiments should not be construed as limiting the scope of the present application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A use case running method is characterized by comprising the following steps:
receiving a use case operation request, and acquiring a scene identifier in the use case operation request;
determining an external interface to be simulated according to the scene identifier, and generating a corresponding simulated interface return value according to the scene identifier and the external interface;
and running the use case, and calling a corresponding simulation interface return value according to the scene identifier to generate a use case running result.
2. The method of claim 1, wherein determining the external interface to be simulated according to the scene identifier comprises:
determining an external interface to be called according to the scene identification;
and determining the external interface which is empty in return value and needs to be called as the external interface which needs to be simulated.
3. The method of claim 1, wherein generating a corresponding simulated interface return value based on the scene identifier and the external interface comprises:
determining scene use case demand information according to the scene identification;
determining an input parameter format and an output parameter format of the external interface;
and generating a corresponding simulation interface return value according to the scene use case requirement information, the input parameter format and the output parameter format.
4. The method according to claim 3, wherein the determining scene use case requirement information according to the scene identifier comprises:
determining a corresponding scene keyword according to the scene identifier;
and determining scene use case requirement information based on the corresponding scene keywords.
5. The method of claim 4, wherein prior to running the use case, the method further comprises:
and storing the scene keywords corresponding to the same scene identifier and the return values of the simulation interfaces in a one-to-one correspondence manner.
6. The method according to claim 5, wherein the invoking a corresponding simulation interface return value according to the scene identifier to generate a use case operation result comprises:
and calling a corresponding simulation interface return value according to the scene keyword corresponding to the scene identifier, and further generating a use case operation result.
7. A use case execution apparatus, comprising:
the receiving unit is configured to receive a use case operation request and acquire a scene identifier in the use case operation request;
the generating unit is configured to determine an external interface needing to be simulated according to the scene identifier, and generate a corresponding simulated interface return value according to the scene identifier and the external interface;
and the operation unit is configured to operate the use case, and then calls a corresponding simulation interface return value according to the scene identifier to generate a use case operation result.
8. The apparatus of claim 7, wherein the generating unit is further configured to:
determining an external interface to be called according to the scene identification;
and determining the external interface which is empty in return value and needs to be called as the external interface which needs to be simulated.
9. The apparatus of claim 7, wherein the generating unit is further configured to:
determining scene use case demand information according to the scene identification;
determining an input parameter format and an output parameter format of the external interface;
and generating a corresponding simulation interface return value according to the scene use case requirement information, the input parameter format and the output parameter format.
10. The apparatus of claim 9, wherein the generating unit is further configured to:
determining a corresponding scene keyword according to the scene identifier;
and determining scene use case requirement information based on the corresponding scene keywords.
11. A use case run electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
12. A computer-readable 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-6.
CN202110871136.XA 2021-07-30 2021-07-30 Case operation method and device Pending CN113590483A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110871136.XA CN113590483A (en) 2021-07-30 2021-07-30 Case operation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110871136.XA CN113590483A (en) 2021-07-30 2021-07-30 Case operation method and device

Publications (1)

Publication Number Publication Date
CN113590483A true CN113590483A (en) 2021-11-02

Family

ID=78252519

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110871136.XA Pending CN113590483A (en) 2021-07-30 2021-07-30 Case operation method and device

Country Status (1)

Country Link
CN (1) CN113590483A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120284695A1 (en) * 2011-05-04 2012-11-08 Jiri Olsa Error simulation
US8762694B1 (en) * 2003-02-19 2014-06-24 Intel Corporation Programmable event-driven yield mechanism
CN107656874A (en) * 2017-11-07 2018-02-02 中国银行股份有限公司 A kind of interface test method, device, simulation baffle plate and system
CN112597020A (en) * 2020-12-24 2021-04-02 平安普惠企业管理有限公司 Interface testing method and device, computer equipment and storage medium
CN112685291A (en) * 2020-12-22 2021-04-20 平安普惠企业管理有限公司 System joint test method and related device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8762694B1 (en) * 2003-02-19 2014-06-24 Intel Corporation Programmable event-driven yield mechanism
US20120284695A1 (en) * 2011-05-04 2012-11-08 Jiri Olsa Error simulation
CN107656874A (en) * 2017-11-07 2018-02-02 中国银行股份有限公司 A kind of interface test method, device, simulation baffle plate and system
CN112685291A (en) * 2020-12-22 2021-04-20 平安普惠企业管理有限公司 System joint test method and related device
CN112597020A (en) * 2020-12-24 2021-04-02 平安普惠企业管理有限公司 Interface testing method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109359194B (en) Method and apparatus for predicting information categories
CN111221572B (en) Method, device, medium and equipment for automatically adapting to running environment
CN113010405A (en) Application program testing method and device
CN116700907B (en) Service call demand document storage method, device, electronic equipment and readable medium
CN112988588A (en) Client software debugging method and device, storage medium and electronic equipment
CN112559024A (en) Method and device for generating transaction code change list
CN109840072B (en) Information processing method and device
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN108804442B (en) Serial number generation method and device
CN112395194B (en) Method and device for accessing test platform
CN113656050B (en) Method and apparatus for generating version number
CN111400623B (en) Method and device for searching information
CN113312900A (en) Data verification method and device
CN113590483A (en) Case operation method and device
CN113918525A (en) Data exchange scheduling method, system, electronic device, medium, and program product
CN108287792B (en) Method and apparatus for outputting information
CN110196803B (en) Software defect training method and system
CN112559001A (en) Method and device for updating application
CN111078230A (en) Code generation method and device
CN112783753B (en) Testing method and device for stream data processing system
CN115309612B (en) Method and device for monitoring data
CN111460269B (en) Information pushing method and device
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
CN110825438B (en) Method and device for simulating data processing of artificial intelligence chip
CN115993981A (en) Data processing method, device, electronic equipment and computer readable 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