Test case generation method and device, equipment and storage medium

By receiving test case generation requests in the application creation platform, obtaining data structure declarations and logical architecture information, and using the model to generate test cases, the problem of slow test case generation and high cost in existing technologies is solved, and efficient test case generation and application testing are achieved.

CN119003324APending Publication Date: 2024-11-22BEIJING ZITIAO NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310576183.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-19
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In existing technologies, test case generation is slow and costly, making it difficult to efficiently generate test cases for applications.

Method used

The application creation platform receives test case generation requests, obtains data structure declarations and logical architecture information of functional blocks, and uses the model to generate multiple test cases.

Benefits of technology

It improves the efficiency of test case generation, simplifies the difficulty of test case generation, and enables efficient testing of applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003324A_ABST
    Figure CN119003324A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a test case generation method and device, equipment and a storage medium. The method comprises the following steps: receiving a test case generation request for at least one function block in a target application; in response to the test case generation request, obtaining a data structure statement related to the test case of the at least one function block; and utilizing the model to generate a plurality of test cases for the at least one function block at least based on the data structure declaration and the logical architecture information of the at least one function block. Therefore, the generation efficiency of the test case can be improved, the generation difficulty of the test case can be simplified, and partial or overall efficient testing of the application can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to methods, apparatuses, devices, and computer-readable storage media for test case generation. Background Art

[0002] With the rapid development of Internet technology, various applications have become important tools in people's daily lives. Different applications have different functions, and users can use specific applications with specific functions to achieve specific services. Application creation platforms, especially low-code platforms, can support users to develop applications efficiently, and achieve operations such as application creation and application function adjustment. During the application development process, it is sometimes necessary to test the application or part of the application. A large number of test cases are usually used during testing. Summary of the invention

[0003] In a first aspect of the present disclosure, a method for test case generation is provided. The method comprises: receiving a test case generation request for at least one functional block in a target application; in response to the test case generation request, obtaining a data structure declaration related to a test case of the at least one functional block; and using a model, generating a plurality of test cases for the at least one functional block based at least on the data structure declaration and logical architecture information of the at least one functional block.

[0004] In a second aspect of the present disclosure, a device for test case generation is provided. The device includes: a request receiving module configured to receive a test case generation request for at least one functional block in a target application; a declaration acquisition module configured to obtain a data structure declaration related to a test case of at least one functional block in response to the test case generation request; and a case generation module configured to generate multiple test cases for at least one functional block using a model based at least on the data structure declaration and logical architecture information of at least one functional block.

[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the electronic device executes the method of the first aspect.

[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the medium, and when the computer program is executed by a processor, the method of the first aspect is implemented.

[0007] It should be understood that the content described in this section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0009] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;

[0010] Figure 2 A flowchart showing a process of test case generation according to some embodiments of the present disclosure is shown;

[0011] Figure 3A A schematic diagram showing an example interface for initiating a test case generation request according to some embodiments of the present disclosure is shown;

[0012] Figure 3B A schematic diagram showing an example data structure declaration according to some embodiments of the present disclosure;

[0013] Figure 4 A schematic diagram showing relevant information of test cases according to some embodiments of the present disclosure;

[0014] Figure 5 A schematic structural block diagram of an apparatus for generating test cases according to some embodiments of the present disclosure is shown; and

[0015] Figure 6 A block diagram of an electronic device in which one or more embodiments of the present disclosure may be implemented is shown. DETAILED DESCRIPTION

[0016] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0017] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.

[0018] Herein, unless explicitly stated, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.

[0019] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0020] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scopes of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and their authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.

[0021] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can independently choose whether to provide information to software or hardware such as an electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.

[0022] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message is sent to the relevant user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.

[0023] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0024] A test case is a set of test inputs, execution conditions, and expected results compiled for test objectives when developing an application to verify whether the software meets a specific requirement.

[0025] Test case writing is usually done manually. Specifically, the tester confirms the input and expected output required for the function execution of the application under test, manually provides a complete set of test cases, and then drives the application under test to run the test cases for testing. This process is slow and costly.

[0026] According to an embodiment of the present disclosure, an improved solution for test case generation in an application creation platform is provided. According to the solution, a test case generation request for at least one functional block in a target application is received, and in response to the test case generation request, a related data structure declaration is obtained. Multiple test cases for at least one functional block are generated with the help of a model. In this way, the efficiency of test case generation can be improved, the difficulty of test case generation can be simplified, and efficient testing of part or all of an application can be achieved.

[0027] Figure 1 1 is a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. Figure 1 As shown, the application creation platform 110 can provide an application development and deployment environment. In some embodiments, the application creation platform 110 can be a low-code platform that provides a collection of tools for application development. The application creation platform 110 can support visual development of applications, so that developers can skip the manual coding process and speed up the application development cycle and cost. The application creation platform 110 can support any appropriate platform for users to develop applications, such as a platform based on application platform as a service (aPaaS).

[0028] The application creation platform 110 can be run on appropriate electronic devices. The electronic devices here can be any type of device with computing capabilities, including terminal devices or server devices. The terminal device can be any type of mobile terminal, fixed terminal or portable terminal, including mobile phones, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, media computers, multimedia tablets, personal communication systems (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / camcorders, positioning devices, television receivers, radio broadcast receivers, e-book devices, gaming devices, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. The server device can include, for example, a computing system / server, such as a mainframe, an edge computing node, a computing device in a cloud environment, and the like. In some embodiments, the application creation platform 110 can be implemented based on cloud services.

[0029] The application creation platform 110 may be deployed locally on the user's terminal device, and / or may be supported by a remote server. In some embodiments, the terminal device may run a client of the application creation platform 110, which may support the user's interaction with the application creation platform 110. In the case where the application creation platform 110 runs locally on the user's terminal device, the user may directly use the client to interact with the local application creation platform 110. In the case where the application creation platform 110 runs on a server device, the server device may provide services to the client running in the terminal device based on the communication connection with the terminal device.

[0030] The application creation platform 110 may be deployed with a digital assistant 120. The user 140 may interact with the digital assistant 120 via the application creation platform 110. The digital assistant 120 is used for dialogue with the user 140. The client of the application creation platform 110 may present an interaction window between the user 140 and the digital assistant 120, such as a conversation window, in the client interface. As an intelligent assistant, the digital assistant 120 has intelligent dialogue and information processing capabilities. The user 140 may enter a conversation message in the conversation window, and the digital assistant 120 provides a reply message in response to the user's conversation message.

[0031] In the application creation platform 110, the digital assistant 120 can be called or awakened by an appropriate method (e.g., a shortcut key, a button, or a voice) to present a conversation window with the user. In some embodiments, the digital assistant 120 can be included in the contact list of the current user in the application creation platform 110 as a contact of the user, or included in the information flow of the chat component. By selecting the digital assistant 120, a conversation window with the digital assistant 120 can be opened. In some embodiments, the digital assistant 120 can also be started in one or more components supported by the application creation platform 110, thereby presenting a conversation window with the digital assistant 120.

[0032] The application creation platform 110 can obtain the interaction information between the user 140 and the digital assistant 120 in the conversation window (including conversation messages from the user and reply messages from the digital assistant 120). In some embodiments, the application creation platform 110 can use the model 125 to understand the user's conversation messages and determine the next operation to be performed. The application creation platform 110 can interact with the model 125 to provide model input to the model 125 and obtain corresponding model output from the model 125. The model 125 can run locally on the application creation platform 110 or on a remote server. In some embodiments, the model 125 can be a machine learning model, a deep learning model, a learning model, a neural network, etc. In some embodiments, the model 125 can be based on a language model (LM). The language model can have question-and-answer capabilities by learning from a large amount of corpus. The model 125 can also be based on other appropriate models.

[0033] The database 130 is used to store data or information required for application processing operations to be performed by the application creation platform 110. For example, the database 130 can store codes and description information corresponding to each functional block used to constitute the application. The application creation platform 110 can also perform operations such as calling, adding, deleting, and updating the functional blocks in the database 130. The database 130 can also store operations that can be performed on different functional blocks. Exemplarily, in the scenario of creating an application 150, the application creation platform 110 can call the corresponding functional block from the database 130 to build the application 150.

[0034] It should be understood that the structure and functionality of environment 100 are described for exemplary purposes only and does not imply any limitation on the scope of the present disclosure.

[0035] As a low-code platform, the application creation platform, compared with the traditional code-based development platform, encapsulates the implementation details of the underlying code, turning the complex coding process into a relatively simpler drag-and-drop operation. Applications developed on such a platform also need to be tested, especially the horizontal integration testing of the data model, process, page and permission management in the application as a whole or functional block. Traditionally, such tests require a large amount of simulation data, and after sufficient understanding of the interfaces between the various related modules, the test data set must be generated manually. In the embodiments of the present disclosure, it is expected to simplify the test tasks and automatically and efficiently generate the required test cases with the help of the data generation capabilities of the model.

[0036] Some example embodiments of the present disclosure will be described in detail below with reference to examples of the accompanying drawings.

[0037] Figure 21 shows a flow chart of a process 200 for generating test cases according to some embodiments of the present disclosure. The process 200 may be implemented at the application creation platform 110. For ease of discussion, reference will be made to Figure 1 The process 200 is described with reference to the environment 100 of FIG.

[0038] In block 210 , the application creation platform 110 receives a test case generation request for at least one functional block in a target application. The target application may be an application being developed or already developed in the application creation platform 110 .

[0039] The target application may include one or more function blocks, also referred to as function points or applets. Each function block is configured to implement its own function, so that the service or task to be provided by the application can be realized together. The application creation platform 110 can support users to customize the atomic components (also referred to as atomic modules) of each function block to develop various applications. The atomic components can be more fine-grained components in the function block. The atomic components can include, for example, pages of function blocks, components of each operation control in the page, data forms, data flows, permission configuration of roles, application programming interfaces (APIs), and the like.

[0040] A test case generation request for the entire application or a test case generation request for one or more functional blocks in the application can be flexibly initiated in various ways. In some embodiments, a test case generation request for at least one functional block in the application can be obtained through the interaction between the user 140 and the digital assistant 120. The application creation platform 110 can receive user input in a conversation window between the user and the digital assistant 120, and the user input indicates a test case generation request for at least one functional block of the application. The application creation platform 110 can also receive user input in other appropriate ways. In some embodiments, the user input may include multimodal input, such as text input (e.g., input in natural language form), voice input, image input, video input, and the like.

[0041] Figure 3A A schematic diagram of an example interface 302 for initiating a test case generation request according to some embodiments of the present disclosure is shown. In the interface 302, it can be divided into at least a plurality of regions, such as a region 308 for presenting adjustment content associated with a functional block, a region 310 for presenting a visualization page of a target application, and a region 312 for presenting a session window for interacting with a user. In region 308, configurable functional blocks included in the target application, atomic components involved in each functional block, etc. can be presented for configuration by the user.

[0042] Area 312 presents a conversation window between the user 140 and the digital assistant 120. The user 140 can use the input box 316 to input creation, adjustment requirements, and test requirements for the current application. For example, if a conversation message 318 "Please help me test function E" input by the user is detected in the conversation window, the application creation platform 110 can determine (for example, by using the model 125) that function E in the current application needs to be tested and a test case needs to be generated for this test purpose. Note that the conversation window between the user and the digital assistant can be presented by default in the client interface of the application creation platform 110, or it can be presented based on any appropriate request, such as voice wake-up, wake-up through a specific button, or it can be presented in a reduced size and enlarged in response to a request, etc. These can all be configured according to actual application needs.

[0043] In some embodiments, the application creation platform 110 may provide a test case generation control, such as Figure 3A The "Automatic Test" control 315, "Generate Test Data" control, or any other appropriate style of control is shown. If the application creation platform 110 detects a preset operation of a test case generation control associated with at least one functional block in the application, it can be determined that a test case request for the functional block has been received. The preset operation can be, for example, a selection operation of the test case generation control and a selection operation of one or more functional blocks to be tested. For example, in Figure 3A In the example, the user may be allowed to select function block E in area 308 or select function block E in area 310 and then click on the “automatic test” control 315 to initiate a test case generation request.

[0044] Although the above example describes a test case generation request for a specific functional block in the target application, in other embodiments, a test case generation request for the entire target application may also be initiated.

[0045] return Figure 2 In response to the test case generation request, the application creation platform 110 obtains a data structure declaration related to the test case of at least one functional block in block 220. The data structure declaration is used to indicate the structure of the data included in the test case, for example, the input parameters, output parameters, parameter types, called interfaces, etc. included in the functional block.

[0046] Figure 3B Shown for Figure 3AThe example data structure declaration 320 of the function block E to be tested in the example may specify the interface of the function block E (e.g., "RpcParams"), various types of parameters (e.g., "userId", "date", etc.), the type of parameter (e.g., string "string" or numeric value "number"), etc. In some embodiments, the application creation platform 110 may provide the ability to automatically generate a data structure declaration for an application or a portion of an application, or the data structure declaration may be generated by other automated tools.

[0047] In block 230 , the application creation platform 110 generates a plurality of test cases for at least one functional block based on at least the data structure declaration and the logical architecture information of the at least one functional block using the model 125 .

[0048] In the embodiment of the present disclosure, the data generation capability of the model 125 is utilized to help realize automatic test case generation. In order to enable the model to generate test cases that meet the requirements or provide the test data required by the test cases, the input provided to the model 125 may include data structure declarations and logical structure information of the functional blocks to be tested.

[0049] The logical architecture information of a function block can indicate the function description, processing logic, and / or calling relationship of the function block, which helps to understand the specific operation principle of the function block. The application creation platform 110 can obtain the logical architecture information of the function block in various appropriate ways.

[0050] In some embodiments, the application creation platform 110 can extract the logical architecture information from the annotation information associated with the application, and the annotation information at least describes the function of one or more function blocks in the target application. In some embodiments, the annotation information can be associated with the code of the target application, for example, the annotation information can be included in the code of the target application. In some embodiments, during the development process of the target application, the application creation platform 110 may support the user to determine the specific functions of the function blocks in the application that the user wants to create and the required atomic components (for example, data forms, data flows, APIs, etc.) by interacting with the digital assistant 120. In this interactive process, the specific functions, logic, call relationships, etc. of the function blocks in the target application can be automatically extracted from the interactive information with the user, and annotated. In some embodiments, part or all of the annotation information can also be pre-defined by the developer of the target application. For example, the developer can add annotation information to one or more function blocks in the development process of the target application, and the application creation platform 110 can obtain the annotation information of the target application when acquiring the target application.

[0051] In some embodiments, the application creation platform 110 can use the model 125 to extract logical architecture information from the target application. Specifically, the application creation platform 110 can obtain the code of the target application and / or the description information about the target application, and provide the code of the target application and / or other description information to the model 125. In some embodiments, the application creation platform 110 can generate prompt word input for the model 125 based on the code and / or other description information of the target application. The application creation platform 110 can complete the generation of prompt word input through prompt word engineering. The generated prompt word input is provided to the model 125, so that the model 125 can determine the logical architecture information of the target application from the code and / or other description information of the target application, and feed it back to the application creation platform 110.

[0052] On the basis of obtaining the data structure declaration and the logical architecture information, in order to enable the model 125 to help generate multiple test cases, the application creation platform 110 can generate a prompt word input for the model 125 based on at least the data structure declaration and the logical architecture information, and the prompt word input also indicates the test case generation task. The application creation platform 110 can provide the prompt word input to the model 125, and obtain relevant information for generating multiple test cases from the model 125. For example, the model 125 can feedback a large amount of test data required in the test case, including input parameter values, output parameter values, etc. in each test case, as well as test scripts. The application creation platform 110 can generate multiple test cases based on at least the relevant information. Each test case can include test data, test scripts, etc. for one or more functional blocks to be tested, which can be assembled by automation tools based on the test data and test scripts.

[0053] Figure 4 A schematic diagram showing relevant information of test cases according to some embodiments of the present disclosure is shown. Figure 3B The data structure declaration of the model 125 can automatically generate multiple sets of data 410, 420, 430, etc. for multiple test cases.

[0054] In some embodiments, the application creation platform 110 may also obtain at least one test case sample for at least one functional block to be tested. The test case sample may be used as an example to enable the model 125 to attempt to simulate the generation of test cases that conform to the test case sample. The application creation platform 110 may use the model to generate multiple test cases based on the data structure declaration, the logical architecture information, and the at least one test case sample. For example, a prompt word input for the model 125 may be generated based on the data structure declaration, the logical architecture information, and the at least one test case sample. Figure 3BIn the example of FIG. 3 , a test case sample 322 for a functional block is shown, which gives examples of various parts in the data architecture declaration.

[0055] In some embodiments, the application creation platform 110 may also obtain test case constraints for at least one functional block from a user. Test case constraints may be restrictions imposed by a user on various test aspects of a functional block, for example, may include the total number of test cases to be generated, the relationship to be satisfied between inputs and outputs in a test case, and the like. Accordingly, the application creation platform 110 may utilize the model 125 to generate multiple test cases based on data structure declarations, logical architecture information, and test case constraints (and may also be based on test case samples). For example, a prompt word input for the model 125 may be generated based on data structure declarations, logical architecture information, and at least one test case sample.

[0056] In some embodiments, the application creation platform 110 can receive test case constraints for at least one functional block from the user in the conversation window between the user and the digital assistant 120. In this way, the user can be allowed to give test case constraints more conveniently and flexibly. In addition, with the interactive capabilities of the digital assistant 120, the user can be guided to correct or clarify the test case constraints when the user gives inappropriate test case constraints. Of course, the test case constraints can also be received in any other appropriate manner.

[0057] In some embodiments, the application creation platform 110 may also present the generated multiple test cases or instructions related to the multiple test cases in the conversation window between the user and the digital assistant 120 (for example, only presenting the instructions such as Figure 4 In some embodiments, after generating multiple test cases, the application creation platform 110 may directly use the multiple test cases to test at least one functional block to be tested in the target application, or may perform the test after receiving user confirmation of the multiple test cases. After the test is completed, the test results of each of the multiple test cases and / or the overall test results may be provided to the user.

[0058] In the embodiments of the present disclosure, with the help of the model, multiple test cases for the application or the functional blocks therein are automatically generated based on the data structure declaration and logical architecture information related to the application to be tested or the functional blocks therein. In this way, the efficiency of generating test cases can be improved, the difficulty of generating test cases can be simplified, and efficient testing of part or all of the application can be achieved.

[0059] Figure 5A schematic structural block diagram of a test case generation apparatus 500 according to some embodiments of the present disclosure is shown. The apparatus 500 may be implemented in or included in the application creation platform 110, for example. Each module / component in the apparatus 500 may be implemented by hardware, software, firmware, or any combination thereof.

[0060] As shown in the figure, the apparatus 500 includes a request receiving module 510, which is configured to receive a test case generation request for at least one functional block in the target application. The apparatus 500 also includes a declaration acquisition module 520, which is configured to obtain a data structure declaration related to a test case of at least one functional block in response to the test case generation request. The apparatus 500 also includes a case generation module 530, which is configured to generate multiple test cases for at least one functional block using a model based on at least the data structure declaration and the logical architecture information of at least one functional block.

[0061] In some embodiments, the use case generation module 530 includes: a task generation module, configured to generate a prompt word input for the model based on at least a data structure declaration and a logical architecture information, the prompt word input indicating a test case generation task; a prompt word providing module, configured to provide the prompt word input to the model; a relevant information generation module, configured to obtain relevant information for generating multiple test cases from the model; and a first use case generation module, configured to generate multiple test cases based at least on the relevant information.

[0062] In some embodiments, the use case generation module 530 includes: a sample acquisition module, configured to acquire at least one test case sample for at least one functional block; and a second use case generation module, configured to utilize a model to generate multiple test cases based on data structure declarations, logical architecture information, and at least one test case sample.

[0063] In some embodiments, the use case generation module 530 includes: a constraint acquisition module configured to obtain test case constraints for at least one functional block from a user; and a third use case generation module configured to generate multiple test cases based on data structure declarations, logical architecture information and test case constraints.

[0064] In some embodiments, the apparatus 500 further includes: an information extraction module configured to extract logical architecture information from annotation information associated with the application, wherein the annotation information at least describes the functions of one or more functional blocks in the target application.

[0065] In some embodiments, the logical architecture information indicates at least one of a functional description, a processing logic, and a calling relationship of at least one functional block.

[0066] In some embodiments, the request receiving module 510 includes: an input receiving module configured to receive user input in a conversation window between the user and the digital assistant, wherein the user input indicates a test case generation request for at least one functional block.

[0067] In some embodiments, the apparatus 500 further includes: a use case presentation module configured to present a plurality of test cases in a session window.

[0068] In some embodiments, the apparatus 500 further includes: a constraint receiving module configured to receive a test case constraint for at least one functional block from a user in a session window.

[0069] In some embodiments, the request receiving module 510 includes: a test case request receiving module configured to receive a test case request in response to detecting a preset operation of a test case generation control associated with at least one functional block.

[0070] The modules included in the device 500 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more modules can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the modules in the device 500 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0071] Figure 6 1 shows a block diagram of an electronic device 600 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 6 The electronic device 600 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Figure 6 The electronic device 600 shown can be used to operate Figure 1 The application creation platform 110 is provided.

[0072] like Figure 6As shown, the electronic device 600 is in the form of a general electronic device. The components of the electronic device 600 may include, but are not limited to, one or more processors or processing units 610, a memory 620, a storage device 630, one or more communication units 640, one or more input devices 650, and one or more output devices 660. The processing unit 610 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 620. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 600.

[0073] The electronic device 600 typically includes a plurality of computer storage media. Such media may be any accessible media that is accessible to the electronic device 600, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 620 may be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 630 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data and may be accessed within the electronic device 600.

[0074] The electronic device 600 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 6 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 620 may include a computer program product 625 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.

[0075] The communication unit 640 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 600 can be implemented with a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 600 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.

[0076] The input device 650 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 660 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 600 may also communicate with one or more external devices (not shown) through the communication unit 640 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 600, or communicate with any device that allows the electronic device 600 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).

