CN114741314A - Test case generation method and device, electronic equipment and storage medium - Google Patents

Test case generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114741314A
CN114741314A CN202210463192.4A CN202210463192A CN114741314A CN 114741314 A CN114741314 A CN 114741314A CN 202210463192 A CN202210463192 A CN 202210463192A CN 114741314 A CN114741314 A CN 114741314A
Authority
CN
China
Prior art keywords
parameter
test case
information
target service
parameter value
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
CN202210463192.4A
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.)
CITIC Aibank Corp Ltd
Original Assignee
CITIC Aibank Corp 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 CITIC Aibank Corp Ltd filed Critical CITIC Aibank Corp Ltd
Priority to CN202210463192.4A priority Critical patent/CN114741314A/en
Publication of CN114741314A publication Critical patent/CN114741314A/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

Abstract

The disclosure provides a test case generation method and device, electronic equipment and a storage medium. One embodiment of the method comprises: acquiring target service interface information, wherein the target service interface information comprises a parameter information list of a target service interface and target service information; determining a test case generation rule corresponding to the target service information; and generating the test case based on the parameter information list and the test case generation rule. The implementation method can flexibly meet the requirements of different product services on test case generation.

Description

Test case generation method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of computers, in particular to a test case generation method and device, electronic equipment and a storage medium.
Background
In the software development process, after a developer completes the development and self-inspection of an Application Programming Interface (API for short), the test of a tester is crucial to the quality.
API testing is one of the most basic types of software testing. API testing is also known as interface testing, which is one type of functional testing. The method is a means for testing the system interface function by simulating the application scene of an upper application or a system upper calling interface mainly by means of a unit testing technology.
At present, test cases are complex to construct when testing interfaces, parameters of different products are different, and time consumption for manually constructing corresponding test case messages is long when testing different products, so that testing efficiency is low.
Disclosure of Invention
The disclosure provides a test case generation method and device, electronic equipment and a storage medium.
In a first aspect, the present disclosure provides a test case generation method, including: acquiring target service interface information, wherein the target service interface information comprises a parameter information list of a target service interface and target service information; determining a test case generation rule corresponding to the target service information; and generating the test case based on the parameter information list and the test case generation rule.
In some optional embodiments, the test case generation rule comprises a plurality of sub-rules; and generating a test case based on the parameter information and the test case generation rule, including: and for each parameter information, generating a parameter value corresponding to the parameter information according to the plurality of sub-rules to obtain the test case.
In some optional embodiments, the generating, according to the plurality of sub-rules, a parameter value corresponding to the parameter information includes: determining a parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the system parameter and the parameter value; in response to that the parameter value corresponding to the parameter information is not determined, determining the parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the target service parameter and the parameter value; in response to that the parameter value corresponding to the parameter information is not determined, determining the parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the shared service parameter and the parameter value; in response to not determining the parameter value corresponding to the parameter information, generating a parameter value corresponding to the parameter information.
In some optional embodiments, the correspondence table for characterizing the correspondence between the target service parameter and the parameter value is pre-stored in the request-level cache, and the correspondence table for characterizing the correspondence between the shared service parameter and the parameter value is pre-stored in the session-level cache.
In some optional embodiments, the service parameter comprises customer information, the customer information comprising at least one of: name, identification card number, gender, address, contact way and bank card number information.
In some optional embodiments, before determining the test case generation rule corresponding to the target service information, the apparatus further includes: and checking whether the definition of each parameter information is legal or not.
In some optional embodiments, the generating a test case includes: and generating a JOSN format test case.
In a second aspect, the present disclosure provides a test case generation apparatus, including: the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire target service interface information, and the target service interface information comprises a parameter information list of a target service interface and target service information; the determining unit is configured to determine a test case generation rule corresponding to the target service information; and the generating unit is configured to generate the test case based on the parameter information list and the test case generating rule.
In some optional embodiments, the test case generation rule comprises a plurality of sub-rules; and the generating unit is further configured to generate a parameter value corresponding to each parameter information according to the plurality of sub-rules, so as to obtain the test case.
In some optional embodiments, the generating unit is further configured to determine, according to a correspondence table for characterizing a correspondence between a system parameter and a parameter value, a parameter value corresponding to the parameter information; in response to that the parameter value corresponding to the parameter information is not determined, determining the parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the target service parameter and the parameter value; in response to that the parameter value corresponding to the parameter information is not determined, determining the parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the shared service parameter and the parameter value; in response to not determining the parameter value corresponding to the parameter information, generating a parameter value corresponding to the parameter information.
In some optional embodiments, the correspondence table for characterizing the correspondence between the target service parameter and the parameter value is pre-stored in the request-level cache, and the correspondence table for characterizing the correspondence between the shared service parameter and the parameter value is pre-stored in the session-level cache.
In some optional embodiments, the service parameter comprises customer information, the customer information comprising at least one of: name, identification card number, sex, address, contact way and bank card number information.
In some optional embodiments, the apparatus further comprises: and the checking unit is configured to check whether the definition of each parameter information is legal or not.
In some optional embodiments, the generating unit is further configured to generate a test case in a JOSN format.
In a third aspect, the present disclosure provides an electronic device, comprising: one or more processors; a storage device, on which one or more programs are stored, which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any implementation manner of the first aspect.
In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by one or more processors, implements the method as described in any of the implementations of the first aspect.
The disclosure provides a test case generation method and device, an electronic device and a storage medium. One embodiment of the method comprises: acquiring target service interface information, wherein the target service interface information comprises a parameter information list of a target service interface and target service information; determining a test case generation rule corresponding to the target service information; and generating the test case based on the parameter information list and the test case generation rule. The implementation method can flexibly meet the requirements of different product services on test case generation, and further can process the interfaces for testing different services of different products in the credit field.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a test case generation method according to the present disclosure;
FIG. 3 is a schematic block diagram of one embodiment of a test case generation apparatus according to the present disclosure;
FIG. 4 is a schematic block diagram of a computer system suitable for use in implementing the electronic device of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the test case generation method or test case generation apparatus of the present disclosure may be applied.
As shown in fig. 1, system architecture 100 may include terminal device 101, network 102, and server 103. Network 102 is the medium used to provide communication links between terminal equipment 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may use terminal device 101 to interact with server 103 over network 102 to receive or send messages and the like. Various communication client applications, such as a test case generation application, a web browser application, and the like, may be installed on the terminal device 101.
The terminal apparatus 101 may be hardware or software. When the terminal device 101 is hardware, it may be various electronic devices having a display screen and supporting text input, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatus 101 is software, it can be installed in the electronic apparatuses listed above. It may be implemented as multiple software or software modules (e.g., to provide test case generation services) or as a single software or software module. And is not particularly limited herein.
The server 103 may be a server that provides various services, such as a background server that provides test case generation for interface information sent by the terminal device 101. The backend server may analyze the received interface information, and feed back a processing result (e.g., test case generation) to the terminal device.
In some cases, the test case generation method provided by the present disclosure may be executed by both the terminal device 101 and the server 103, for example, the step of "obtaining target service interface information" may be executed by the terminal device 101, and the rest of the steps may be executed by the server 103. The present disclosure is not limited thereto. Accordingly, the test case generation device may be provided in each of the terminal apparatus 101 and the server 103.
In some cases, the test case generation method provided by the present disclosure may be executed by the server 103, and accordingly, the test case generation apparatus may also be disposed in the server 103, and in this case, the system architecture 100 may also not include the terminal device 101.
In some cases, the test case generation method provided by the present disclosure may be executed by the terminal device 101, and accordingly, the test case generation apparatus may also be disposed in the terminal device 101, in which case, the system architecture 100 may not include the server 103.
The server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 103 is software, it may be implemented as a plurality of software or software modules (for example, to provide a test case generation service), or may be implemented as a single software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a test case generation method in accordance with the present disclosure is shown. The test case generation method comprises the following steps:
step 201, obtaining target service interface information.
Here, the target service interface information may include a parameter information list of the target service interface and the target service information. The target traffic information may be used to characterize the traffic type of the interface. In one aspect, the parameter information list may include input parameters and output parameters. On the other hand, the parameter information list may include service parameters and system parameters. The target service information may be a service name or a service identification, and may be, for example, a credit, a letter, a deposit, a payment, and the like.
In this embodiment, the execution subject (for example, the server 103 in fig. 1) may obtain the target service interface information according to the interface identifier from a relational database storing the correspondence between the interface identifier and the interface information.
Step 202, determining a test case generation rule corresponding to the target service information.
In this embodiment, the execution main body may determine the test case generation rule corresponding to the target service information according to a corresponding relationship between preset service information and the test case generation rule. That is, corresponding test case generation rules can be set for different service information. The test case generation rules may be used to characterize a specific test case generation strategy. The test case generation rule may be used to generate a test case corresponding to the target business interface.
Specifically, the test case generation rule may include at least one parameter value generation item and a corresponding parameter value generation condition.
And step 203, generating a test case based on the parameter information list and the test case generation rule.
In this embodiment, the execution subject may generate the test case based on the parameter information list and the test case generation rule by adopting various implementation manners.
In some alternative embodiments, the test case generation rule may include a plurality of sub-rules. Step 203 may be performed as follows: and for each parameter information, generating a parameter value corresponding to the parameter information according to the plurality of sub-rules to obtain the test case.
Here, each sub-rule may correspond to different priorities, that is, each parameter is filled with parameter values in order of priority from high to low.
In some optional embodiments, step 203 may further include:
firstly, according to a corresponding relation table for representing the corresponding relation between the system parameters and the parameter values, determining the parameter values corresponding to the parameter information.
Here, the system parameters may be used to characterize the manner in which the system executes the target product, e.g., synchronous or asynchronous. The target business information may include target product information and a target event code. The target product information may be, for example, a product identification or a product name. The event code may include product information and business information. In one scenario, the product is a credit service, the product information is a credit product name (e.g., "some lending platform"), and the event code is "some lending platform-credit", "some lending platform-loan", "some lending platform-repayment", etc. The correspondence table may be preset, and may include a plurality of system parameters and corresponding parameter values.
When the executing agent recognizes that the parameter is a certain system parameter, the parameter value corresponding to the parameter information may be determined from the correspondence table. And in response to the fact that the parameter value corresponding to the parameter information is not determined, the execution is switched to the second step.
And secondly, determining a parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the target service parameter and the parameter value.
Here, the service parameters may be used to characterize information related to the service. The business parameters may include enumerated types of business parameters. The value range of the parameter value corresponding to the enumerated type service parameter is a limited number, not infinite. For example, the parameter "gender" can only correspond to a parameter value of "male" or "female". The service parameters may include customer information. The customer information may include at least one of: name, ID card number, sex, address, contact way, bank card number and other information. The business parameters may also include product information, event codes, organization information (organization information for publishing the product). The service parameters may also include transaction time information, transaction channel information, and the like. The correspondence table may be preset, and may include a plurality of service parameters and corresponding parameter values.
When the executing entity identifies that the parameter is a certain service parameter, the parameter value corresponding to the parameter information may be determined from the correspondence table. And in response to the parameter value corresponding to the parameter information is not determined, the third step is carried out.
And thirdly, in response to the fact that the parameter value corresponding to the parameter information is not determined, determining the parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the shared service parameter and the parameter value.
Here, for example, the associated traffic interfaces all comprise the same parameter, and the parameter values of this parameter are the same. For example, the release service interface includes a "credit service (event) code" parameter, the repayment service interface includes a "credit service (event) code" parameter, and the credit service interface includes a credit service (event) code "parameter, that is, the" credit service (event) code "is a shared service parameter. The "credit service (event) code" parameters included in the three service interfaces should correspond to the same parameter value (e.g. credit service serial number). The correspondence table may be preset, and may include a plurality of shared service parameters and corresponding parameter values.
When the executing entity identifies that the parameter is a certain shared service parameter, the parameter value corresponding to the parameter information may be determined from the correspondence table. And in response to that the parameter value corresponding to the parameter information is not determined, the fourth step is executed.
And fourthly, responding to the situation that the parameter value corresponding to the parameter information is not determined, and generating the parameter value corresponding to the parameter information.
In this implementation, the execution body may randomly generate a random value without semantics for the parameter value. In this case, the parameter is generally a non-critical parameter, and the parameter and the corresponding parameter value are not constructed and stored in advance.
And finally, generating a test case and displaying the test case according to the message format for each parameter and the corresponding parameter value in the parameter information list.
In some alternative embodiments, step 203 may be performed as follows: and generating a JOSN format test case. And the working personnel can carry out preset operations such as one-key copying, folding, highlight display, editable and the like on the message in the JSON format, and the use is convenient.
In some optional embodiments, the correspondence table for characterizing the correspondence between the target service parameter and the parameter value is pre-stored in the request-level cache, and the correspondence table for characterizing the correspondence between the shared service parameter and the parameter value is pre-stored in the session-level cache.
Here, the correspondence table for representing the correspondence between the target service parameter and the parameter value may be that a test case is generated for the target service interface, and after the test case corresponding to the target service interface is generated, the test case is not reused, so that the life cycle is suitable for Request Scope (Request Scope) caching.
Here, an information sharing mechanism of Request Scope (Request Scope) cache and Session Scope (Session Scope) cache may be supported, and the problem of information transfer between internal parameters of interface messages and between interface messages may be solved.
In one case, the correspondence table for representing the correspondence between the target service parameter and the parameter value may include parameters that satisfy a preset rule, that is, the parameter value corresponding to the parameter a and the parameter value corresponding to the parameter B satisfy the preset rule. For example, since the 17 th digit of the identification number represents gender: odd numbers indicate males and even numbers indicate females. Therefore, the parameter value corresponding to the parameter 'identity card number' and the parameter value corresponding to the parameter 'gender' meet the preset relationship.
Through the implementation mode, each corresponding relation table is constructed in advance so as to meet the requirements of different services on test case generation and improve interface test efficiency.
In some optional embodiments, before step 202, the method may further include:
step 204, checking whether the definition of each parameter information is legal or not and whether logic conflict exists or not. Step 202 may be performed after the verification is successful.
Here, the execution body may check whether the definition of each parameter information is legal in various ways. A more comprehensive verification of the interface can thereby be achieved.
The present disclosure provides a test case generating method, which includes obtaining target service interface information, wherein the target service interface information includes a parameter information list of a target service interface and target service information; determining a test case generation rule corresponding to the target service information; the test case is generated based on the parameter information list and the test case generation rule, and the requirements of different product services on the generation of the test case can be flexibly met.
With further reference to fig. 3, as an implementation of the method shown in the above-mentioned figures, the present disclosure provides an embodiment of a test case generation apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 3, the test case generation apparatus 300 of the present embodiment includes: an acquisition unit 301, a determination unit 302, and a generation unit 303. The acquiring unit 301 is configured to acquire target service interface information, where the target service interface information includes a parameter information list of a target service interface and target service information; a determining unit 302 configured to determine a test case generation rule corresponding to the target service information; a generating unit 303 configured to generate a test case based on the parameter information list and the test case generation rule.
In this embodiment, specific processes of the obtaining unit 301, the determining unit 302, and the generating unit 303 of the test case generating apparatus 300 and technical effects brought by the specific processes may refer to relevant descriptions of step 201, step 202, and step 203 in the corresponding embodiment of fig. 2, and are not described herein again.
In some optional embodiments, the test case generation rule may include a plurality of sub-rules; and the generating unit may be further configured to generate, for each parameter information, a parameter value corresponding to the parameter information according to the plurality of sub-rules, resulting in the test case.
In some optional embodiments, the generating unit may be further configured to determine, according to a correspondence table for characterizing correspondence between the system parameter and the parameter value, a parameter value corresponding to the parameter information; in response to that the parameter value corresponding to the parameter information is not determined, determining the parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the target service parameter and the parameter value; in response to that the parameter value corresponding to the parameter information is not determined, determining the parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the shared service parameter and the parameter value; in response to not determining the parameter value corresponding to the parameter information, generating a parameter value corresponding to the parameter information.
In some optional embodiments, the correspondence table for characterizing the correspondence between the target service parameter and the parameter value may be pre-stored in the request-level cache, and the correspondence table for characterizing the correspondence between the shared service parameter and the parameter value may be pre-stored in the session-level cache.
In some optional embodiments, the service parameter may include customer information, and the customer information may include at least one of: name, ID card number, sex, address, contact way, bank card number and other information.
In some optional embodiments, before determining the test case generation rule corresponding to the target service information, the apparatus may further include: and the checking unit is configured to check whether the definition of each parameter information is legal or not.
In some optional embodiments, the generating unit may be further configured to generate a JOSN formatted test case.
It should be noted that, for details of implementation and technical effects of each unit in the test case generation apparatus provided by the present disclosure, reference may be made to descriptions of other embodiments in the present disclosure, and details are not described herein again.
Referring now to FIG. 4, a block diagram of a computer system 400 suitable for use in implementing the electronic device of the present disclosure is shown. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the present disclosure.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the system 400 are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An Input/Output (I/O) interface 405 is also connected to the bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a touch screen, a tablet, a keyboard, a mouse, or the like; an output section 407 including a Display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure 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 in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 409. The above-described functions defined in the method of the present disclosure are performed when the computer program is executed by a Central Processing Unit (CPU) 401. It should be noted that the computer readable medium in the present disclosure 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 disclosure, 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 contrast, in the present disclosure, 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 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.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, Python, 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 computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
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 disclosure. 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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 this disclosure 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 an acquisition unit, a determination unit, and a generation unit. The names of these units do not in some cases form a limitation on the unit itself, and for example, the acquiring unit may also be described as a "unit that acquires target service interface information".
As another aspect, the present disclosure also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: acquiring target service interface information, wherein the target service interface information comprises a parameter information list of a target service interface and target service information; determining a test case generation rule corresponding to the target service information; and generating the test case based on the parameter information list and the test case generation rule.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept as defined above. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (10)

