Test case generation method and apparatus, device 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 multiple test cases, the problem of slow speed and high cost of test case generation in existing technologies is solved, and efficient test case generation and application testing are achieved.

WO2024240100A1PCT designated stage expired Publication Date: 2024-11-28BEIJING ZITIAO NETWORK TECH CO LTD +1

Patent Information

Application Number
PCT/CN2024/094096
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-19
Filing Date
2024-05-18
Publication Date
2024-11-28

AI Technical Summary

Technical Problem

In existing technologies, the process of generating application test cases is slow and costly, making it difficult to generate test cases efficiently.

Method used

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 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 CN2024094096_28112024_PF_FP_ABST
    Figure CN2024094096_28112024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present disclosure are a test case generation method and apparatus, a device and a storage medium. 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, acquiring a data structure declaration associated with test cases of the at least one functional block; and at least on the bases of the data structure declaration and logic architecture information of the at least one functional block, using a model to generate a plurality of test cases for the at least one functional block. Therefore, the method can improve the efficiency of generating test cases, and simplify the generation difficulty of test cases, thus efficiently performing partial or overall testing on applications.
Need to check novelty before this filing date? Find Prior Art

Description

Method, apparatus, device and storage medium for test case generation

[0001] This application claims priority to the Chinese invention patent application entitled “Method, apparatus, device and storage medium for test case generation” and application number 2023105761830, filed on May 19, 2023, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to a method, apparatus, device, and computer-readable storage medium for generating test cases. Background Art

[0003] With the rapid development of internet technology, a wide variety of applications have become essential tools in people's daily lives. Different applications have different functions, and users can access specific services through specialized applications with specific functions. Application creation platforms, particularly low-code platforms, support efficient application development, enabling operations such as application creation and functional adjustments. During the application development process, it is sometimes necessary to test the application or a portion of it. This typically requires a large number of test cases.

[0004] Summary of the Invention

[0005] 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; obtaining, in response to the test case generation request, a data structure declaration associated with a test case for the at least one functional block; and generating, using a model, 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.

[0006] 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, in response to the test case generation request, acquire a data structure declaration related to a test case for the at least one functional block; and a use case generation module configured to utilize a model to generate multiple test cases for the at least one functional block based on at least the data structure declaration and logical architecture information of the at least one functional block.

[0007] 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 coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. When executed by the at least one processing unit, the instructions cause the electronic device to perform the method of the first aspect.

[0008] 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.

[0009] 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

[0010] 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:

[0011] FIG1 shows a schematic diagram of an example environment in which embodiments of the present disclosure can be implemented;

[0012] FIG2 shows a flowchart of a test case generation process according to some embodiments of the present disclosure;

[0013] FIG3A shows a schematic diagram of an example interface for initiating a test case generation request according to some embodiments of the present disclosure;

[0014] FIG3B shows a schematic diagram of an example data structure declaration according to some embodiments of the present disclosure;

[0015] FIG4 is a schematic diagram showing relevant information of a test case according to some embodiments of the present disclosure;

[0016] FIG5 shows a schematic structural block diagram of an apparatus for generating test cases according to some embodiments of the present disclosure; and

[0017] FIG6 illustrates a block diagram of an electronic device in which one or more embodiments of the present disclosure may be implemented. DETAILED DESCRIPTION

[0018] The following describes embodiments of the present disclosure in more detail 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 limited to the embodiments described herein. Rather, 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 for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0019] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, i.e., "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 be included below.

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

[0021] 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.

[0022] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the type, scope of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and authorization should be obtained from relevant users 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.

[0023] 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 the software or hardware such as the electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.

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

[0025] 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 comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

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

[0027] Test case writing is typically done manually. Specifically, testers identify the required inputs and expected outputs for the application under test, manually create a complete set of test cases, and then drive the application under test to run the test cases. This process is slow and costly.

[0028] According to an embodiment of the present disclosure, an improved solution for test case generation in an application creation platform is provided. This solution receives a test case generation request for at least one functional block in a target application and, in response to the test case generation request, obtains a related data structure declaration. Multiple test cases for the at least one functional block are generated using a model. This approach improves test case generation efficiency and simplifies the difficulty of test case generation, enabling efficient testing of parts or the entire application.

[0029] Figure 1 shows a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. As shown in Figure 1, an 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, allowing developers to 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, for example, it can include a platform based on Application Platform as a Service (aPaaS).

[0030] The application creation platform 110 can 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, for example, include 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.

[0031] 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 for the application creation platform 110, which may support user interaction with the application creation platform 110. When the application creation platform 110 runs locally on the user's terminal device, the user may directly interact with the local application creation platform 110 using the client. When the application creation platform 110 runs on a server device, the server device may, based on a communication connection with the terminal device, provide services to the client running on the terminal device.

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

[0033] In the application creation platform 110, the digital assistant 120 can be called or awakened by an appropriate means (e.g., a shortcut key, button, or voice) to present a conversation window with the user. In some embodiments, the digital assistant 120 can be included as a contact of the user in the current user's contact list in the application creation platform 110, 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 launched in one or more components supported by the application creation platform 110, thereby presenting a conversation window with the digital assistant 120.

[0034] 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.

[0035] Database 130 is used to store data or information required for application processing operations performed by application creation platform 110. For example, database 130 may store code and description information corresponding to each functional block that constitutes an application. Application creation platform 110 may also perform operations such as calling, adding, deleting, and updating the functional blocks in database 130. Database 130 may also store executable operations for different functional blocks. For example, when creating application 150, application creation platform 110 may call the corresponding functional blocks from database 130 to build application 150.

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

[0037] 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 blocks. Traditionally, such tests require a large amount of simulated 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 that with the help of the data generation capability of the model, the test tasks can be simplified and the required test cases can be automatically and efficiently generated.

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

[0039] 2 shows a flow chart of a process 200 for test case generation according to some embodiments of the present disclosure. The process 200 may be implemented at the application creation platform 110. For ease of discussion, the process 200 will be described with reference to the environment 100 of FIG. 1 .

[0040] 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 .

