Test case generation method and device, computer equipment, medium and product
By pre-training and fine-tuning the initial model using artificial intelligence technology, a test case generation model is generated, which solves the problem of low efficiency in manually writing test cases and realizes the automated generation of efficient and accurate test cases.
Patent Information
- Application Number
- CN202410584989.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, test cases are usually written manually, which requires high skill levels from the writers, takes a long time to generate, is inefficient, and is prone to errors.
Using artificial intelligence technology, the initial model is pre-trained and fine-tuned using a training sample dataset to generate test cases, thus automatically generating test cases.
It improves the speed and accuracy of test case generation, enhances testing efficiency, and reduces the time and error rate of manual test case writing.
Smart Images

Figure CN120973655A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a test case generation method, a test case generation device, a computer device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] A test case is a set of data consisting of test inputs, execution conditions, and expected results, used to perform tests on a specific requirement or objective. It is a document that embodies the test plan, methods, techniques, and strategies. Test cases are the core of software testing; they describe the operational steps of the test system in documented form to test a specific program path or verify whether a specific requirement is met.
[0003] Currently, test cases are typically written manually and then manually associated with the corresponding test tasks after being transferred to testing. Manually writing test cases requires a high level of individual skill, which can lead to inconsistent test cases and errors. Furthermore, it consumes a significant amount of time, increasing test case generation time and reducing testing efficiency.
[0004] Therefore, how to quickly generate test cases to effectively improve testing efficiency has become an urgent technical problem to be solved. Summary of the Invention
[0005] This application provides test case generation methods, devices, computer equipment, media, and products, which can quickly generate test cases through models to improve testing efficiency.
[0006] One embodiment of this application discloses a test case generation method, the method comprising:
[0007] Obtain the test requirements for the target project, and analyze and process the test requirements to obtain the requirement information of each project module included in the target project;
[0008] Determine the standard test cases corresponding to the requirements information of each project module from the test case library;
[0009] Based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module, the target prompt information corresponding to the requirement information of each project module is determined;
[0010] The test case generation model is invoked to generate test cases for the target prompt information corresponding to the requirement information of each project module, thereby obtaining the target test cases corresponding to the requirement information of each project module. The test case generation model is obtained by pre-training and fine-tuning the initial model using the training sample dataset.
[0011] One embodiment of this application discloses a test case generation apparatus, which includes:
[0012] The acquisition unit is used to acquire the test requirements for the target project, and to analyze and process the test requirements to obtain the requirement information of each project module included in the target project.
[0013] The determination unit is used to identify standard test cases corresponding to the requirement information of each project module from the test case library;
[0014] The determining unit is further configured to determine the target prompt information corresponding to the requirement information of each project module based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module;
[0015] The processing unit is used to call the test case generation model to generate test cases for the target prompt information corresponding to the requirement information of each project module, so as to obtain the target test cases corresponding to the requirement information of each project module. The test case generation model is obtained by pre-training and fine-tuning the initial model using the training sample dataset.
[0016] One aspect of this application discloses a computer device, which includes a processor adapted to implement one or more computer programs; and a computer-readable storage medium storing one or more computer programs, the one or more computer programs being adapted to be loaded by the processor and executed using the test case generation method described above.
[0017] One aspect of this application discloses a computer-readable storage medium storing one or more computer programs, said one or more computer programs being adapted to be loaded by a processor and executed by the above-described test case generation method.
[0018] One embodiment of this application discloses a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the aforementioned test case generation method.
[0019] In this embodiment, test requirements for a target project are obtained and analyzed to obtain requirement information for each module within the target project. Based on these requirements, the test objectives are clarified. Standard test cases corresponding to the requirement information of each module are determined from the test case library; these standard test cases provide a clearer understanding of the test requirements, leading to more accurate target test cases. Based on the test case information and prompt templates of the standard test cases corresponding to the requirement information of each module, target prompt information corresponding to the requirement information of each module is determined; the prompt templates allow for the organization of the test case information of the standard test cases to extract concise prompts. A test case generation model is invoked to generate test cases for the target prompt information corresponding to the requirement information of each module, resulting in target test cases for each module. The test case generation model is obtained by pre-training and fine-tuning an initial model using a training sample dataset. In summary, the test case generation model can automatically generate target test cases corresponding to test requirements, comprehensively recommend test cases, and improve the speed of test case generation, thereby enhancing testing efficiency. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the network architecture of a test case generation system disclosed in an embodiment of this application;
[0022] Figure 2 This is a flowchart illustrating a test case generation method disclosed in an embodiment of this application;
[0023] Figure 3 This is a flowchart illustrating another test case generation method disclosed in an embodiment of this application;
[0024] Figure 4 This is a flowchart illustrating the framework of a test case generation method disclosed in an embodiment of this application.
[0025] Figure 5 This is a schematic diagram of the structure of a test case generation device disclosed in an embodiment of this application;
[0026] Figure 6 This is a schematic diagram of the structure of a computer device disclosed in an embodiment of this application. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] Before describing the embodiments of this application, the test cases will be described first:
[0029] Test cases are a set of data consisting of test inputs, execution conditions, and expected results, used to test a specific requirement or objective. They are documents that embody the test plan, methods, techniques, and strategies. Test cases are the core of software testing; they describe the operational steps of the test system in documented form to test a specific program path or verify whether a specific requirement is met.
[0030] Writing test cases has the following six main functions: (1) It helps to clarify the test ideas and ensure that no functional points that need to be covered are missed; (2) It helps to assess the test workload; (3) It helps to prepare test data in advance; (4) It helps to control the progress of the test work; (5) It helps to conduct regression testing; (6) It helps to organize the test work, improve test efficiency, and reduce test handover costs.
[0031] The main characteristics of test cases are as follows: (1) Validity: Test cases can be used and the test results are consistent when used by different people; (2) Repeatability: Good test cases have reusable functions (regression testing); (3) Organization: Good test cases are categorized and provided to testers for reference and use (functionality, performance, ease of use classification number); (4) Clarity and conciseness: Good test cases are clearly described, each step should have a corresponding function, and they should be highly targeted, without any useless operation steps; (5) Maintainability: Due to the influence of changes in requirements during software development, test cases are often modified, added, or deleted to ensure that they meet the corresponding test requirements.
[0032] Currently, test cases are typically written manually and then manually associated with the corresponding test tasks after being transferred to testing. Manually writing test cases requires a high level of individual skill, which can lead to inconsistent test cases and errors. Furthermore, it consumes a significant amount of time, increasing test case generation time and reducing testing efficiency.
[0033] To quickly obtain test cases, this application provides a test case generation method, which includes: ① Obtaining test requirements for a target project and analyzing and processing the test requirements to obtain the requirement information of each project module included in the target project. Based on the test requirements, the test objectives are clarified. ② Determining standard test cases corresponding to the requirement information of each project module from the test case library; based on standard test cases, the test requirements are clearer, making the obtained target test cases more accurate. ③ Determining target prompt information corresponding to the requirement information of each project module based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module; based on the prompt template, the test case information of the standard test cases can be organized to extract concise prompts. ④ Calling the test case generation model to generate test cases for the target prompt information corresponding to the requirement information of each project module, obtaining the target test cases corresponding to the requirement information of each project module. The test case generation model is obtained by pre-training and fine-tuning an initial model using a training sample dataset. The test case generation model can automatically generate target test cases corresponding to test requirements. Because the test case generation model has been trained, it can completely recommend test cases, which improves the speed of test case generation and thus helps to improve testing efficiency.
[0034] In one possible implementation, the test case generation method provided in this application embodiment can be implemented based on artificial intelligence (AI) technology. Specifically, the test case generation method provided in this application embodiment involves technologies related to large models. For example, the test case generation model is obtained by pre-training an initial model to obtain a pre-trained model, and then fine-tuning the pre-trained model to obtain a test case generation model.
[0035] Pre-trained models, also known as foundational models or large models, refer to deep neural networks (DNNs) with a large number of parameters. These DNNs are trained on massive amounts of unlabeled data, leveraging the function approximation capabilities of large-parameter DNNs to enable Producer-Made Transformers (PTMs) to extract common features from the data. Through fine-tuning, parameter efficient fine-tuning (PEFT), and prompt-tuning techniques, they are suitable for downstream tasks. Therefore, pre-trained models can achieve ideal results in small-shot or zero-shot scenarios. PTMs can be categorized according to the data modality they process, such as language models (ELMO, BERT, GPT), visual models (swin-transformer, ViT, V-MOE), speech models (VALL-E), and multimodal models (ViBERT, CLIP, Flamingo, Gato). Multimodal models refer to models that establish feature representations for two or more data modalities. Pre-trained models are important tools for outputting AI-generated content (AIGC) and can also serve as a general interface connecting multiple specific task models.
[0036] In one possible implementation, the test case generation method provided in this application embodiment can also be implemented based on cloud technology. Specifically, in this application embodiment, it may involve one or more of cloud technologies such as cloud storage, cloud databases, and big data. For example, data required to execute the test case generation method (e.g., standard test cases corresponding to the requirement information of each project module and training sample datasets) can be obtained from a database; or, the data determined by executing the test case generation method (e.g., target prompt information corresponding to the requirement information of each project module and test case generation model) can be stored in a cloud database. The test case library mentioned in this application embodiment can also refer to a cloud database.
[0037] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a collective term for network technology, information technology, integration technology, management platform technology, and application technology applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.
[0038] Please see Figure 1 This is a network architecture diagram of a test case generation system disclosed in an embodiment of this application. The test case generation system may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a server 104, and a database 105. The first terminal device 101 is the device corresponding to the testers, the second terminal device 102 is the device corresponding to the planners, and the third terminal device 103 is the device corresponding to the R&D personnel. To complete the development of the target project, the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 104 need to collaborate. The process is as follows: The planners first plan the target project. The functions of each module included in the target project, as well as the test requirements (i.e., expectations) of each module function, are all defined by the planners. The planners send the target project to the R&D personnel corresponding to the third terminal device 103 through the second terminal device 102, and simultaneously send the target project to the testers corresponding to the first terminal device 101 and the server 104. Researchers use the third terminal device 103 to develop the target project and send the completed target project to the testers corresponding to the first terminal device 101. After receiving the target project sent by the second terminal device 102, the server 104 analyzes the test requirements of the target project, calls the test case generation model to generate target test cases corresponding to the requirement information of each project module, and sends the target test cases to the first terminal device 101. Based on the target test cases, the testers use the first terminal device 101 to test the target project to determine the test results. In addition, the server 104 can also send the target test cases to the database 105, and the database 105 stores the target test cases. It is noted that any pair of devices among the first terminal device 101, second terminal device 102, third terminal device 103, server 104, and database 105 can establish direct communication connections via wired communication or indirect communication connections via wireless communication; this embodiment does not limit this.
[0039] In one embodiment, any of the devices among the first terminal device 101, the second terminal device 102, and the third terminal device 103 includes, but is not limited to, smartphones, tablets, smart wearable devices, smart voice interaction devices, smart home appliances, personal computers, in-vehicle terminals, smart cameras, virtual reality devices (such as AR (Augmented Reality) devices), etc., and this application does not impose any limitations on them. The server 104 or the database 105 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc., and this application embodiment does not limit them in this regard. Optionally, the database 105 can also be deployed within the server 104. Figure 1 This is merely an illustrative representation of the network architecture diagram of the test case generation system, and is not intended to be limiting. For example, Figure 1 Server 104 can be deployed as a node in the blockchain network, or it can be connected to the blockchain network so that server 104 can upload target test cases to the blockchain network for storage to prevent internal data from being tampered with, thereby ensuring data security.
[0040] In this embodiment of the application, in conjunction with the test case generation system, the test case generation method provided in this embodiment of the application can generally include the following steps: Server 104 obtains the test requirements for the target project from the second terminal device 102, and analyzes and processes the test requirements to obtain the requirement information of each project module included in the target project; Server 104 determines the standard test cases corresponding to the requirement information of each project module from the database 105 (i.e., the test case library); Server 104 determines the target prompt information corresponding to the requirement information of each project module based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module; Server 104 calls the test case generation model to perform test case generation processing on the target prompt information corresponding to the requirement information of each project module to obtain the target test cases corresponding to the requirement information of each project module. The test case generation model is obtained by pre-training and fine-tuning the initial model using the training sample dataset.
[0041] Furthermore, after generating the target test cases, server 104 can directly send the target test cases to the first terminal device 101. The testers on the first terminal device 101 can then test each module of the target project after its development is completed, based on the target test cases. Alternatively, after receiving the test instructions, the first terminal device 101 can retrieve the target test cases from database 105 according to the test requirements corresponding to each module of the target project. The testers can then use the first terminal device 101 to test each module of the target project after its development is completed.
[0042] This application describes the entire logic from planning and development to testing of a target project. Most importantly, it explains how to generate corresponding target test cases based on the testing requirements of the target project. This application uses a test case generation model to generate test cases. Compared with manually writing test cases, generating test cases is faster and more comprehensive, which can improve the testing efficiency of testers for the target project.
[0043] It should be noted that the data collection and processing described in this application should be strictly in accordance with the requirements of relevant laws and regulations, obtaining the informed consent or separate consent of the personal information subject, and conducting subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0044] The test case generation method proposed in the embodiments of this application will be described in detail below.
[0045] Please see Figure 2 This is a flowchart illustrating a test case generation method disclosed in an embodiment of this application. This test case generation method can be executed by a computer device, which can be... Figure 1 The test case generation method for server 104 shown can specifically include, but is not limited to, the following steps:
[0046] S201: Obtain the test requirements for the target project, analyze and process the test requirements, and obtain the requirement information of each project module included in the target project.
[0047] In one possible implementation, the test requirements of the target project can be obtained by the server through an interface, or sent to the server by the terminal device through an interface. These test requirements can exist in various formats, including text, document links, and images. The method for determining the requirement information of each module within the target project differs depending on the data format.
[0048] If the test requirements are in text format, the text can be extracted directly to obtain the requirement information of each project module included in the target project.
[0049] If the test requirements are in document link format, a modification prompt for the test requirements is sent to the second terminal device via the interface, and the modification prompt is displayed on the display interface of the second terminal device (the device corresponding to the planner). The modification prompt is used to instruct the planner to adjust the format information of the test requirements to text format. Then the server receives the test requirements in text format, analyzes the test requirements in text format, and obtains the test requirements of each project module.
[0050] If the test requirements are in image format, optical character recognition (OCR) is used to determine the corresponding text information within the image-formatted test requirements. Based on this text information, the requirement information for each project module is determined. Specifically, this can involve text extraction to obtain the requirement information for each project module. Optionally, if the test requirements are in image format, a second modification prompt for the test requirements can be sent to the second terminal device via an interface. This second modification prompt is then displayed on the second terminal device's screen, instructing the planners to adjust the format of the test requirements to text format. The server then receives the text-formatted test requirements, analyzes them, and obtains the test requirements for each project module.
[0051] In some optional embodiments, the test requirements for the target project can also be audio format, video format, etc. For test requirements of target projects in audio or video formats, the server also needs to send a third modification prompt for the test requirements to the second terminal device through an interface, and output the third modification prompt for the test requirements through the display interface of the second terminal device. The third modification prompt is used to instruct the planner to adjust the format information of the test requirements to text format; then the server receives the test requirements in text format, analyzes the test requirements in text format, and obtains the test requirements for the requirement information of each project module.
[0052] The aforementioned target project refers to a unique task with clearly defined objectives, budget, and time constraints. For example, it could be the development of a target product, such as a game application, shopping application, office application, or audio / video application. Each project module refers to the various functional modules included in the target project. For example, for a game application, project modules might include virtual item modules, game character modules, and audio / video modules; for an office application, project modules might include creation, editing, and saving modules. The aforementioned interface refers to the channel for transmitting data, such as an API (Application Programming Interface), which is a convention that provides specific business output capabilities and connects different systems.
[0053] For example, Table 1 is a schematic table of demand information, showing the demand information of the virtual item module in the game application product. The virtual item module specifically refers to game props.
[0054] Table 1
[0055]
[0056] Based on the requirements information for game items shown in Table 1, it is clear what content needs to be tested. Furthermore, the requirements information can specify the test content; for example, if a transformation item is selected, its model, animations, and special effects all need to be tested. Table 1 contains relevant information about the game items, and the content varies for different items. For example, an item name could be a magic wand, a vehicle, etc.
[0057] In this step, identifying the requirements for each project module is crucial for determining the target test cases based on the module. Even within the same project, modules can vary significantly, necessitating different processing for different modules across different projects. While obtaining the requirement information via the interface, it's also essential to acquire the corresponding module information (i.e., the requirement information for each project module) for subsequent processing.
[0058] S202: Determine the standard test cases corresponding to the requirements information of each project module from the test case library.
[0059] In one possible implementation, after determining the requirements for each project module, corresponding standard test cases are determined from the test case library based on these requirements. Each project module's requirements contain module identification information, which is used to determine the corresponding standard test cases from the test case library.
[0060] For example, when the project module is a game item, the standard test cases corresponding to the game item determined from the test case library can be shown in Table 2:
[0061] Table 2
[0062]
[0063]
[0064] As shown in Table 2, a single project module can also include different sub-functional modules. Each sub-functional module's test cases include the test case name, priority (optionally), preconditions, operation steps, and expected results. Based on the standard test cases, the existing test cases for the target project can be clearly identified, and keywords can be extracted from these existing test cases to generate target prompt information. The requirement information refers to the text information submitted by the planners. Table 2 shows that the requirement information is broken down, and standard test cases are determined for each corresponding content. The priority is not explicitly stated in Table 2 because different test requirements have different priorities. As shown in Table 2, the priority of the test case "Purchase" can be set to 1, and the priority of the test case "Equipment Items" can be set to 2. The priorities are related to the test requirements and are set by the planners.
[0065] S203: Based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module, determine the target prompt information corresponding to the requirement information of each project module.
[0066] In one possible implementation, the server can generate the first prompt message corresponding to the requirements information of each project module based on the test case information of the standard test cases corresponding to the requirements information of each project module and the prompt message template. When the number of standard test cases corresponding to the requirements information of a project module is large, a subset of standard test cases can be selected to generate the first prompt message. The prompt message template is continuously improved during the training process, and a relatively standardized prompt message template will be summarized when the test case generation model is finally trained.
[0067] The prompt message template can include requirement information, standard test case information, and output requirement information. The requirement information describes how the requirement information was obtained, what the target project is for, and the specific project module corresponding to the requirement information. The requirement information can be as follows:
[0068] "Imagine you are a highly professional tester, and you need to design a test case based on the following requirements for a shooting mobile game. The requirements can be displayed as follows:"
[0069] [Details of the requirement here refer to obtaining information from the platform interface.]
[0070] The requirements include…
[0071] Standard test case information describes the source of standard test cases and the information they include, such as the test case name, preconditions, steps, and expected results. Standard test case information can be displayed as follows:
[0072] The standard test cases for this requirement are as follows:
[0073] [These test cases are standard test cases imported by the user. They are retrieved from the test case library and then assembled by matching the project modules in the requirement information.]
[0074] Use case name: Equipment and props;
[0075] Prerequisites: The character possesses the item and enters the game;
[0076] Use case steps: Inspect the equipment and props inside the office;
[0077] Expected results: 1. Actions performed normally; 2. Item effects performed normally; 3. Parts equipped on items performed normally.
[0078] The output requirements information is used to review discrepancies between common use cases and requirements, and returns the final revised content. The output requirements information can be displayed as follows:
[0079] "Please review the common use cases to identify any discrepancies with the requirements and return the final revised version. The returned results should meet the following requirements:"
[0080] (1) The returned results should include the use case name, preconditions, operation steps, and expected results. If there are no preconditions, enter "none".
[0081] (2) Checkpoints should be as detailed as possible, taking into account normal scenarios, abnormal scenarios, and the rationality of data.
[0082] (3) In the returned results, the test case name, operation steps, and expected result should be separated by a newline. Add an "end" at the end of each test case.
[0083] Furthermore, the initial prompts corresponding to the requirements information of each project module are simplified to obtain the target prompts for each project module. This simplification process may involve extracting nouns and verbs from the initial prompts, filtering them based on the requirements information, and finally combining them to obtain the target prompts.
[0084] S204: Call the test case generation model to generate test cases for the target prompt information corresponding to the requirement information of each project module, and obtain the target test cases corresponding to the requirement information of each project module. The test case generation model is obtained by pre-training and fine-tuning the initial model using the training sample dataset.
[0085] In one possible implementation, after determining the target prompt information corresponding to the requirement information of each project module, the test case generation model is directly invoked to generate test cases for the target prompt information corresponding to the requirement information of each project module, resulting in at least one test case corresponding to the requirement information of each project module. If at least one test case includes one test case, then at least one test case is determined as the target test case corresponding to the requirement information of that project module. If at least one test case includes at least two test cases, then the test cases in the at least two test cases are concatenated to obtain the target test case corresponding to the requirement information of each project module. During concatenation, the various test cases can be joined together using "\n" (line break). In terms of output format, multiple test cases are output as a single text file, rather than as multiple text files containing multiple test cases.
[0086] The test case generation model is obtained by pre-training and fine-tuning the initial model using the training sample dataset. For details of the pre-training and fine-tuning process, please refer to [link to relevant documentation]. Figure 3 This will not be discussed in detail here.
[0087] In one possible implementation, after determining the target test cases corresponding to the requirement information of each project module, a correspondence can be established between the requirement information of each project module and its corresponding target test cases. This correspondence can be linked by the project module's identifier; that is, the requirement information of each project module includes the project module identifier, and the target test cases corresponding to the requirement information of each project module also include the project module identifier. A correspondence can be established based on the same project module identifier. The target test cases corresponding to the requirement information of each project module and the corresponding correspondence are stored in a test case library. Storing the correspondence in the test case library allows for quick retrieval of the corresponding target test cases when testing is required. Optionally, after determining the target test cases corresponding to the requirement information of each project module, the target test cases can also be stored in a database in the form of a mind map. This database can be part of the test case library or a separate database.
[0088] In another possible implementation, the server responds to a test instruction for a target project module by retrieving the corresponding target test case from the test case library based on the mapping relationship of target project modules. The target project module is any one of the various project modules included in the target project. In actual testing, different testers are responsible for testing different modules for the same project, thus improving testing efficiency through division of labor. Therefore, the server can respond to test instructions for multiple target project modules simultaneously. Each target project module has a corresponding associated object (i.e., a tester) for testing. Based on the associated object of the target project module, the server sends the corresponding target test case to the first terminal device, causing the first terminal device to output the target test case. The target test case is used by the associated object to perform test operations on the target project module.
[0089] Optionally, before sending the target test cases corresponding to the target project module to the first terminal device based on the associated objects of the target project module, the obtained target test cases can be converted into a mind map format, i.e., converted from text format to mind map format, to obtain the target test cases in mind map format corresponding to the target project module. Sending the target test cases in mind map format to the first terminal device allows testers on the first terminal device to clearly see the test logic, improving testing efficiency.
[0090] In the above scenario, the tester submits a test instruction, and the server retrieves the target test cases from the test case library and returns them to the tester. In an alternative implementation, after the server determines the target test cases corresponding to the requirement information of each project module, it can directly send the target test cases to the tester, who is associated with the project module. At the same time, the server stores the target test cases corresponding to the requirement information of each project module in the test case library.
[0091] In this embodiment, the main description is how to generate corresponding target test cases based on the requirement information of each project module included in the target project. The main method is to automatically generate target test cases using a pre-trained test case generation model, which improves the efficiency of test case generation and thus effectively enhances testing efficiency.
[0092] The above embodiments illustrate the prediction process of the test case generation model. The test case generation method of this application will be further described in detail below, in conjunction with the training process of the test case generation model. Please refer to [link to relevant documentation]. Figure 3This is a flowchart illustrating another test case generation method disclosed in an embodiment of this application. The test case generation method includes a training process and a prediction process, wherein the training process further includes a pre-training process and a fine-tuning process. This test case generation method can be executed by a computer device, which can be... Figure 1 The test case generation method for server 104 shown can specifically include, but is not limited to, the following steps:
[0093] S301: Obtain the sample requirement information of each project module in the sample project, and determine the training sample dataset based on the sample requirement information of each project module. The training sample dataset includes the first training sample data and the second training sample data.
[0094] In one possible implementation, the process of determining the first training sample data is as follows: After obtaining the sample requirement information of each project module in the sample project, standard test cases corresponding to the sample requirement information of each project module are determined from the test case library; based on the standard test cases corresponding to the sample requirement information of each project module and the prompt template, second prompt information corresponding to the sample requirement information of each project module is determined, and each second prompt message is used as the first training sample data. Here, one sample requirement information of one project module corresponds to one first training sample data. At the beginning of training, the prompt template information is incomplete and may only include part of the requirement information, standard test case information, and output requirement information. With continuous training, the prompt template can be continuously improved, eventually including all the requirement information, standard test case information, and output requirement information.
[0095] In one possible implementation, the process of determining the second training sample data is as follows: The sample requirement information of each project module in the sample project is analyzed to determine the unique keywords and their descriptive information; these unique keywords and their descriptive information are then used as the second training sample data. For example, in a game application product, the unique keyword could be "skill," and in an audio / video application product, the unique keyword could be "audio / video editing."
[0096] S302: Use the first training sample data to pre-train the initial model to obtain the first output information corresponding to the first training sample data, and adjust the parameters of the initial model according to the first output information and the sample requirement information corresponding to the first training sample data to obtain the pre-trained model.
[0097] In one possible implementation, the pre-training process includes: inputting a large number of first training samples as input information into an initial model to obtain first output information corresponding to each first training sample data; comparing the first output information with the sample requirement information corresponding to the first training sample data; comparing whether the first output information meets the sample requirement information; if it does not meet the requirement information, adjusting the parameters of the initial model; and then using the parameter-tuned model to continue processing the first training samples until the first output information meets the corresponding sample requirement information; and using the model at this point as the pre-trained model.
[0098] The initial model refers to some commonly used neural network models, which typically employ structures such as recurrent neural networks (RNN), long short-term memory networks (LSTM), and gated recurrent units (GRU).
[0099] S303: Fine-tune the pre-trained model using the second training sample data to obtain the test case generation model.
[0100] In practical applications, the pre-trained model can successfully generate target test cases by processing target prompts. However, it cannot generate test cases for some specific keywords. Therefore, to make the generated target test cases more complete and better cover the requirements, it is necessary to fine-tune the pre-trained model. The fine-tuning process includes: inputting a second training sample data as input to the pre-trained model for processing, obtaining a second output information corresponding to the second training sample data. The second output information is the test cases for specific keywords. The fine-tuned model has the ability to generate test cases for specific keywords; therefore, it is actually used as the test case generation model. The fine-tuned pre-trained model can generate more comprehensive test cases.
[0101] It should be noted that during the actual training process, there may be cases where the generated test cases cannot be imported or are formatted incorrectly. Therefore, the generated content is technically identified, and if it cannot be imported, it will be generated again.
[0102] S304: Obtain the test requirements for the target project, analyze and process the test requirements, and obtain the requirement information of each project module included in the target project.
[0103] S305: Determine the standard test cases corresponding to the requirement information of each project module from the test case library; and based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module, determine the target prompt information corresponding to the requirement information of each project module.
[0104] S306: Call the test case generation model to generate test cases for the target prompt information corresponding to the requirement information of each project module, and obtain the target test cases corresponding to the requirement information of each project module.
[0105] The detailed explanation of steps S304-S306 can be found in steps S201-S204, and will not be repeated here. Furthermore, steps S304-S306 can be summarized as follows: Figure 4 The flowchart shown includes: S1: Obtaining the test requirements of the target project; S2: Obtaining the requirement information of each project module based on the test requirements of the target project; S3: Obtaining the standard test cases corresponding to each project module; S4: Obtaining the prompt template; S5: Generating target prompts based on the standard test cases, prompt templates, and requirement information of each project module; S6: Processing the target prompts using the test case generation model to obtain target test cases; S7: Storing the target test cases in the test case library; S8: Associating the target test cases with the test requirements; S9: Downloading the mind map format of the target test cases. Compared to the original manual operation, this overall process can save a significant amount of time.
[0106] For example, in practical applications, generating target test cases based on target prompt information can be done in the following way:
[0107] The input to the test case generation model is a versatile tool.
[0108] The output of the test case generation model is: "Test Case Name: Wan Hua; Precondition: The item exists in the warehouse; Operation Steps: View the item details in the warehouse; Expected Result: There are entries for stamps, ornaments, and dolls\nTest Case Name: Wan Hua; Precondition: The item exists in the warehouse; Operation Steps: Equip ornaments, dolls, and stamps; Expected Result: 1 / 3P hanging point is normal, stamps are displayed normally, and dynamic doll actions are normal."
[0109] As can be seen, the output based on this target prompt information includes two test cases. The two test cases are separated by "\n". In some other instances, a single target prompt information can generate more test cases, such as N, where N is an integer greater than 2. Alternatively, for some special prompts, only one test case may be generated.
[0110] The test case generation method provided in this application can generate corresponding target test cases based on requirement information, saving test case writing time and improving test case quality. Recommended test cases can be automatically uploaded to the platform and associated with corresponding test tasks. After generating test cases, the requirements for transfer to testing can be automatically identified and test tasks can be created and assigned to the corresponding testers. Compared with the original manual operation, the overall testing process saves a lot of time and improves testing efficiency.
[0111] According to one aspect of this application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the test case generation method provided in the various alternative embodiments described above.
[0112] Based on the above method embodiments, this application also provides a schematic diagram of the structure of a test case generation device. See also... Figure 5 This is a schematic diagram of a test case generation device provided in an embodiment of this application. Figure 5 The test case generation device 500 shown can operate the following units:
[0113] The acquisition unit 501 is used to acquire the test requirements for the target project, and analyze and process the test requirements to obtain the requirement information of each project module included in the target project.
[0114] The determining unit 502 is used to determine the standard test cases corresponding to the requirement information of each project module from the test case library; and to determine the target prompt information corresponding to the requirement information of each project module based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module.
[0115] The processing unit 503 is used to call the test case generation model to generate test cases for the target prompt information corresponding to the requirement information of each project module, so as to obtain the target test cases corresponding to the requirement information of each project module. The test case generation model is obtained by pre-training and fine-tuning the initial model using the training sample dataset.
[0116] In one possible implementation, when determining the target prompt information corresponding to the requirement information of each project module based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module, the determining unit 502 specifically performs the following steps:
[0117] Based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module, the first prompt information corresponding to the requirement information of each project module is generated;
[0118] The first prompt information corresponding to the requirement information of each project module is simplified to obtain the target prompt information corresponding to the requirement information of each project module.
[0119] In one possible implementation, when the processing unit 503 calls the test case generation model to generate test cases for the target prompt information corresponding to the requirement information of each project module, and obtains the target test cases corresponding to the requirement information of each project module, it specifically performs the following steps:
[0120] The test case generation model is invoked to process the target prompt information to generate test cases, thereby obtaining at least one test case corresponding to the requirement information of each project module.
[0121] If the at least one test case includes a test case, then the at least one test case is determined as the target test case corresponding to the requirement information of each project module;
[0122] If the at least one test case includes at least two test cases, then the test cases in the at least two test cases are concatenated to obtain the target test cases corresponding to the requirement information of each project module.
[0123] In one possible implementation, the processing unit 503 is further configured to perform the following steps:
[0124] Establish a correspondence between the requirement information of each project module and the target test cases corresponding to the requirement information of each project module;
[0125] The target test cases corresponding to the requirements information of each project module and the corresponding relationships are stored in the test case library.
[0126] In one possible implementation, the processing unit 503 is further configured to perform the following steps:
[0127] In response to a test instruction for a target project module, a target test case corresponding to the target project module is retrieved from the test case library according to the correspondence of the target project modules; the target project module is any one of the various project modules included in the target project;
[0128] The target test case corresponding to the target project module is sent to the first terminal device according to the associated object of the target project module, so that the first terminal device outputs the target test case corresponding to the target project module. The target test case corresponding to the target project module is used by the associated object to perform test operations on the target project module.
[0129] In one possible implementation, when processing unit 503 sends the target test case corresponding to the target project module to the first terminal device based on the associated object of the target project module, it specifically performs the following steps:
[0130] The target test cases corresponding to the target project module are converted into a mind map format to obtain the target test cases corresponding to the target project module.
[0131] Based on the associated objects of the target project module, target test cases in mind map format corresponding to the target project module are sent to the first terminal device.
[0132] In one possible implementation, when the processing unit 503 analyzes the test requirements and obtains the requirement information for each project module, it specifically performs the following steps:
[0133] Obtain the format information of the test requirements;
[0134] If the test requirement is in document link format, a modification prompt for the test requirement is output through the second terminal device. The modification prompt is used to indicate that the format information of the test requirement should be adjusted to text format. The test requirement in text format is analyzed to obtain the requirement information of each project module.
[0135] If the test requirement is in image format, then optical recognition is used to determine the corresponding text information in the test requirement of the image format, and the requirement information of each project module is determined based on the text information.
[0136] In one possible implementation, the acquisition unit 501 is further configured to acquire sample requirement information of each project module in the sample project, and determine a training sample dataset based on the sample requirement information of each project module. The training sample dataset includes first training sample data and second training sample data; the sample requirement information of one project module corresponds to one first training sample data.
[0137] Processing unit 503 is also configured to perform the following steps:
[0138] The initial model is pre-trained using the first training sample data to obtain the first output information corresponding to the first training sample data. The parameters of the initial model are then adjusted according to the first output information and the sample requirement information corresponding to the first training sample data to obtain the pre-trained model.
[0139] The pre-trained model is fine-tuned using the second training sample data to obtain the test case generation model.
[0140] In one possible implementation, when determining the training sample dataset based on the sample requirement information of each project module, the determining unit 502 specifically performs the following steps:
[0141] Determine the standard test cases corresponding to the sample requirement information of each project module from the test case library;
[0142] Based on the standard test cases and prompt templates corresponding to the sample requirement information of each project module, the second prompt information corresponding to the sample requirement information of each project module is determined, and each second prompt information is used as the first training sample data.
[0143] The sample requirement information of each project module in the sample project is analyzed to determine the unique keywords in the sample project and the descriptive information of the unique keywords.
[0144] The unique keywords and their descriptive information are used as the second training sample data.
[0145] It is understood that the functions of each functional unit of the test case generation device provided in the embodiments of this application can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can be referred to the relevant descriptions in the above method embodiments, which will not be repeated here.
[0146] In feasible embodiments, the test case generation device provided in this application can be implemented in software. The test case generation device can be stored in a memory and can be software in the form of programs and plug-ins. It includes a series of units, including an acquisition unit, a determination unit, and a processing unit. The acquisition unit, determination unit, and processing unit are used to implement the test case generation method provided in this application.
[0147] In other feasible embodiments, the test case generation device provided in this application embodiment can also be implemented in a combination of hardware and software. As an example, the test case generation device provided in this application embodiment can be a processor in the form of a hardware decoding processor, which is programmed to implement the test case generation method provided in this application embodiment. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0148] In this embodiment, combining an acquisition unit, a determination unit, and a processing unit, the method includes: an acquisition unit acquiring test requirements for a target project and analyzing and processing the test requirements to obtain requirement information for each project module included in the target project; a determination unit determining standard test cases corresponding to the requirement information of each project module from a test case library; based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module, determining the target prompt information corresponding to the requirement information of each project module; and a processing unit calling a test case generation model to generate test cases for the target prompt information corresponding to the requirement information of each project module, obtaining the target test cases corresponding to the requirement information of each project module. The test case generation model is obtained by pre-training and fine-tuning an initial model using a training sample dataset. The test case generation model can automatically generate target test cases corresponding to test requirements, can comprehensively recommend test cases, improve the speed of test case generation, and thus help improve testing efficiency.
[0149] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device described in this embodiment includes a processor 601, a communication interface 602, and a memory 603. The processor 601, communication interface 602, and memory 603 can be connected via a bus or other means; this embodiment uses a bus connection as an example. The computer device can be... Figure 1 Server 104 is shown.
[0150] The processor 601 (or CPU, Central Processing Unit) is the computing and control core of the computer device. It can parse various instructions and process various data within the computer device. For example, the CPU can parse power-on / off commands sent by the user and control the computer device to perform power-on / off operations; it can also transmit various interactive data between internal structures of the computer device. The communication interface 602 may optionally include standard wired interfaces or wireless interfaces (such as Wi-Fi, mobile communication interfaces, etc.), and is controlled by the processor 601 for sending and receiving data. The memory 603 is the storage device in the computer device, used to store programs and data. It is understood that the memory 603 here can include the computer device's built-in memory, or it can include extended memory supported by the computer device. The memory 603 provides storage space for the computer device's operating system, which may include, but is not limited to, Android, iOS, Windows Phone, etc., and this application does not limit this.
[0151] In this embodiment of the application, the processor 601 performs the following operations by running the executable program code in the memory 603:
[0152] Obtain the test requirements for the target project, and analyze and process the test requirements to obtain the requirement information of each project module included in the target project;
[0153] Determine the standard test cases corresponding to the requirements information of each project module from the test case library;
[0154] Based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module, the target prompt information corresponding to the requirement information of each project module is determined;
[0155] The test case generation model is invoked to generate test cases for the target prompt information corresponding to the requirement information of each project module, thereby obtaining the target test cases corresponding to the requirement information of each project module. The test case generation model is obtained by pre-training and fine-tuning the initial model using the training sample dataset.
[0156] In one possible implementation, when the processor 601 determines the target prompt information corresponding to the requirement information of each project module based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module by running the executable program code in the memory 603, it specifically performs the following steps:
[0157] Based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module, the first prompt information corresponding to the requirement information of each project module is generated;
[0158] The first prompt information corresponding to the requirement information of each project module is simplified to obtain the target prompt information corresponding to the requirement information of each project module.
[0159] In one possible implementation, when the processor 601 calls the test case generation model through the executable program code in the runtime memory 603 to generate test cases for the target prompt information corresponding to the requirement information of each project module, and obtains the target test cases corresponding to the requirement information of each project module, it specifically performs the following steps:
[0160] The test case generation model is invoked to process the target prompt information to generate test cases, thereby obtaining at least one test case corresponding to the requirement information of each project module.
[0161] If the at least one test case includes a test case, then the at least one test case is determined as the target test case corresponding to the requirement information of each project module;
[0162] If the at least one test case includes at least two test cases, then the test cases in the at least two test cases are concatenated to obtain the target test cases corresponding to the requirement information of each project module.
[0163] In one possible implementation, the processor 601, by running executable program code in memory 603, also performs the following steps:
[0164] Establish a correspondence between the requirement information of each project module and the target test cases corresponding to the requirement information of each project module;
[0165] The target test cases corresponding to the requirements information of each project module and the corresponding relationships are stored in the test case library.
[0166] In one possible implementation, the processor 601, by running executable program code in memory 603, also performs the following steps:
[0167] In response to a test instruction for a target project module, a target test case corresponding to the target project module is retrieved from the test case library according to the correspondence of the target project modules; the target project module is any one of the various project modules included in the target project;
[0168] The target test case corresponding to the target project module is sent to the first terminal device according to the associated object of the target project module, so that the first terminal device outputs the target test case corresponding to the target project module. The target test case corresponding to the target project module is used by the associated object to perform test operations on the target project module.
[0169] In one possible implementation, when the processor 601 sends the target test case corresponding to the target project module to the first terminal device by running the executable program code in the memory 603 according to the associated object of the target project module, it specifically performs the following steps:
[0170] The target test cases corresponding to the target project module are converted into a mind map format to obtain the target test cases corresponding to the target project module.
[0171] Based on the associated objects of the target project module, target test cases in mind map format corresponding to the target project module are sent to the first terminal device.
[0172] In one possible implementation, when processor 601 analyzes the test requirements by running executable program code in memory 603 and obtains the requirement information for each project module, it specifically performs the following steps:
[0173] Obtain the format information of the test requirements;
[0174] If the test requirement is in document link format, a modification prompt for the test requirement is output through the second terminal device. The modification prompt is used to indicate that the format information of the test requirement should be adjusted to text format. The test requirement in text format is analyzed to obtain the requirement information of each project module.
[0175] If the test requirement is in image format, then optical recognition is used to determine the corresponding text information in the test requirement of the image format, and the requirement information of each project module is determined based on the text information.
[0176] In one possible implementation, the processor 601, by running executable program code in memory 603, also performs the following steps:
[0177] Obtain the sample requirement information of each project module in the sample project, and determine the training sample dataset based on the sample requirement information of each project module. The training sample dataset includes first training sample data and second training sample data; the sample requirement information of one project module corresponds to one first training sample data.
[0178] The initial model is pre-trained using the first training sample data to obtain the first output information corresponding to the first training sample data. The parameters of the initial model are then adjusted according to the first output information and the sample requirement information corresponding to the first training sample data to obtain the pre-trained model.
[0179] The pre-trained model is fine-tuned using the second training sample data to obtain the test case generation model.
[0180] In one possible implementation, when processor 601 determines the training sample dataset based on the sample requirement information of each project module by running executable program code in memory 603, it specifically performs the following steps:
[0181] Determine the standard test cases corresponding to the sample requirement information of each project module from the test case library;
[0182] Based on the standard test cases and prompt templates corresponding to the sample requirement information of each project module, the second prompt information corresponding to the sample requirement information of each project module is determined, and each second prompt information is used as the first training sample data.
[0183] The sample requirement information of each project module in the sample project is analyzed to determine the unique keywords in the sample project and the descriptive information of the unique keywords.
[0184] The unique keywords and their descriptive information are used as the second training sample data.
[0185] According to one aspect of this application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the test case generation method provided in the various alternative embodiments described above.
[0186] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0187] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, and the division of modules described above is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0188] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0189] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A test case generation method, characterized in that, The method includes: Obtain the test requirements for the target project, and analyze and process the test requirements to obtain the requirement information of each project module included in the target project; Determine the standard test cases corresponding to the requirements information of each project module from the test case library; Based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module, the target prompt information corresponding to the requirement information of each project module is determined; The test case generation model is invoked to generate test cases for the target prompt information corresponding to the requirement information of each project module, thereby obtaining the target test cases corresponding to the requirement information of each project module. The test case generation model is obtained by pre-training and fine-tuning the initial model using the training sample dataset.
2. The method according to claim 1, characterized in that, The method of determining the target prompt information corresponding to the requirement information of each project module based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module includes: Based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module, the first prompt information corresponding to the requirement information of each project module is generated; The first prompt information corresponding to the requirement information of each project module is simplified to obtain the target prompt information corresponding to the requirement information of each project module.
3. The method according to claim 1 or 2, characterized in that, The test case generation model is invoked to process test cases for the target prompt information corresponding to the requirement information of each project module, thereby obtaining target test cases corresponding to the requirement information of each project module, including: The test case generation model is invoked to process the target prompt information to generate test cases, thereby obtaining at least one test case corresponding to the requirement information of each project module. If the at least one test case includes a test case, then the at least one test case is determined as the target test case corresponding to the requirement information of each project module; If the at least one test case includes at least two test cases, then the test cases in the at least two test cases are concatenated to obtain the target test cases corresponding to the requirement information of each project module.
4. The method according to claim 1 or 2, characterized in that, The method further includes: Establish a correspondence between the requirement information of each project module and the target test cases corresponding to the requirement information of each project module; The target test cases corresponding to the requirements information of each project module and the corresponding relationships are stored in the test case library.
5. The method according to claim 4, characterized in that, The method further includes: In response to a test instruction for a target project module, a target test case corresponding to the target project module is retrieved from the test case library according to the correspondence of the target project modules; the target project module is any one of the various project modules included in the target project; The target test case corresponding to the target project module is sent to the first terminal device according to the associated object of the target project module, so that the first terminal device outputs the target test case corresponding to the target project module. The target test case corresponding to the target project module is used by the associated object to perform test operations on the target project module.
6. The method according to claim 5, characterized in that, Sending the target test cases corresponding to the target project module to the first terminal device based on the associated object of the target project module includes: The target test cases corresponding to the target project module are converted into a mind map format to obtain the target test cases corresponding to the target project module. Based on the associated objects of the target project module, target test cases in mind map format corresponding to the target project module are sent to the first terminal device.
7. The method according to claim 1 or 2, characterized in that, The analysis of the test requirements yields the requirement information for each project module, including: Obtain the format information of the test requirements; If the test requirement is in document link format, a modification prompt for the test requirement is output through the second terminal device. The modification prompt is used to indicate that the format information of the test requirement should be adjusted to text format. The test requirement in text format is analyzed to obtain the requirement information of each project module. If the test requirement is in image format, then optical recognition is used to determine the corresponding text information in the test requirement of the image format, and the requirement information of each project module is determined based on the text information.
8. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain the sample requirement information of each project module in the sample project, and determine the training sample dataset based on the sample requirement information of each project module. The training sample dataset includes first training sample data and second training sample data; the sample requirement information of one project module corresponds to one first training sample data. The initial model is pre-trained using the first training sample data to obtain the first output information corresponding to the first training sample data. The parameters of the initial model are then adjusted according to the first output information and the sample requirement information corresponding to the first training sample data to obtain the pre-trained model. The pre-trained model is fine-tuned using the second training sample data to obtain the test case generation model.
9. The method according to claim 8, characterized in that, The step of determining the training sample dataset based on the sample requirement information of each project module includes: Determine the standard test cases corresponding to the sample requirement information of each project module from the test case library; Based on the standard test cases and prompt templates corresponding to the sample requirement information of each project module, the second prompt information corresponding to the sample requirement information of each project module is determined, and each second prompt information is used as the first training sample data. The sample requirement information of each project module in the sample project is analyzed to determine the unique keywords in the sample project and the descriptive information of the unique keywords. The unique keywords and their descriptive information are used as the second training sample data.
10. A test case generation device, characterized in that, The device includes: The acquisition unit is used to acquire the test requirements for the target project, and to analyze and process the test requirements to obtain the requirement information of each project module included in the target project. The determination unit is used to identify standard test cases corresponding to the requirement information of each project module from the test case library; The determining unit is further configured to determine the target prompt information corresponding to the requirement information of each project module based on the test case information and prompt template of the standard test cases corresponding to the requirement information of each project module; The processing unit is used to call the test case generation model to generate test cases for the target prompt information corresponding to the requirement information of each project module, so as to obtain the target test cases corresponding to the requirement information of each project module. The test case generation model is obtained by pre-training and fine-tuning the initial model using the training sample dataset.
11. A computer device, characterized in that, The computer device includes: A processor, suitable for implementing one or more computer programs; and, A computer-readable storage medium storing one or more computer programs adapted to be loaded by the processor and executed by the test case generation method as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more computer programs, which are adapted to be loaded by a processor and executed by the test case generation method as described in any one of claims 1-9.
13. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium, a processor of a computer device reading the computer program from the computer-readable storage medium, and the processor executing the computer program, causing the computer device to perform the test case generation method as described in any one of claims 1-9.