1. A test case generation method comprises the following steps:
acquiring target service interface information, wherein the target service interface information comprises a parameter information list of a target service interface and target service information;
determining a test case generation rule corresponding to the target service information;
and generating the test case based on the parameter information list and the test case generation rule.
2. The method of claim 1, wherein the test case generation rule comprises a plurality of sub-rules; and
generating a test case based on the parameter information and the test case generation rule comprises:
and for each parameter information, generating a parameter value corresponding to the parameter information according to the plurality of sub-rules to obtain the test case.
3. The method of claim 2, wherein the generating a parameter value corresponding to the parameter information according to the plurality of sub-rules comprises:
determining a parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the system parameter and the parameter value;
in response to that the parameter value corresponding to the parameter information is not determined, determining the parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the target service parameter and the parameter value;
in response to that the parameter value corresponding to the parameter information is not determined, determining the parameter value corresponding to the parameter information according to a corresponding relation table for representing the corresponding relation between the shared service parameter and the parameter value;
in response to not determining the parameter value corresponding to the parameter information, generating a parameter value corresponding to the parameter information.
4. The method according to claim 3, wherein the correspondence table for characterizing the correspondence between target traffic parameters and parameter values is pre-stored in a request-level cache, and the correspondence table for characterizing the correspondence between shared traffic parameters and parameter values is pre-stored in a session-level cache.
5. The method of claim 3, wherein the service parameters include customer information including at least one of: name, identification card number, gender, address, contact way and bank card number information.
6. The method of claim 1, wherein before the determining the test case generation rule corresponding to the target service information, the method further comprises:
and checking whether the definition of each parameter information is legal or not.
7. The method of claim 1, wherein the generating test cases comprises:
and generating a JOSN format test case.
8. A test case generation apparatus comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire target service interface information, and the target service interface information comprises a parameter information list of a target service interface and target service information;
the determining unit is configured to determine a test case generation rule corresponding to the target service information;
and the generating unit is configured to generate the test case based on the parameter information list and the test case generating rule.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
CN202210463192.4A 2022-04-28 2022-04-28 Test case generation method and device, electronic equipment and storage medium Pending CN114741314A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210463192.4A CN114741314A (en) 2022-04-28 2022-04-28 Test case generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210463192.4A CN114741314A (en) 2022-04-28 2022-04-28 Test case generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114741314A true CN114741314A (en) 2022-07-12

Family

ID=82286538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210463192.4A Pending CN114741314A (en) 2022-04-28 2022-04-28 Test case generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114741314A (en)

Similar Documents

Publication Publication Date Title
CN108846753B (en) Method and apparatus for processing data
CN109684188B (en) Test method and device
CN108933695B (en) Method and apparatus for processing information
US10382313B2 (en) Test building for testing server operation
CN111639119B (en) Customer information query method and equipment in back money laundering system
CA3059719A1 (en) Payment processing method, device, medium and electronic device
CN111881329A (en) Account balance management method and system
CN110223179B (en) Data processing method, device, system and medium for fund
CN111104556A (en) Service processing method and device
CN110928594A (en) Service development method and platform
CN116757816A (en) Information approval method, device, equipment and storage medium
CN111383096A (en) Fraud detection and model training method and device thereof, electronic equipment and storage medium
CN110730109A (en) Method and apparatus for generating information
CN108804442B (en) Serial number generation method and device
CN112732547B (en) Service testing method and device, storage medium and electronic equipment
CN114741314A (en) Test case generation method and device, electronic equipment and storage medium
CN114840379A (en) Log generation method, device, server and storage medium
CN109889402B (en) Method and apparatus for generating information
CN114428815A (en) Data storage method and device, electronic equipment and computer readable medium
CN112184406A (en) Data processing method, system, electronic device and computer readable storage medium
CN113486749A (en) Image data collection method, device, electronic equipment and computer readable medium
CN112579428A (en) Interface testing method and device, electronic equipment and storage medium
CN112367266A (en) Current limiting method, current limiting device, electronic equipment and computer readable medium
CN111767486A (en) Method, device, electronic equipment and computer readable medium for displaying page
CN113283850A (en) Task auditing method, device and system

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