[0077] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.

[0078] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0079] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0080] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0081] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.

[0082] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.

Claims

1. A test case generation method, comprising: receiving a test case generation request for at least one functional block in a target application; In response to the test case generation request, obtaining a data structure declaration related to the test case of the at least one functional block; as well as A plurality of test cases for the at least one functional block are generated based on at least the data structure declaration and the logical architecture information of the at least one functional block by using the model.

2. The method according to claim 1, wherein generating the plurality of test cases comprises: Based at least on the data structure declaration and the logic architecture information, generate a prompt word input for the model, wherein the prompt word input indicates a test case generation task; providing the cue word input to the model; Obtain relevant information for generating the plurality of test cases from the model; as well as The plurality of test cases are generated based at least on the relevant information.

3. The method according to claim 1, wherein generating the plurality of test cases comprises: Acquire at least one test case sample for the at least one functional block; as well as The plurality of test cases are generated using the model based on the data structure declaration, the logical architecture information, and the at least one test case sample.

4. The method according to claim 1, wherein generating the plurality of test cases comprises: Obtaining a test case constraint for the at least one functional block from a user; as well as The plurality of test cases are generated based on the data structure declaration, the logical architecture information, and the test case constraints.

5. The method according to claim 1, further comprising: The logical architecture information is extracted from annotation information associated with the application, wherein the annotation information at least describes functions of one or more functional blocks in the target application.

6. The method according to claim 1, wherein the logical architecture information indicates at least one of a functional description, a processing logic, and a calling relationship of the at least one functional block.

7. The method according to claim 1, wherein receiving the test case request comprises: A user input is received in a conversation window between the user and the digital assistant, wherein the user input indicates a request for generating the test case for the at least one functional block.

8. The method according to claim 7, further comprising: The plurality of test cases are presented in the session window.

9. The method according to claim 7, further comprising: A test case constraint for the at least one functional block is received from the user in the session window.

10. The method according to claim 1, wherein receiving the test case request comprises: In response to detecting a preset operation of a test case generation control associated with the at least one functional block, the test case request is received.

11. A device for generating test cases, comprising: A request receiving module, configured to receive a test case generation request for at least one functional block in a target application; a declaration acquisition module, configured to acquire a data structure declaration related to a test case of the at least one functional block in response to the test case generation request; as well as The use case generation module is configured to generate a plurality of test cases for the at least one functional block by using the model based at least on the data structure declaration and the logical architecture information of the at least one functional block.

12. An electronic device comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 10 when executed by the at least one processing unit.

13. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 10.