Test case generation method and device, equipment, storage medium and program product

By displaying pre-packaged candidate components in the test platform, testers can select and connect components to generate test cases, solving the problem of inefficient writing of traditional interface test cases and achieving improvements in the efficiency of test case generation.

CN119718931AInactive Publication Date: 2025-03-28GUANGZHOU QUYAN NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411821841.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The writing efficiency of traditional interface test cases is inefficient, which requires testers to have high code capabilities and familiarity with the syntax of development tools, and there is a lot of repeated development work.

Method used

Provides a test case generation method, by displaying pre-encapsulated multiple candidate components in the test case generation page of the test platform, each candidate component encapsulated calls of multiple interface functions. Testers can select and wire target components to generate test cases.

Benefits of technology

Through componentization, testers only need to select and connect components on the visual page to automatically generate test cases, which significantly improves the generation efficiency of test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718931A_ABST
    Figure CN119718931A_ABST
Patent Text Reader

Abstract

The invention relates to a test case generation method and device, equipment, a storage medium and a program product, and relates to the technical field of computers. The method comprises the following steps: in a test case generation page of a test platform, displaying a plurality of candidate components pre-packaged for a to-be-tested business system; calling of a plurality of interface functions is packaged in each candidate component; different candidate components are used for realizing different service functions of the service system; in response to the component selection operation, selecting at least two target components indicated by the component selection operation from the plurality of candidate components; in response to a connection operation for each selected target component, obtaining a component flow chart including each selected target component; and generating a test case for the business system based on the connection line relationship of each target component in the component flow chart. By adopting the method, the generation efficiency of the test case can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a test case generation method, apparatus, device, storage medium and program product. Background Art

[0002] With the rapid development of the Internet industry, users have higher and higher quality requirements for Internet products, and automated testing has become an important means to ensure product quality. Interface testing is particularly critical in product testing, regression testing and other links. In traditional technologies, testers are usually required to manually write interface test cases. However, the writing of interface test cases often requires testers to have high coding skills and be familiar with the syntax of development tools. Before writing test cases, they also need to carefully read the requirements documents and interface documents, and there is a lot of repeated development work, which leads to low efficiency of test cases. Summary of the invention

[0003] Based on this, it is necessary to provide a test case generation method, device, equipment, storage medium and program product that can improve the efficiency of test case generation in response to the above technical problems.

[0004] In a first aspect, the present application provides a test case generation method, the method comprising:

[0005] In the test case generation page of the test platform, multiple candidate components pre-packaged for the business system to be tested are displayed; each of the candidate components encapsulates calls to multiple interface functions; different candidate components are used to implement different business functions of the business system;

[0006] In response to a component selection operation, selecting at least two target components indicated by the component selection operation from the multiple candidate components;

[0007] In response to the connection operation for each selected target component, a component flow chart including each selected target component is obtained;

[0008] Based on the connection relationship between each of the target components in the component flow chart, a test case for the business system is generated.

[0009] In one embodiment, the method further comprises:

[0010] Obtain a test case execution result obtained by executing the test case in the business system; the test case execution result includes a component execution result corresponding to each target component in the component flow chart;

[0011] Based on the component execution results corresponding to the target components contained in the use case execution results, each target component in the component flow chart is colored to obtain a test result report corresponding to the test case; different component execution results correspond to different colors;

[0012] The test result report is displayed on the test result display page of the test platform.

[0013] In one embodiment, the multiple candidate components include multiple candidate basic components and at least one candidate general component; each candidate general component is assembled from at least two candidate basic components; each candidate basic component encapsulates calls to multiple interface functions; the target component includes a target basic component and a target general component;

[0014] In response to the component selection operation, selecting at least two target components indicated by the component selection operation from the multiple candidate components includes:

[0015] In response to a basic component selection operation, selecting at least one target basic component indicated by the basic component selection operation from the multiple candidate basic components;

[0016] In response to a general component selection operation, at least one target general component indicated by the general component selection operation is selected from the at least one candidate general component.

[0017] In one embodiment, the multiple candidate basic components include a pool account component; the pool account component is used to filter out a target login account that meets the account filtering conditions configured in the pool account component from the multiple candidate login accounts corresponding to the business system.

[0018] In one embodiment, the multiple candidate basic components also include a start component, an HTTP request component, an SQL request component, a conditional control component, a wait control component, an assertion component, a data processing component, a pre-component and a post-component; each of the test cases includes a start component for indicating the start of the test case; the HTTP request component is used to implement the HTTP request in the business system; the SQL request component is used to implement the SQL request in the business system; the conditional control component is used to control the execution of steps in the test case that meet the execution conditions configured in the conditional control component; the wait control component is used to control the waiting after the execution of the steps in the test case; the assertion component is used to verify whether the test case runs correctly; the data processing component is used to process the business data of the business system; the pre-component and the post-component are used to wrap at least one of the start component, the HTTP request component, the SQL request component, the conditional control component, the wait control component, the assertion component, the data processing component and the pool account component.

[0019] In one embodiment, the multiple candidate components include multiple candidate basic components and multiple candidate general components; the multiple candidate general components include general combination components; each of the general combination components is assembled from at least one of the candidate basic components and at least one candidate general component.

[0020] In a second aspect, the present application provides a test case generation device, the device comprising:

[0021] A display module is used to display multiple candidate components pre-packaged for the business system to be tested in the test case generation page of the test platform; each of the candidate components encapsulates multiple interface function calls; different candidate components are used to implement different business functions of the business system;

[0022] A selection module, configured to select, in response to a component selection operation, at least two target components indicated by the component selection operation from the plurality of candidate components;

[0023] A generation module is used to obtain a component flow chart containing each selected target component in response to a connection operation on each selected target component; and generate a test case for the business system based on the connection relationship between each target component in the component flow chart.

[0024] In a third aspect, the present application provides a computer device including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the method embodiments of the present application are implemented.

[0025] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the method embodiments of the present application.

[0026] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps in the method embodiments of the present application when the computer program is executed by a processor.

[0027] The above-mentioned test case generation method, device, equipment, storage medium and program product, in the test case generation page of the test platform, display multiple candidate components pre-packaged for the business system to be tested; each candidate component encapsulates multiple interface function calls; different candidate components are used to implement different business functions of the business system; in response to the component selection operation, at least two target components indicated by the component selection operation are selected from multiple candidate components; in response to the connection operation for each selected target component, a component flow chart containing each selected target component is obtained; based on the connection relationship of each target component in the component flow chart, a test case for the business system is generated. Compared with the traditional test case generation method, the present application implements different business functions of the business system in a componentized manner by encapsulating multiple interface function calls in each candidate component. The tester only needs to select the target component required for the test from the multiple visualized candidate components in the test case generation page of the test platform, and connect the selected target components according to the test requirements to form a visualized component flow chart, and then the test case of the business system can be automatically generated based on the component flow chart, which improves the generation efficiency of the test case. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 An application environment diagram of a test case generation method in an embodiment;

[0029] Figure 2 A schematic diagram of a flow chart of a test case generation method in an embodiment;

[0030] Figure 3 A schematic diagram of the composition relationship of a test plan in an embodiment;

[0031] Figure 4 is an example diagram of a common component in one embodiment;

[0032] Figure 5 A schematic diagram of the execution process of a common component in an embodiment;

[0033] Figure 6 A flowchart of the execution process of a test case in an embodiment;

[0034] Figure 7 A structural block diagram of a test case generating device in an embodiment;

[0035] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0037] The test case generation method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can be set up separately and can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, and tablet computers. The server 104 can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security and other network security services, CDN, and big data and artificial intelligence platforms and other basic cloud computing services. The terminal 102 and the server 104 can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.

[0038] The terminal 102 can display multiple pre-packaged candidate components for the business system to be tested in the test case generation page of the test platform; each candidate component encapsulates multiple interface function calls; different candidate components are used to implement different business functions of the business system. In response to the component selection operation, the terminal 102 can select at least two target components indicated by the component selection operation from multiple candidate components, and in response to the connection operation for each selected target component, obtain a component flow chart containing each selected target component. The terminal 102 can generate a test case for the business system based on the connection relationship between each target component in the component flow chart, and send the test case to the server 104 for testing the business system.

[0039] It is understood that this embodiment does not limit this. It is understood that Figure 1 The application scenarios are only for illustration and are not limited to this.

[0040] In one embodiment, Figure 2 As shown, a test case generation method is provided. In this embodiment, the method is applied to Figure 1The terminal 102 in the example is used as an example to illustrate, and the following steps are included:

[0041] Step 202, in the test case generation page of the test platform, multiple candidate components pre-packaged for the business system to be tested are displayed; each candidate component encapsulates calls to multiple interface functions; different candidate components are used to implement different business functions of the business system.

[0042] The test platform is a platform for testing the business system. The test case generation page is a page in the test platform for generating test cases.

[0043] In one embodiment, a test platform is run on the terminal, and the terminal can obtain multiple candidate components pre-packaged for the business system, wherein each candidate component encapsulates multiple interface function calls, that is, each candidate component encapsulates multiple business operations, and different candidate components are used to implement different business functions of the business system. The terminal can display the obtained multiple candidate components in the test case generation page of the test platform for testers to select and generate test cases.

[0044] Step 204 , in response to the component selection operation, selecting at least two target components indicated by the component selection operation from a plurality of candidate components.

[0045] In one embodiment, the test case generation page may include a component display area and a flowchart generation area. The terminal may display multiple candidate components pre-packaged for the business system to be tested in the component display area. The tester may select at least two target components from the multiple candidate components displayed in the component display area, and drag the selected target components to the flowchart generation area. The terminal may select at least two target components indicated by the component selection operation from the multiple candidate components in response to the tester's component selection operation, and display the dragged target components in the flowchart generation area in response to the tester's component dragging operation.

[0046] Step 206 , in response to the connection operation for each selected target component, obtain a component flow chart including each selected target component.

[0047] In one embodiment, the tester can connect each target component displayed in the flowchart generation area according to the test requirements. The terminal can respond to the tester's connection operation on each target component, obtain a component flowchart containing each selected target component, and display the component flowchart in the flowchart generation area for the tester to view and adjust.

[0048] Step 208: Generate test cases for the business system based on the connection relationship between the target components in the component flow chart.

[0049] Specifically, the connection relationship between the target components in the component flow chart can represent the execution order between the target components in the component flow chart. It can be understood that according to the execution order between the target components in the component flow chart, the test case for the business system can be obtained.

[0050] In the above test case generation method, multiple candidate components pre-packaged for the business system to be tested are displayed in the test case generation page of the test platform; each candidate component encapsulates multiple interface function calls; different candidate components are used to implement different business functions of the business system; in response to the component selection operation, at least two target components indicated by the component selection operation are selected from multiple candidate components; in response to the connection operation for each selected target component, a component flow chart containing each selected target component is obtained; based on the connection relationship of each target component in the component flow chart, a test case for the business system is generated. Compared with the traditional test case generation method, the present application implements different business functions of the business system in a componentized manner by encapsulating multiple interface function calls in each candidate component. The tester only needs to select the target component required for the test from the multiple visualized candidate components in the test case generation page of the test platform, and connect the selected target components according to the test requirements to form a visualized component flow chart, and then the test case of the business system can be automatically generated based on the component flow chart, which improves the efficiency of test case generation.

[0051] In one embodiment, the method also includes: obtaining the use case execution results obtained by executing the test case in the business system; the use case execution results include component execution results corresponding to each target component in the component flowchart; based on the component execution results corresponding to each target component included in the use case execution results, each target component in the component flowchart is colored to obtain a test result report corresponding to the test case; different component execution results correspond to different colors; and the test result report is displayed in the test result display page of the test platform.

[0052] In one embodiment, for each target component in the component flowchart, if the component execution result corresponding to the target component is successful execution, the target component is rendered green in the component flowchart; if the component execution result corresponding to the target component is an alarm, the target component is rendered yellow in the component flowchart; if the component execution result corresponding to the target component is failed execution, the target component is rendered red in the component flowchart; if the component execution result corresponding to the target component is skipped execution, the target component is rendered gray in the component flowchart.

[0053] In the above embodiment, each target component in the component flow chart is colored by the component execution results corresponding to each target component contained in the use case execution results, and a test result report corresponding to the test case is obtained. This can facilitate testers to quickly and accurately locate problems that arise during the test process from the test result report, facilitate subsequent optimization of the business system, and improve the stability of the business system after it goes online.

[0054] In one embodiment, multiple candidate components include multiple candidate basic components and at least one candidate general component; each candidate general component is assembled from at least two candidate basic components; each candidate basic component encapsulates calls to multiple interface functions; the target component includes a target basic component and a target general component; in response to a component selection operation, at least two target components indicated by the component selection operation are selected from the multiple candidate components, including: in response to a basic component selection operation, at least one target basic component indicated by the basic component selection operation is selected from the multiple candidate basic components; in response to a general component selection operation, at least one target general component indicated by the general component selection operation is selected from at least one candidate general component.

[0055] Specifically, the terminal can display multiple pre-packaged candidate components for the business system to be tested in the test case generation page of the test platform; different candidate components are used to implement different business functions of the business system; multiple candidate components include multiple candidate basic components and at least one candidate general component; each candidate general component is assembled from at least two candidate basic components; each candidate basic component encapsulates multiple interface function calls; each candidate component encapsulates multiple interface function calls. The terminal can respond to the basic component selection operation to select at least one target basic component indicated by the basic component selection operation from multiple candidate basic components; respond to the general component selection operation to select at least one target general component indicated by the general component selection operation from at least one candidate general component. The terminal can respond to the connection operation for the selected target basic component and the target general component to obtain a component flow chart containing the selected target basic component and the target general component. The terminal can generate a test case for the business system based on the connection relationship between the target basic component and the target general component in the component flow chart.

[0056] In one embodiment, Figure 3 As shown in the figure, test cases are assembled using basic components and common components. A test set is a collection of test cases, which is used to classify test cases and facilitate test plan settings. A test plan is a collection of test sets and is the final execution body of the test platform. Users can trigger execution manually or in a scheduled manner on the test platform and view the test result reports corresponding to all test cases.

[0057] In the above embodiment, by limiting the multiple candidate components to include multiple candidate basic components and at least one candidate general component, and since each candidate general component is assembled from at least two candidate basic components, the corresponding business function can be realized. In this way, by directly selecting the candidate general components, the tester does not need to repeatedly and massively select the candidate basic components to realize the same business function as the candidate general components, which can further improve the efficiency of test case generation.

[0058] In one embodiment, the multiple candidate basic components include a pool account component; the pool account component is used to filter out a target login account that meets the account filtering conditions configured in the pool account component from multiple candidate login accounts corresponding to the business system.

[0059] In one embodiment, if the account filtering condition is membership, the terminal can filter out a login account with membership status from multiple candidate login accounts corresponding to the business system as the target login account.

[0060] In the above embodiment, the pool account component is used to screen out the target login account that meets the account filtering conditions configured in the pool account component from multiple candidate login accounts corresponding to the business system. There is no need for the tester to manually enter the login account required for the test scenario, which avoids the transmission of the login account during the test and eliminates the risk of transmission leakage, thereby improving the security and stability of the test process.

[0061] In one embodiment, the multiple candidate basic components also include a start component, an HTTP request component, an SQL request component, a conditional control component, a wait control component, an assertion component, a data processing component, a pre-component and a post-component; each test case includes a start component for indicating the start of the test case; the HTTP request component is used to implement the HTTP request in the business system; the SQL request component is used to implement the SQL request in the business system; the conditional control component is used to control the execution of steps in the test case that meet the execution conditions configured in the conditional control component; the wait control component is used to control the waiting after the execution of the steps in the test case; the assertion component is used to verify whether the test case runs correctly; the data processing component is used to process the business data of the business system; the pre-component and the post-component are used to wrap at least one of the start component, HTTP request component, SQL request component, conditional control component, wait control component, assertion component, data processing component and pool account component.

[0062] Among them, HTTP (Hypertext Transfer Protocol) is the Hypertext Transfer Protocol, and SQL (Structured Query Language) is the Structured Query Language.

[0063] In one embodiment, Figure 4 As shown, during the execution of the general component, the dashed boxes of the pre-component, post-component and component group are used to distinguish whether the general component is actually executed. Specifically, only the general components in the dashed boxes of the component group will be actually executed, and the general components in the pre-component and post-component will only be executed when the general component itself is debugged.

[0064] In one embodiment, Figure 5 As shown, for each general component edited or created, during the debugging process of the general component, the terminal can execute the general component to obtain the login account corresponding to the business system. If the specified conditions exist in the login account corresponding to the business system to obtain the target login account, the general component is debugged, and the component execution result corresponding to the general component is generated after the debugging passes. If the specified conditions do not exist in the login account corresponding to the business system to obtain the target login account, the corresponding post-component is executed, and the component execution result corresponding to the post-component is generated.

[0065] In the above embodiment, by limiting multiple candidate basic components to include a start component, an HTTP request component, an SQL request component, a conditional control component, a wait control component, an assertion component, a data processing component, a pool account component, a front component and a post component, a variety of business functions of the business system can be realized and the efficiency of test case generation is improved.

[0066] In one embodiment, the multiple candidate components include multiple candidate basic components and multiple candidate general components; the multiple candidate general components include general combination components; each general combination component is assembled from at least one candidate basic component and at least one candidate general component.

[0067] In the above embodiment, by limiting the number of candidate general components to include general combination components, and since each general combination component is assembled from at least one candidate basic component and at least one candidate general component, the corresponding business function can be realized. In this way, by directly selecting the general combination component, the tester does not need to repeatedly and massively select candidate basic components and candidate general components to realize the same business function as the general combination component, which can further improve the efficiency of test case generation.

[0068] In one embodiment, Figure 6 As shown in the figure, a test case consists of UI (User Interface) login, UI room entry, UI microphone, UI check-out and UI login components. Among them, the UI microphone component is used to determine whether the microphone is turned on. If not, turn on the microphone. If it is turned on, implement UI microphone.

[0069] It should be understood that, although each step in the flow chart of the above-mentioned embodiments is shown in order, these steps are not necessarily performed in order. Unless there is a clear explanation in this article, the execution of these steps does not have strict order restrictions, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned embodiments may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in order, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0070] In one embodiment, Figure 7 As shown, a test case generating device 700 is provided, which specifically includes:

[0071] The display module 702 is used to display multiple candidate components pre-packaged for the business system to be tested in the test case generation page of the test platform; each candidate component encapsulates multiple interface function calls; different candidate components are used to implement different business functions of the business system;

[0072] A selection module 704, configured to select at least two target components indicated by the component selection operation from a plurality of candidate components in response to the component selection operation;

[0073] The generation module 706 is used to obtain a component flow chart including each selected target component in response to the connection operation for each selected target component; and generate a test case for the business system based on the connection relationship between each target component in the component flow chart.

[0074] In one embodiment, the display module 702 is also used to obtain the use case execution results obtained by executing the test case in the business system; the use case execution results include the component execution results corresponding to each target component in the component flowchart; based on the component execution results corresponding to each target component included in the use case execution results, each target component in the component flowchart is colored to obtain a test result report corresponding to the test case; different component execution results correspond to different colors; and the test result report is displayed in the test result display page of the test platform.

[0075] In one embodiment, multiple candidate components include multiple candidate basic components and at least one candidate general component; each candidate general component is assembled from at least two candidate basic components; each candidate basic component encapsulates calls to multiple interface functions; the target component includes a target basic component and a target general component; the selection module 704 is also used to respond to a basic component selection operation, select at least one target basic component indicated by a basic component selection operation from multiple candidate basic components; respond to a general component selection operation, select at least one target general component indicated by a general component selection operation from at least one candidate general component.

[0076] In one embodiment, the multiple candidate basic components include a pool account component; the pool account component is used to filter out a target login account that meets the account filtering conditions configured in the pool account component from multiple candidate login accounts corresponding to the business system.

[0077] In one embodiment, the multiple candidate basic components also include a start component, an HTTP request component, an SQL request component, a conditional control component, a wait control component, an assertion component, a data processing component, a pre-component and a post-component; each test case includes a start component for indicating the start of the test case; the HTTP request component is used to implement the HTTP request in the business system; the SQL request component is used to implement the SQL request in the business system; the conditional control component is used to control the execution of steps in the test case that meet the execution conditions configured in the conditional control component; the wait control component is used to control the waiting after the execution of the steps in the test case; the assertion component is used to verify whether the test case runs correctly; the data processing component is used to process the business data of the business system; the pre-component and the post-component are used to wrap at least one of the start component, HTTP request component, SQL request component, conditional control component, wait control component, assertion component, data processing component and pool account component.

[0078] In one embodiment, the multiple candidate components include multiple candidate basic components and multiple candidate general components; the multiple candidate general components include general combination components; each general combination component is assembled from at least one candidate basic component and at least one candidate general component.

[0079] The above-mentioned test case generation device displays multiple pre-packaged candidate components for the business system to be tested in the test case generation page of the test platform; each candidate component encapsulates multiple interface function calls; different candidate components are used to implement different business functions of the business system; in response to the component selection operation, at least two target components indicated by the component selection operation are selected from multiple candidate components; in response to the connection operation for each selected target component, a component flow chart containing each selected target component is obtained; based on the connection relationship between each target component in the component flow chart, a test case for the business system is generated. Compared with the traditional test case generation method, the present application implements different business functions of the business system in a componentized manner by encapsulating multiple interface function calls in each candidate component. The tester only needs to select the target component required for the test from the multiple visualized candidate components in the test case generation page of the test platform, and connect the selected target components according to the test requirements to form a visualized component flow chart, and then the test case of the business system can be automatically generated based on the component flow chart, which improves the efficiency of test case generation.

[0080] Each module in the above test case generation device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0081] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a test case generation method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0082] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0083] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0084] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0085] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0086] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0087] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0088] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0089] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A test case generation method, characterized in that: The method comprises: In the test case generation page of the test platform, multiple candidate components pre-packaged for the business system to be tested are displayed; each of the candidate components encapsulates calls to multiple interface functions; different candidate components are used to implement different business functions of the business system; In response to a component selection operation, selecting at least two target components indicated by the component selection operation from the multiple candidate components; In response to the connection operation for each selected target component, a component flow chart including each selected target component is obtained; Based on the connection relationship between each of the target components in the component flow chart, a test case for the business system is generated.

2. The method according to claim 1, characterized in that The method further comprises: Obtain a test case execution result obtained by executing the test case in the business system; the test case execution result includes a component execution result corresponding to each target component in the component flow chart; Based on the component execution results corresponding to the target components contained in the use case execution results, each target component in the component flow chart is colored to obtain a test result report corresponding to the test case; different component execution results correspond to different colors; The test result report is displayed on the test result display page of the test platform.

3. The method according to claim 1, characterized in that The multiple candidate components include multiple candidate basic components and at least one candidate general component; each candidate general component is assembled from at least two candidate basic components; each candidate basic component encapsulates multiple interface function calls; the target component includes a target basic component and a target general component; In response to the component selection operation, selecting at least two target components indicated by the component selection operation from the multiple candidate components includes: In response to a basic component selection operation, selecting at least one target basic component indicated by the basic component selection operation from the multiple candidate basic components; In response to a general component selection operation, at least one target general component indicated by the general component selection operation is selected from the at least one candidate general component.

4. The method according to claim 3, characterized in that The multiple candidate basic components include a pool account component; the pool account component is used to filter out a target login account that meets the account filtering condition configured in the pool account component from the multiple candidate login accounts corresponding to the business system.

5. The method according to claim 4, characterized in that The multiple candidate basic components also include a start component, an HTTP request component, an SQL request component, a conditional control component, a wait control component, an assertion component, a data processing component, a pre-component and a post-component; each of the test cases includes a start component for indicating the start of the test case; the HTTP request component is used to implement the HTTP request in the business system; the SQL request component is used to implement the SQL request in the business system; the conditional control component is used to control the execution of the steps in the test case that meet the execution conditions configured in the conditional control component; the wait control component is used to control the waiting after the execution of the steps in the test case; the assertion component is used to verify whether the test case runs correctly; the data processing component is used to process the business data of the business system; the pre-component and the post-component are used to wrap at least one of the start component, the HTTP request component, the SQL request component, the conditional control component, the wait control component, the assertion component, the data processing component and the pool account component.

6. The method according to claim 3, characterized in that: The multiple candidate components include multiple candidate basic components and multiple candidate general components; the multiple candidate general components include general combination components; each of the general combination components is assembled from at least one of the candidate basic components and at least one candidate general component.

7. A test case generating device, characterized in that: The device comprises: A display module is used to display multiple candidate components pre-packaged for the business system to be tested in the test case generation page of the test platform; each of the candidate components encapsulates multiple interface function calls; different candidate components are used to implement different business functions of the business system; A selection module, configured to select, in response to a component selection operation, at least two target components indicated by the component selection operation from the plurality of candidate components; A generation module is used to obtain a component flow chart containing each selected target component in response to a connection operation on each selected target component; and generate a test case for the business system based on the connection relationship between each target component in the component flow chart.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Test case creation method and apparatus, computer equipment and storage medium

    CN107908542A

  • Visual task arrangement method and device and storage medium

    CN113448547A

  • Visual test case construction method and related equipment

    CN113868131A

  • Process monitoring method and device, equipment and storage medium

    CN114185750A