[0041] The target application may include one or more function blocks, also known as function points or applets. Each function block is configured to implement its own function, so that it can jointly implement the service or task to be provided by the application. The application creation platform 110 can support users to customize the atomic components (also known 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, the page of the function block, the components of each operation control in the page, data forms, data flows, role permission configuration, application programming interface (API), etc.

[0042] A test case generation request for the application as a whole 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 can include multimodal input, such as text input (for example, input in the form of natural language), voice input, image input, video input, and the like.

[0043] Figure 3A shows a schematic diagram of an example interface 302 for initiating a test case generation request according to some embodiments of the present disclosure. This interface 302 can be divided into at least a number of areas, such as an area 308 for presenting adjustment content associated with a functional block, an area 310 for presenting a visual page of the target application, and an area 312 for presenting a session window for user interaction. Area 308 can present the configurable functional blocks included in the target application, the atomic components involved in each functional block, and other information for user configuration.

[0044] What is presented in area 312 is the conversation window between the user 140 and the digital assistant 120. The user 140 can use the input box 316 to input the 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 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.

[0045] In some embodiments, the application creation platform 110 may provide a test case generation control, such as the "Automatic Test" control 315 shown in FIG3A , a "Generate Test Data" control, or any other appropriate style of control. 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 may be determined that a test case request for the functional block has been received. The preset operation may, for example, be a selection operation on the test case generation control and a selection operation on one or more functional blocks to be tested. For example, in FIG3A , the user may be allowed to select functional block E in area 308 or, after selecting functional block E in area 310, click the "Automatic Test" control 315 to initiate a test case generation request.

[0046] 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 may be initiated for the entire target application.

[0047] Returning to Figure 2 , in block 220 , in response to the test case generation request, the application creation platform 110 obtains a data structure declaration associated with a test case for at least one functional block. The data structure declaration specifies the structure of the data contained in the test case, and may include, for example, the functional block's input parameters, output parameters, parameter types, invoked interfaces, and so on.

[0048] FIG3B shows an example data structure declaration 320 for the function block E to be tested in the example of FIG3A , which may specify the interface of the function block E (e.g., "RpcParams"), various types of parameters (e.g., "userId," "date," etc.), parameter types (e.g., a string "string" or a 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.

[0049] In block 230 , the application creation platform 110 generates a plurality of test cases for the 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 .

[0050] In the embodiments of the present disclosure, the data generation capability of model 125 is utilized to facilitate automatic test case generation. To enable the model to generate test cases that meet requirements or provide the test data required for the test cases, the input provided to model 125 may include data structure declarations and logical structure information of the functional blocks to be tested.

[0051] 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 operating principle of the function block. The application creation platform 110 can obtain the logical architecture information of the function block through various appropriate methods.

[0052] In some embodiments, the application creation platform 110 can extract logical architecture information from the annotation information associated with the application, and the annotation information at least describes the function of one or more functional 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 functional 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. During this interaction process, the specific functions, logic, call relationships, etc. of the functional 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 functional blocks in the target application during the development process of the target application, and the application creation platform 110 can obtain the annotation information of the target application when obtaining the target application.

[0053] 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 descriptive information about the target application, and provide the code and / or other descriptive information of the target application to the model 125. In some embodiments, the application creation platform 110 can generate prompt input for the model 125 based on the code and / or other descriptive information of the target application. The application creation platform 110 can achieve the generation of prompt input through prompt engineering. The generated prompt 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 descriptive information of the target application and feed it back to the application creation platform 110.

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

[0055] Figure 4 shows a schematic diagram of test case related information according to some embodiments of the present disclosure. As shown in the figure, based on the data structure declaration of Figure 3B, the model 125 can automatically generate multiple sets of data 410, 420, 430, etc. for multiple test cases.

[0056] 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 can serve as an example, enabling the model 125 to attempt to simulate the generation of test cases that conform to the test case sample. The application creation platform 110 can 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 can be generated based on the data structure declaration, the logical architecture information, and the at least one test case sample. In the example of FIG3B , a test case sample 322 for a functional block is shown, which provides examples of various parts in the data architecture declaration.

[0057] 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 the user on various aspects of testing the functional block. For example, they may include the total number of test cases to be generated, the relationships to be satisfied between inputs and outputs in the test cases, and so on. Accordingly, the application creation platform 110 may utilize the model 125 to generate multiple test cases based on the data structure declaration, logical architecture information, and test case constraints (and may also be based on test case samples). For example, prompt word input for the model 125 may be generated based on the data structure declaration, logical architecture information, and at least one test case sample.

[0058] 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. This allows the user to provide test case constraints more conveniently and flexibly. In addition, with the interactive capabilities of the digital assistant 120, if the user provides inappropriate test case constraints, the user can be guided to correct or clarify the test case constraints. Of course, test case constraints can also be received through any other appropriate means.

[0059] 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 test data as shown in FIG4 , without presenting the underlying running script). 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.

[0060] In the embodiments of the present disclosure, a model is used to automatically generate multiple test cases for an application or its functional blocks based on the data structure declarations and logical architecture information related to the application to be tested or its functional blocks. This improves the efficiency and difficulty of test case generation, enabling efficient testing of parts or the entire application.

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

[0062] As shown, apparatus 500 includes a request receiving module 510 configured to receive a test case generation request for at least one functional block in a target application. Apparatus 500 also includes a declaration acquisition module 520 configured to, in response to the test case generation request, acquire a data structure declaration associated with a test case for the at least one functional block. Apparatus 500 also includes a use case generation module 530 configured to utilize a model to generate multiple 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.

[0063] 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 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 on at least the relevant information.

[0064] 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.

[0065] 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.

[0066] 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, where the annotation information at least describes the functions of one or more functional blocks in the target application.

[0067] 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.

[0068] 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, where the user input indicates a test case generation request for at least one functional block.

[0069] 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.

[0070] 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 the conversation window.

[0071] 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.

[0072] 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. By way of 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.

[0073] FIG6 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 the electronic device 600 shown in FIG6 is merely exemplary and should not be construed as limiting the functionality and scope of the embodiments described herein. The electronic device 600 shown in FIG6 can be used to run the application creation platform 110 of FIG1 .

[0074] As shown in FIG6 , electronic device 600 is a general-purpose electronic device. Components of electronic device 600 may include, but are not limited to, one or more processors or processing units 610, memory 620, storage device 630, one or more communication units 640, one or more input devices 650, and one or more output devices 660. Processing unit 610 may be a real or virtual processor and is capable of performing various processes according to programs stored in memory 620. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to enhance the parallel processing capabilities of electronic device 600.

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

[0076] The electronic device 600 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in FIG6 , 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 a 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 configured to perform various methods or actions of various embodiments of the present disclosure.

[0077] The communication unit 640 enables communication with other electronic devices via a communication medium. Additionally, the functions of the components of the electronic device 600 can be implemented in a single computing cluster or multiple computing machines that can communicate via a communication connection. Thus, 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.

[0078] The input device 650 may be one or more input devices, such as a mouse, keyboard, or trackball. The output device 660 may be one or more output devices, such as a display, a speaker, or a printer. 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, or the like, with one or more devices that allow a user to interact with the electronic device 600, or 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).

[0079] 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.

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

[0081] 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, such that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0082] 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, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0083] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple implementations of the present disclosure. In this regard, each 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 comprises one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented using a dedicated hardware-based system that performs the function or action of the specification, or can be implemented using a combination of dedicated hardware and computer instructions.

[0084] While various implementations of the present disclosure have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is selected to best explain the principles of the implementations, their practical applications, or improvements to existing technologies, or to enable others skilled 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 prompt 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.

Citation Information

Patent Citations

  • Test method and test system of engine controller software diagnosis module

    CN105224447A

  • Test case generating method and device

    CN106330601A

  • Test case generation method and device based on artificial intelligence, equipment and medium

    CN114968750A

  • System and method for determining test case, electronic equipment and storage medium

    CN115904984A

  • Modularizing and aspectizing graphical user interface directed test scripts

    US20110016453A1

Cited By

  • Database test case generation and optimization method, system and equipment and storage medium

    CN120162249A