WO2024240100A1 - 用于测试用例生成的方法、装置、设备和存储介质 - Google Patents
用于测试用例生成的方法、装置、设备和存储介质 Download PDFInfo
- Publication number
- WO2024240100A1 WO2024240100A1 PCT/CN2024/094096 CN2024094096W WO2024240100A1 WO 2024240100 A1 WO2024240100 A1 WO 2024240100A1 CN 2024094096 W CN2024094096 W CN 2024094096W WO 2024240100 A1 WO2024240100 A1 WO 2024240100A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- test case
- functional block
- test
- test cases
- data structure
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
Definitions
- 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.
- a method for test case generation 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.
- a device for generating a test case comprises: a request receiving module configured to receive a request for at least one of the target applications; A test case generation request for a functional block; 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 use case generation module, configured to generate multiple test cases for at least one functional block by using a model based at least on the data structure declaration and logical architecture information of at least one functional block.
- an electronic device in a third aspect of the present disclosure, 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.
- a computer-readable storage medium 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.
- FIG1 shows a schematic diagram of an example environment in which embodiments of the present disclosure can be implemented
- FIG2 shows a flow chart of a test case generation process according to some embodiments of the present disclosure
- FIG3A is a schematic diagram showing an example interface for initiating a test case generation request according to some embodiments of the present disclosure
- FIG3B shows a schematic diagram of an example data structure declaration according to some embodiments of the present disclosure
- FIG4 is a schematic diagram showing relevant information of a test case according to some embodiments of the present disclosure.
- FIG5 shows a schematic structural block diagram of an apparatus for generating test cases according to some embodiments of the present disclosure.
- FIG6 shows a block diagram of an electronic device in which one or more embodiments of the present disclosure may be implemented.
- executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.
- 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.
- 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 relevant user's information, so that the relevant user can autonomously select the operation based on the prompt message.
- 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.
- 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.
- 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.
- 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.
- an improved solution for test case generation in an application creation platform is provided.
- 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.
- FIG. 1 shows a schematic diagram of an example environment 100 in which an embodiment of the present disclosure can be implemented.
- an application creation platform 110 can provide an application development and deployment environment.
- 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, such as a platform based on an application platform as a service (aPaaS).
- aPaaS application platform as a service
- the application creation platform 110 may be run on a suitable electronic device, which may be any type of device with computing capabilities, including a terminal device or a server device.
- 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 system (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.
- PCS personal communication system
- PDAs personal digital assistants
- 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-side 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.
- the application creation platform 110 can be implemented based on a cloud service.
- the application creation platform 110 may be deployed locally on the user's terminal device, and/or may be supported by a remote server.
- 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.
- 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.
- the server device may provide services to the client running in the terminal device based on the communication connection with the terminal device.
- 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.
- 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.
- the digital assistant 120 can be called or awakened by an appropriate method (e.g., a shortcut key, a button, or voice) to present a conversation window with the user.
- 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, you can start a conversation with the digital assistant 120.
- the digital assistant 120 may 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.
- 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.
- the model 125 can be a machine learning model, a deep learning model, a learning model, a neural network, etc.
- 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.
- the database 130 is used to store data or information required for application processing operations to be performed by the application creation platform 110.
- 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.
- the application creation platform compared to traditional code-based development platforms, 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 horizontal integration testing of data models, processes, pages, and permission management in the application as a whole or functional blocks.
- 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 manually generated.
- FIG. 2 shows a flow chart of a process 200 of test case generation according to some embodiments of the present disclosure.
- the process 200 may be implemented at the application creation platform 110.
- the process 200 will be described with reference to the environment 100 of FIG. 1 .
- 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 .
- 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.
- 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.
- 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.
- 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.
- FIG3A shows a schematic diagram of an example interface 302 for initiating a test case generation request according to some embodiments of the present disclosure.
- the interface 302 can be divided into at least a plurality of regions, such as a region 308 for presenting adjustment contents 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.
- region 308 configurable information included in the target application can be presented.
- the functional blocks, the atomic components involved in each functional block, etc. are provided for user configuration.
- 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.
- 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.
- the application creation platform 110 may provide a test case generation control, such as the "Automatic Test” control 315 shown in FIG. 3A, 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 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.
- the user may be allowed to select functional block E in area 308 or select functional block E in area 310, and then click the "Automatic Test" control 315 to initiate a test case generation request.
- test case generation request for a specific functional block in the target application
- a test case generation request for the entire target application may also be initiated.
- the application creation platform 110 obtains a data structure declaration related to a test case of at least one functional block.
- 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.
- FIG. 3B shows an example data structure declaration 320 for the function block E to be tested in the example of FIG. 3A , which may specify the interface of the function block E (eg, “RpcParams”).
- Various types of parameters e.g., "userId”, “date”, etc.
- parameter types e.g., string “string” or numeric “number”
- the application creation platform 110 can provide the ability to automatically generate data structure declarations for an application or a portion of an application, or the data structure declaration can be generated by other automated tools.
- 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 .
- the data generation capability of the model 125 is utilized to help realize automatic test case generation.
- the input provided to the model 125 may include data structure declarations and logical structure information of the functional blocks to be tested.
- 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.
- 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.
- 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.
- 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.
- 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.
- the application creation platform 110 may use the model 125 to extract logical architecture information from the target application. Specifically, the application creation platform 110 may obtain the target application The application creation platform 110 can generate prompt input for the model 125 based on the code and/or other description information of the target application. The application creation platform 110 can generate prompt input for the model 125 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 description information of the target application, and feed it back to the application creation platform 110.
- 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.
- 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.
- Fig. 4 shows a schematic diagram of relevant information of a test case according to some embodiments of the present disclosure.
- the model 125 can automatically generate multiple sets of data 410, 420, 430, etc. for multiple test cases.
- the application creation platform 110 can also obtain at least one test case sample for at least one functional block to be tested.
- the test case sample can be used as an example to enable the model 125 to attempt to simulate the generation of test cases that meet 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.
- the 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.
- FIG. 3B a test case sample 322 for a functional block is shown, which gives examples of various parts in the data architecture declaration.
- the application creation platform 110 may also obtain information from the user regarding Test case constraints for at least one functional block.
- Test case constraints may be restrictions imposed by a user on various test aspects of a functional block, and may include, for example, the total number of test cases to be generated, the relationships to be satisfied between inputs and outputs in a test case, and the like.
- the application creation platform 110 may utilize the model 125 to generate a plurality of 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 the data structure declaration, logical architecture information, and at least one test case sample.
- 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.
- 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 FIG. 4 without presenting the underlying running script).
- 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.
- 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.
- 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.
- FIG. 5 shows a schematic structural block diagram of a test case generation apparatus 500 according to some embodiments of the present disclosure.
- the apparatus 500 may be implemented in or included in the application creation platform 110.
- Each module/component in the apparatus 500 may be implemented by hardware, software, firmware or any combination thereof.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- the apparatus 500 further includes: a use case presentation module configured to Multiple test cases are presented in the session window.
- 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.
- 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.
- the modules included in the device 500 can be implemented in various ways, including software, hardware, firmware, or any combination thereof.
- one or more modules can be implemented using software and/or firmware, such as machine executable instructions stored on a storage medium.
- some or all of the modules in the device 500 can be implemented at least in part by one or more hardware logic components.
- exemplary types of hardware logic components 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.
- 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 constitute any limitation on the functionality and scope of the embodiments described herein. The electronic device 600 shown in FIG6 may be used to run the application creation platform 110 of FIG1 .
- 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.
- the electronic device 600 typically includes a plurality of computer storage media. Such media may be any retrievable media 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, cache, random access memory (RAM)), a non-volatile
- 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 that may be capable of storing information and/or data and may be accessed within the electronic device 600.
- the electronic device 600 may further include additional removable/non-removable, volatile/non-volatile storage media.
- a disk drive for reading or writing from a removable, non-volatile disk e.g., a “floppy disk”
- an optical drive for reading or writing from a removable, non-volatile optical disk may be provided.
- 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.
- 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.
- PC network personal computer
- 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).
- I/O input/output
- a computer-readable storage medium on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above.
- a computer-readable storage medium is also provided.
- a computer program product 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.
- 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.
- 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.
- each box in the flowchart or block diagram may represent a module, a program segment, or a portion of an instruction, which contains one or more executable instructions for implementing a specified logical function.
- the functions marked in the boxes may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved.
- each box, block diagram and/or flowchart, As well as combinations of blocks in the block diagrams and/or flowcharts, can be implemented by dedicated hardware-based systems that perform the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
本公开的实施例提供了用于测试用例生成方法的方法、装置、设备和存储介质。该方法包括:接收针对目标应用中的至少一个功能块的测试用例生成请求;响应于测试用例生成请求,获取与至少一个功能块的测试用例相关的数据结构声明;以及利用模型,至少基于数据结构声明和至少一个功能块的逻辑架构信息来生成针对至少一个功能块的多个测试用例。由此,可以提升测试用例的生成效率,简化测试用例的生成难度,实现对应用的部分或整体的高效测试。
Description
本申请要求2023年5月19日递交的、标题为“用于测试用例生成的方法、装置、设备和存储介质”、申请号为2023105761830的中国发明专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
本公开的示例实施例总体涉及计算机领域,特别地涉及用于测试用例生成的方法、装置、设备和计算机可读存储介质。
随着互联网技术的飞速发展,各式各样的应用(Application)已经成为人们日常生活中的重要工具。不同的应用具有不同的功能,用户可以通过具有特定功能的特定应用实现特定服务。应用创建平台,特别是低代码平台,能够支持用户对应用进行高效开发,实现应用创建、应用功能调整等操作。在应用开发过程中,有时需要对应用或应用的一部分进行测试。测试时通常要用到大量的测试用例。
发明内容
在本公开的第一方面,提供了一种用于测试用例生成的方法。该方法包括:接收针对目标应用中的至少一个功能块的测试用例生成请求;响应于测试用例生成请求,获取与至少一个功能块的测试用例相关的数据结构声明;以及利用模型,至少基于数据结构声明和至少一个功能块的逻辑架构信息来生成针对至少一个功能块的多个测试用例。
在本公开的第二方面,提供了一种用于测试用例生成的装置。该装置包括:请求接收模块,被配置为接收针对目标应用中的至少一个
功能块的测试用例生成请求;声明获取模块,被配置为响应于测试用例生成请求,获取与至少一个功能块的测试用例相关的数据结构声明;以及用例生成模块,被配置为利用模型,至少基于数据结构声明和至少一个功能块的逻辑架构信息来生成针对至少一个功能块的多个测试用例。
在本公开的第三方面,提供了一种电子设备。该设备包括至少一个处理单元;以及至少一个存储器,至少一个存储器被耦合到至少一个处理单元并且存储用于由至少一个处理单元执行的指令。指令在由至少一个处理单元执行时使电子设备执行第一方面的方法。
在本公开的第四方面,提供了一种计算机可读存储介质。介质上存储有计算机程序,计算机程序被处理器执行时实现第一方面的方法。
应当理解,该部分中所描述的内容并非旨在限定本公开的实施例的关键特征或重要特征,也不用于限制本公开的范围。本公开的其他特征将通过以下的描述而变得容易理解。
结合附图并参考以下详细说明,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。在附图中,相同或相似的附图标记表示相同或相似的元素,其中:
图1示出了能够在其中实现本公开的实施例的示例环境的示意图;
图2示出了根据本公开的一些实施例的测试用例生成的过程的流程图;
图3A示出了根据本公开的一些实施例的用于发起测试用例生成请求的示例界面的示意图;
图3B示出了根据本公开的一些实施例的示例数据结构声明的示意图;
图4示出了根据本公开的一些实施例的测试用例的相关信息的示意图;
图5示出了根据本公开的一些实施例的用于测试用例生成的装置的示意性结构框图;以及
图6示出了可以实施本公开的一个或多个实施例的电子设备的框图。
下面将参照附图更详细地描述本公开的实施例。虽然附图中示出了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反,提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
在本公开的实施例的描述中,术语“包括”及其类似用语应当理解为开放性包含,即“包括但不限于”。术语“基于”应当理解为“至少部分地基于”。术语“一个实施例”或“该实施例”应当理解为“至少一个实施例”。术语“一些实施例”应当理解为“至少一些实施例”。下文还可能包括其他明确的和隐含的定义。
在本文中,除非明确说明,“响应于A”执行一个步骤并不意味着在“A”之后立即执行该步骤,而是可以包括一个或多个中间步骤。
可以理解的是,本技术方案所涉及的数据(包括但不限于数据本身、数据的获得、使用、存储或删除)应当遵循相应法律法规及相关规定的要求。
可以理解的是,在使用本公开各实施例公开的技术方案之前,均应当根据相关法律法规通过适当的方式对本公开所涉及信息的类型、使用范围、使用场景等告知相关用户并获得相关用户的授权,其中,相关用户可以包括任何类型的权利主体,例如个人、企业、团体。
例如,在响应于接收到用户的主动请求时,向相关用户发送提示信息,以明确地提示相关用户,其请求执行的操作将需要获得和使用到相关用户的信息,从而使得相关用户可以根据提示信息来自主地选
择是否向执行本公开技术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供信息。
作为一种可选的但非限制性的实现方式,响应于接收到相关用户的主动请求,向相关用户发送提示信息的方式,例如可以是弹窗的方式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或“不同意”向电子设备提供信息的选择控件。
可以理解的是,上述通知和获得用户授权过程仅是示意性的,不对本公开的实现方式构成限定,其他满足相关法律法规的方式也可应用于本公开的实现方式中。
测试用例是在开发应用时为测试目标而编制的一组测试输入、执行条件以及预期结果,用于核实软件是否满足某个特定需求。
测试用例的编写通常是由人力完成。具体是由测试人员确认被测应用的功能执行所需的输入和预期输出,手动给出完整的测试用例集,然后驱动被测应用运行测试用例进行测试。这一过程速度慢、成本高。
根据本公开的实施例,提供了在应用创建平台中测试用例生成的改进方案。根据该方案,接收针对目标应用中的至少一个功能块的测试用例生成请求,并响应于测试用例生成请求,获取相关的数据结构声明。借助模型来生成针对至少一个功能块的多个测试用例。以此方式,可以提升测试用例的生成效率,简化测试用例的生成难度,实现对应用的部分或整体的高效测试。
图1示出了本公开的实施例能够在其中实现的示例环境100的示意图。如图1所示,应用创建平台110可以提供应用的开发和部署环境。在一些实施例中,应用创建平台110可以是低代码平台,其提供应用开发的工具合集。应用创建平台110可以支持对应用的可视化开发,从而使开发人员可以跳过手工编码的过程,加快应用的开发周期和成本。应用创建平台110可以支持用户开发应用的任何适当平台,例如可以包括基于应用平台即服务(aPaaS)的平台。
应用创建平台110可以运行在适当的电子设备。这里的电子设备可以是任何类型的具有计算能力的设备,包括终端设备或服务端设备。
终端设备可以是任何类型的移动终端、固定终端或便携式终端,包括移动手机、台式计算机、膝上型计算机、笔记本计算机、上网本计算机、平板计算机、媒体计算机、多媒体平板、个人通信系统(PCS)设备、个人导航设备、个人数字助理(PDA)、音频/视频播放器、数码相机/摄像机、定位设备、电视接收器、无线电广播接收器、电子书设备、游戏设备或者前述各项的任何组合,包括这些设备的配件和外设或者其任何组合。服务端设备例如可以包括计算系统/服务器,诸如大型机、边缘计算节点、云环境中的计算设备,等等。在一些实施例中,应用创建平台110可以基于云服务来实现。
应用创建平台110可以被部署在用户的终端设备本地,和/或可以由远程服务器来支持。在一些实施例中,终端设备可以运行有应用创建平台110的客户端,该客户端可以支持用户与应用创建平台110的交互。在应用创建平台110运行在用户的终端设备本地的情况下,用户可以直接利用客户端与本地的应用创建平台110进行交互。在应用创建平台110运行在服务端设备的情况下,服务端设备可以基于与终端设备之间的通信连接,实现对终端设备中运行的客户端的服务的供应。
应用创建平台110可以部署有数字助手120。用户140可以经由应用创建平台110与数字助手120进行交互。数字助手120用于与用户140的对话。应用创建平台110的客户端可以在客户端界面中呈现用户140与数字助手120的交互窗口,例如会话窗口。数字助手120作为一种智能助手,具有智能对话和信息处理能力。用户140可以在会话窗口中输入会话消息,数字助手120响应于用户的会话消息来提供回复消息。
在应用创建平台110中,数字助手120可以通过适当的方式(例如,快捷键、按钮或语音)被调用或被唤醒,以呈现与用户的会话窗口。在一些实施例中,数字助手120可以作为用户的联系人,被包括在当前用户在应用创建平台110的联系人列表中,或者被包括在聊天组件的信息流中。通过选择数字助手120,可以开启与数字助手120
的会话窗口。在一些实施例中,还可以在应用创建平台110所支持的一个或多个组件中启动数字助手120,从而呈现与数字助手120的会话窗口。
应用创建平台110可以获取用户140与数字助手120在会话窗口中的交互信息(包括来自用户的会话消息以及来自数字助手120的回复消息)。在一些实施例中,应用创建平台110可以借助模型125来理解用户的会话消息,以及确定要执行的下一步操作。应用创建平台110可以与模型125进行交互,以向模型125提供模型输入,并从模型125获得对应的模型输出。模型125可以运行在应用创建平台110的本地或者在远端服务器。在一些实施例中,模型125可以是机器学习模型、深度学习模型、学习模型、神经网络等。在一些实施例中,模型125可以基于语言模型(LM)。语言模型通过从大量语料中学习,能够具备问答能力。模型125也可以基于其他适当的模型。
数据库130用于存储应用创建平台110要执行的应用处理操作所需的数据或信息。例如,数据库130可以存储用于组成应用的各个功能块对应的代码和描述信息等。应用创建平台110还可以对数据库130中的功能块执行调用、增加、删除、更新等操作。数据库130还可以存储对不同功能块可执行的操作。示例性的,在要创建应用150的场景,应用创建平台110可以从数据库130中调用相应的功能块来搭建应用150。
应当理解,仅出于示例性的目的描述环境100的结构和功能,而不暗示对于本公开的范围的任何限制。
应用创建平台作为一种低代码平台,相较于传统的基于代码的开发平台,通过封装底层代码的实现细节,将复杂的编码过程变成了相对更简单的拖拉拽操作。在这样的平台上开发的应用也需要测试,特别是对应用整体或功能块中的数据模型、流程、页面和权限管理的横向的集成测试。传统上,这类测试都需要大量的模拟数据,并且需要对各个相关模块之间的接口足够了解后,通过人工方式生成测试数据集。在本公开的实施例中,期望借助模型的数据生成能力,简化测试
任务,自动高效生成需要的测试用例。
以下将参考附图的示例来详细描述本公开的一些示例实施例。
图2示出了根据本公开的一些实施例的测试用例生成的过程200的流程图。过程200可以被实现在应用创建平台110处。为便于讨论,将参考图1的环境100来描述过程200。
在框210,应用创建平台110接收针对目标应用中的至少一个功能块的测试用例生成请求。目标应用可以是在应用创建平台110中正在开发或已开发的应用。
目标应用可以包括一个或多个功能块,也称为功能点或小应用程序(applet)。每个功能块被配置为实现各自的功能,从而能够共同实现应用所要提供的服务或任务。应用创建平台110可以支持用户自定义各个功能块的原子组成部分(也称为原子模块)来开发各种应用。原子组成部分可以是功能块中更细粒度的组成部分。原子组成部分例如可以包括功能块的页面、页面中各个操作控件的部件、数据表单、数据流程、角色的权限配置、应用接口(API),等等。
可以通过各种方式来灵活地发起针对应用整体的测试用例生成请求或应用中的一个或多个功能块的测试用例生成请求。在一些实施例中,可以通过用户140与数字助手120之间的交互来获得针对应用中的至少一个功能块的测试用例生成请求。应用创建平台110可以在用户与数字助手120的会话窗口中接收用户输入,用户输入指示针对应用的至少一个功能块的测试用例生成请求。应用创建平台110还可以通过其他适当的方式接收用户输入。在一些实施例中,用户输入可以包括多模态形式的输入,诸如文本输入(例如,自然语言形式的输入)、语音输入、图像输入、视频输入,等等。
图3A示出了根据本公开的一些实施例的用于发起测试用例生成请求的示例界面302的示意图。在该界面302中,可以至少分为多个个区域,例如用于呈现与功能块关联的调整内容的区域308、用于呈现目标应用的可视化页面的区域310以及呈现用于与用户交互的会话窗口的区域312。在区域308中,可以呈现目标应用所包括的可配置
的功能块,每个功能块涉及的原子组成部分等,以供用户进行配置。
区域312中呈现的是用户140与数字助手120的会话窗口,用户140可以利用该输入框316中输入针对当前应用的创建、调整需求,以及测试需求。例如,如果在会话窗口中检测到用户输入的会话消息318“请帮我测试功能E”,应用创建平台110可以确定(例如,通过借助模型125确定)要对当前应用中的功能E进行测试,需生成测试用例用于该测试目的。注意,用户与数字助手之间的会话窗口可以默认呈现在应用创建平台110的客户端界面中,也可以基于任何适当的请求被呈现,例如语音唤醒、通过特定按钮唤醒,或者可以被缩小呈现并响应于请求而被放大,等等。这些都是可以根据实际应用需要来配置。
在一些实施例中,应用创建平台110可以提供测试用例生成控件,例如图3A所示的“自动测试”控件315,“生成测试数据”控件,或任何其他适当样式的控件。如果应用创建平台110检测到与应用中的至少一个功能块相关联的测试用例生成控件的预设操作,则可以确定接收到对该功能块的测试用例请求。预设操作例如可以是对测试用例生成控件的选择操作以及对要测试的一个或多个功能块的选择操作。例如,在图3A中,可以允许用户在区域308中选中功能块E或在区域310中选中功能块E后,点击“自动测试”控件315,以发起测试用例生成请求。
在上述示例中虽然描述了对目标应用中的特定功能块的测试用例生成请求,在其他实施例中,还可以发起对目标应用整体的测试用例生成请求。
返回图2,在框220,响应于测试用例生成请求,应用创建平台110获取与至少一个功能块的测试用例相关的数据结构声明。数据结构声明用于指明测试用例所包含的数据的结构,例如可以包括功能块所包含的输入参数、输出参数、参数的类型、所调用的接口等等。
图3B示出了针对图3A的示例中要测试的功能块E的示例数据结构声明320,其可以指定功能块E的接口(例如,“RpcParams”),
各类参数(例如,“userId”,“date”等),参数的类型(例如,字符串“string”或数值“number”)等等。在一些实施例中,应用创建平台110可以提供针对应用或应用的一部分自动生成数据结构声明的能力,或者可以通过其他自动化工具来生成数据结构声明。
在框230,应用创建平台110利用模型125,至少基于数据结构声明和至少一个功能块的逻辑架构信息来生成针对至少一个功能块的多个测试用例。
在本公开的实施例中,利用模型125的数据生成能力,来帮助实现自动测试用例生成。为了使模型能够生成符合要求的测试用例或者提供测试用例所需的测试数据,提供给模型125的输入可以包括要测试的功能块的数据结构声明和逻辑结构信息。
功能块的逻辑架构信息能够指示该功能块的功能描述、处理逻辑、和/或调用关系等,这有助于了解功能块的具体运行原理。应用创建平台110可以通过各种适当方式来获取到功能块的逻辑架构信息。
在一些实施例中,应用创建平台110可以从与应用相关联的注释信息中提取逻辑架构信息,注释信息至少描述目标应用中的一个或多个功能块的功能。在一些实施例中,注释信息可以是与目标应用的代码相关联的,例如,注释信息可以被包括在目标应用的代码中。在一些实施例中,在目标应用的开发过程中,应用创建平台110可能会支持用户通过与数字助手120交互的方式来确定用户想要创建的应用中的功能块的具体功能、所需要的原子组成部分(例如,数据表单、数据流程、API等)。在该交互过程中,可以从与用户的交互信息中自动提取出目标应用中的功能块的具体功能、逻辑、调用关系等,并进行注释。在一些实施例中,注释信息的部分或全部也可以是目标应用的开发人员预先定义的。例如,开发人员可以在目标应用的开发过程中对其中的一个或多个功能块添加注释信息,应用创建平台110可以在获取目标应用时,获取到目标应用的注释信息。
在一些实施例中,应用创建平台110可以利用模型125从目标应用提取逻辑架构信息。具体地,应用创建平台110可以获取目标应用
的代码和/或关于目标应用的描述信息,并将目标应用的代码和/或其他描述信息提供给模型125。在一些实施例中,应用创建平台110可以基于目标应用的代码和/或其他描述信息来生成针对模型125的提示词输入。应用创建平台110可以通过提示词工程(prompt engineering)完成实现提示词输入的生成。所生成的提示词输入被提供给模型125,这样模型125可以从目标应用的代码和/或其他描述信息中确定目标应用的逻辑架构信息,并反馈给应用创建平台110。
在获得数据结构声明和逻辑架构信息的基础上,为让模型125能够帮助生成多个测试用例,应用创建平台110可以至少基于数据结构声明和逻辑架构信息,生成针对模型125的提示词输入,提示词输入还指示测试用例生成任务。应用创建平台110可以将提示词输入提供给模型125,并从模型125获得用于生成多个测试用例的相关信息。例如,模型125可以反馈测试用例中所需要的大量测试数据,包括各个测试用例中的输入参数值、输出参数值等,以及测试脚本。应用创建平台110可以至少基于相关信息来生成多个测试用例。每个测试用例可以包括用于对要测试的一个或多个功能块的测试数据、测试脚本等,这可以在测试数据、测试脚本基础上通过自动化工具来组装。
图4示出了根据本公开的一些实施例的测试用例的相关信息的示意图。如图所示,基于图3B的数据结构声明,模型125可以自动生成针对多个测试用例的多组数据410、420、430等。
在一些实施例中,应用创建平台110还可以获取针对要测试的至少一个功能块的至少一个测试用例样本。测试用例样本可以作为示例,使模型125能够尝试模拟符合测试用例样本的测试用例生成。应用创建平台110可以利用模型,基于数据结构声明、逻辑架构信息和至少一个测试用例样本来生成多个测试用例。例如,可以基于数据结构声明、逻辑架构信息和至少一个测试用例样本,来生成针对模型125的提示词输入。在图3B的示例中,示出了针对功能块的测试用例样本322,其给出了数据架构声明中各个部分的示例。
在一些实施例中,应用创建平台110还可以获得来自用户的针对
至少一个功能块的测试用例约束。测试用例约束可以是用户对功能块的各个测试方面所要施加的限制,例如,可以包括要生成的测试用例的总数目、测试用例中输入与输出之间要满足的关系,等等。相应地,应用创建平台110可以利用模型125,基于数据结构声明、逻辑架构信息和测试用例约束(以及还可以基于测试用例样本)来生成多个测试用例。例如,可以基于数据结构声明、逻辑架构信息和至少一个测试用例样本,来生成针对模型125的提示词输入。
在一些实施例中,应用创建平台110可以在用户与数字助手120的会话窗口中接收来自用户的针对至少一个功能块的测试用例约束。这样,可以允许用户更方便、灵活地给出测试用例约束。此外,借助数字助手120的交互能力,还可以在用户给出不恰当的测试用例约束的情况下,引导用户纠正、或澄清测试用例约束。当然,还可以通过任何其他适当方式来接收测试用例约束。
在一些实施例中,应用创建平台110还可以在用户与数字助手120的会话窗口中呈现所生成的多个测试用例或与多个测试用例相关的指示(例如,仅呈现如图4所示的测试数据,而不呈现底层运行脚本)。在一些实施例中,在生成多个测试用例后,应用创建平台110可以直接利用多个测试用例来测试目标应用中要测试的至少一个功能块,或者可以在接收到对多个测试用例的用户确认后再执行测试。在测试完成后,可以向用户提供多个测试用例各自的测试结果,和/或总体测试结果。
在本公开的实施例中,借助模型,基于要测试的应用或其中的功能块相关的数据结构声明和逻辑架构信息来自动生成针对应用或其中的功能块的多个测试用例。以此方式,可以提升测试用例的生成效率,简化测试用例的生成难度,实现对应用的部分或整体的高效测试。
图5示出了根据本公开的一些实施例的测试用例生成的装置500的示意性结构框图。装置500例如可以被实现在或被包括在应用创建平台110中。装置500中的各个模块/组件可以由硬件、软件、固件或者它们的任何组合来实现。
如图所示,装置500包括请求接收模块510,被配置为接收针对目标应用中的至少一个功能块的测试用例生成请求。装置500还包括声明获取模块520,被配置为响应于测试用例生成请求,获取与至少一个功能块的测试用例相关的数据结构声明。装置500还包括用例生成模块530,被配置为利用模型,至少基于数据结构声明和至少一个功能块的逻辑架构信息来生成针对至少一个功能块的多个测试用例。
在一些实施例中,用例生成模块530包括:任务生成模块,被配置为至少基于数据结构声明和逻辑架构信息,生成针对模型的提示词输入,提示词输入指示测试用例生成任务;提示词提供模块,被配置为将提示词输入提供给模型;相关信息生成模块,被配置为从模型获得用于生成多个测试用例的相关信息;以及第一用例生成模块,被配置为至少基于相关信息来生成多个测试用例。
在一些实施例中,用例生成模块530包括:样本获取模块,被配置为获取针对至少一个功能块的至少一个测试用例样本;以及第二用例生成模块,被配置为利用模型,基于数据结构声明、逻辑架构信息和至少一个测试用例样本来生成多个测试用例。
在一些实施例中,用例生成模块530包括:约束获取模块,被配置为获得来自用户的针对至少一个功能块的测试用例约束;以及第三用例生成模块,被配置为基于数据结构声明、逻辑架构信息和测试用例约束来生成多个测试用例。
在一些实施例中,装置500还包括:信息提取模块,被配置为从与应用相关联的注释信息中提取逻辑架构信息,注释信息至少描述目标应用中的一个或多个功能块的功能。
在一些实施例中,逻辑架构信息指示至少一个功能块的功能描述、处理逻辑和调用关系中的至少一项。
在一些实施例中,请求接收模块510包括:输入接收模块,被配置为在用户与数字助手的会话窗口中接收用户输入,用户输入指示针对至少一个功能块的测试用例生成请求。
在一些实施例中,装置500还包括:用例呈现模块,被配置为在
会话窗口中呈现多个测试用例。
在一些实施例中,装置500还包括:约束接收模块,被配置为在会话窗口中接收来自用户的针对至少一个功能块的测试用例约束。
在一些实施例中,请求接收模块510包括:用例请求接收模块,被配置为响应于检测到与至少一个功能块相关联的测试用例生成控件的预设操作,接收测试用例请求。
装置500中所包括的模块可以利用各种方式来实现,包括软件、硬件、固件或其任何组合。在一些实施例中,一个或多个模块可以使用软件和/或固件来实现,例如存储在存储介质上的机器可执行指令。除了机器可执行指令之外或者作为替代,装置500中的部分或者全部模块可以至少部分地由一个或多个硬件逻辑组件来实现。作为示例而非限制,可以使用的示范类型的硬件逻辑组件包括现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准品(ASSP)、片上系统(SOC)、复杂可编程逻辑器件(CPLD),等等。
图6示出了其中可以实施本公开的一个或多个实施例的电子设备600的框图。应当理解,图6所示出的电子设备600仅仅是示例性的,而不应当构成对本文所描述的实施例的功能和范围的任何限制。图6所示出的电子设备600可以用于运行图1的应用创建平台110。
如图6所示,电子设备600是通用电子设备的形式。电子设备600的组件可以包括但不限于一个或多个处理器或处理单元610、存储器620、存储设备630、一个或多个通信单元640、一个或多个输入设备650以及一个或多个输出设备660。处理单元610可以是实际或虚拟处理器并且能够根据存储器620中存储的程序来执行各种处理。在多处理器系统中,多个处理单元并行执行计算机可执行指令,以提高电子设备600的并行处理能力。
电子设备600通常包括多个计算机存储介质。这样的介质可以是电子设备600可访问的任何可以获取的介质,包括但不限于易失性和非易失性介质、可拆卸和不可拆卸介质。存储器620可以是易失性存储器(例如寄存器、高速缓存、随机访问存储器(RAM))、非易失
性存储器(例如,只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、闪存)或它们的某种组合。存储设备630可以是可拆卸或不可拆卸的介质,并且可以包括机器可读介质,诸如闪存驱动、磁盘或者任何其他介质,其可以能够用于存储信息和/或数据并且可以在电子设备600内被访问。
电子设备600可以进一步包括另外的可拆卸/不可拆卸、易失性/非易失性存储介质。尽管未在图6中示出,可以提供用于从可拆卸、非易失性磁盘(例如“软盘”)进行读取或写入的磁盘驱动和用于从可拆卸、非易失性光盘进行读取或写入的光盘驱动。在这些情况中,每个驱动可以由一个或多个数据介质接口被连接至总线(未示出)。存储器620可以包括计算机程序产品625,其具有一个或多个程序模块,这些程序模块被配置为执行本公开的各种实施例的各种方法或动作。
通信单元640实现通过通信介质与其他电子设备进行通信。附加地,电子设备600的组件的功能可以以单个计算集群或多个计算机器来实现,这些计算机器能够通过通信连接进行通信。因此,电子设备600可以使用与一个或多个其他服务器、网络个人计算机(PC)或者另一个网络节点的逻辑连接来在联网环境中进行操作。
输入设备650可以是一个或多个输入设备,例如鼠标、键盘、追踪球等。输出设备660可以是一个或多个输出设备,例如显示器、扬声器、打印机等。电子设备600还可以根据需要通过通信单元640与一个或多个外部设备(未示出)进行通信,外部设备诸如存储设备、显示设备等,与一个或多个使得用户与电子设备600交互的设备进行通信,或者与使得电子设备600与一个或多个其他电子设备通信的任何设备(例如,网卡、调制解调器等)进行通信。这样的通信可以经由输入/输出(I/O)接口(未示出)来执行。
根据本公开的示例性实现方式,提供了一种计算机可读存储介质,其上存储有计算机可执行指令,其中计算机可执行指令被处理器执行以实现上文描述的方法。根据本公开的示例性实现方式,还提供了一
种计算机程序产品,计算机程序产品被有形地存储在非瞬态计算机可读介质上并且包括计算机可执行指令,而计算机可执行指令被处理器执行以实现上文描述的方法。
这里参照根据本公开实现的方法、装置、设备和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理单元,从而生产出一种机器,使得这些指令在通过计算机或其他可编程数据处理装置的处理单元执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
可以把计算机可读程序指令加载到计算机、其他可编程数据处理装置、或其他设备上,使得在计算机、其他可编程数据处理装置或其他设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其他可编程数据处理装置、或其他设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实现的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、
以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
以上已经描述了本公开的各实现,上述说明是示例性的,并非穷尽性的,并且也不限于所公开的各实现。在不偏离所说明的各实现的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实现的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其他普通技术人员能理解本文公开的各个实现方式。
Claims (13)
- 一种测试用例生成方法,包括:接收针对目标应用中的至少一个功能块的测试用例生成请求;响应于所述测试用例生成请求,获取与所述至少一个功能块的测试用例相关的数据结构声明;以及利用模型,至少基于所述数据结构声明和所述至少一个功能块的逻辑架构信息来生成针对所述至少一个功能块的多个测试用例。
- 根据权利要求1所述的方法,其中生成所述多个测试用例包括:至少基于所述数据结构声明和所述逻辑架构信息,生成针对所述模型的提示词输入,所述提示词输入指示测试用例生成任务;将所述提示词输入提供给所述模型;从所述模型获得用于生成所述多个测试用例的相关信息;以及至少基于所述相关信息来生成所述多个测试用例。
- 根据权利要求1所述的方法,其中生成所述多个测试用例包括:获取针对所述至少一个功能块的至少一个测试用例样本;以及利用所述模型,基于所述数据结构声明、所述逻辑架构信息和所述至少一个测试用例样本来生成所述多个测试用例。
- 根据权利要求1所述的方法,其中生成所述多个测试用例包括:获得来自用户的针对所述至少一个功能块的测试用例约束;以及基于所述数据结构声明、所述逻辑架构信息和所述测试用例约束来生成所述多个测试用例。
- 根据权利要求1所述的方法,还包括:从与所述应用相关联的注释信息中提取所述逻辑架构信息,所述注释信息至少描述所述目标应用中的一个或多个功能块的功能。
- 根据权利要求1所述的方法,其中所述逻辑架构信息指示所述至少一个功能块的功能描述、处理逻辑和调用关系中的至少一项。
- 根据权利要求1所述的方法,其中接收所述测试用例请求包括:在用户与数字助手的会话窗口中接收用户输入,所述用户输入指示针对所述至少一个功能块的所述测试用例生成请求。
- 根据权利要求7所述的方法,还包括:在所述会话窗口中呈现所述多个测试用例。
- 根据权利要求7所述的方法,还包括:在所述会话窗口中接收来自所述用户的针对所述至少一个功能块的测试用例约束。
- 根据权利要求1所述的方法,其中接收所述测试用例请求包括:响应于检测到与所述至少一个功能块相关联的测试用例生成控件的预设操作,接收所述测试用例请求。
- 一种用于测试用例生成的装置,包括:请求接收模块,被配置为接收针对目标应用中的至少一个功能块的测试用例生成请求;声明获取模块,被配置为响应于所述测试用例生成请求,获取与所述至少一个功能块的测试用例相关的数据结构声明;以及用例生成模块,被配置为利用模型,至少基于所述数据结构声明和所述至少一个功能块的逻辑架构信息来生成针对所述至少一个功能块的多个测试用例。
- 一种电子设备,包括:至少一个处理单元;以及至少一个存储器,所述至少一个存储器被耦合到所述至少一个处理单元并且存储用于由所述至少一个处理单元执行的指令,所述指令在由所述至少一个处理单元执行时使所述电子设备执行根据权利要求1至10中任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序可由处理器执行以实现根据权利要求1至10中任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310576183.0A CN119003324A (zh) | 2023-05-19 | 2023-05-19 | 用于测试用例生成的方法、装置、设备和存储介质 |
| CN202310576183.0 | 2023-05-19 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024240100A1 true WO2024240100A1 (zh) | 2024-11-28 |
Family
ID=93478778
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/094096 Ceased WO2024240100A1 (zh) | 2023-05-19 | 2024-05-18 | 用于测试用例生成的方法、装置、设备和存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN119003324A (zh) |
| WO (1) | WO2024240100A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120162249A (zh) * | 2025-02-08 | 2025-06-17 | 浙江智臾科技有限公司 | 数据库测试用例生成与优化方法、系统、设备和存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110016453A1 (en) * | 2009-07-16 | 2011-01-20 | Accenture Global Services Gmbh | Modularizing and aspectizing graphical user interface directed test scripts |
| CN105224447A (zh) * | 2014-06-11 | 2016-01-06 | 联创汽车电子有限公司 | 发动机控制器软件诊断模块测试方法及测试系统 |
| CN106330601A (zh) * | 2016-08-19 | 2017-01-11 | 北京匡恩网络科技有限责任公司 | 测试用例生成方法及装置 |
| CN114968750A (zh) * | 2021-02-23 | 2022-08-30 | 腾讯科技(深圳)有限公司 | 基于人工智能的测试用例生成方法、装置、设备和介质 |
| CN115904984A (zh) * | 2022-11-30 | 2023-04-04 | 北京网太科技发展有限公司 | 一种确定测试用例的系统、方法、电子设备及存储介质 |
-
2023
- 2023-05-19 CN CN202310576183.0A patent/CN119003324A/zh active Pending
-
2024
- 2024-05-18 WO PCT/CN2024/094096 patent/WO2024240100A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110016453A1 (en) * | 2009-07-16 | 2011-01-20 | Accenture Global Services Gmbh | Modularizing and aspectizing graphical user interface directed test scripts |
| CN105224447A (zh) * | 2014-06-11 | 2016-01-06 | 联创汽车电子有限公司 | 发动机控制器软件诊断模块测试方法及测试系统 |
| CN106330601A (zh) * | 2016-08-19 | 2017-01-11 | 北京匡恩网络科技有限责任公司 | 测试用例生成方法及装置 |
| CN114968750A (zh) * | 2021-02-23 | 2022-08-30 | 腾讯科技(深圳)有限公司 | 基于人工智能的测试用例生成方法、装置、设备和介质 |
| CN115904984A (zh) * | 2022-11-30 | 2023-04-04 | 北京网太科技发展有限公司 | 一种确定测试用例的系统、方法、电子设备及存储介质 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120162249A (zh) * | 2025-02-08 | 2025-06-17 | 浙江智臾科技有限公司 | 数据库测试用例生成与优化方法、系统、设备和存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119003324A (zh) | 2024-11-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103984626B (zh) | 一种生成测试用例脚本的方法及装置 | |
| US20250103471A1 (en) | Automation of software test case generation and implementation | |
| EP4575760A1 (en) | Method and apparatus for managing workflow, and device and medium | |
| US20250138993A1 (en) | Debugging a digital assistant | |
| CN119003039A (zh) | 用于信息处理的方法、装置、设备和存储介质 | |
| WO2026001052A1 (zh) | 任务处理方法、装置、设备和计算机可读存储介质 | |
| CN113779117A (zh) | 一种数据监控方法、装置、存储介质和电子设备 | |
| WO2024240100A1 (zh) | 用于测试用例生成的方法、装置、设备和存储介质 | |
| CN119003558B (zh) | 信息处理方法、装置、设备和存储介质 | |
| EP4722893A1 (en) | Method and apparatus for application processing, and device and storage medium | |
| WO2026001042A1 (zh) | 信息处理方法、装置、设备和存储介质 | |
| WO2024240149A1 (zh) | 用于应用处理的方法、装置、设备和存储介质 | |
| WO2025026189A1 (zh) | 用于提示词管理的方法、装置、设备和存储介质 | |
| CN118839768A (zh) | 信息处理方法、装置、设备和存储介质 | |
| US20250310282A1 (en) | Creating a digital assistant | |
| US20250378300A1 (en) | Digital assistant creation | |
| US12242742B1 (en) | Storing data in a digital assistant | |
| CN114860576B (zh) | 一种测试方法、装置、电子设备及存储介质 | |
| CN119088437B (zh) | 应用配置方法、装置、设备和存储介质 | |
| US20260093702A1 (en) | Method for data processing, apparatus, device, storage medium and program product | |
| CN115277611B (zh) | 多通道消息处理方法、装置、计算机设备及存储介质 | |
| US20250307040A1 (en) | Managing data output of a workflow | |
| CN119088435A (zh) | 信息处理方法、装置、设备、存储介质和程序产品 | |
| CN119002747A (zh) | 用于会话交互的方法、装置、设备和存储介质 | |
| CN119088438A (zh) | 信息处理和应用配置方法、装置、设备、存储介质和产品 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24810342 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |