Test case generation method, device and equipment, and storage medium
Patent Information
- Application Number
- CN202610943130.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-09-25
AI Technical Summary
[0003]相关技术中,由测试人员来编写测试用例,在测试工作流程中,测试用例编写占据测试人员20%-30%的工作量,存在编写测试用例效率低下
[0010]本申请的有益效果是:本申请实施例提供的一种测试用例生成方法,包括:采用识图智能体,对需求信息中的图像内容块进行识别处理,得到图像解析文本;采用注意力机制智能体,根据需求信息和图像解析文本进行解析处理,得到测试方案,其中,测试方案中包括多个功能场景;从知识库中检索各功能场景的相关知识词条;采用用例生成智能体,根据图像解析文本、需求信息、测试方案和各功能场景的相关知识词条,依次生成多个功能场景中各功能场景对应的测试用例。采用识图智能体,能够自动准确解析需求信息中的图像信息,而且,联合采用注意力机制智能体和用例生成智能体这多个智能体协同生成各功能场景的测试用例,减少了主观因素的影响,显著提升了测试用例的生成效率和质量;在生成测试用例时,还基于知识库中的相关知识词条来进行查漏补缺,进一步提升了生成的测试用例的质量。
Smart Images

Figure CN122817074A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a test case generation method, apparatus, device, and storage medium. Background Technology
[0002] In the software development lifecycle, software testing is a crucial step in ensuring product quality, functional correctness, and system stability. Test cases, as the core of software testing, are specifically complete descriptive documents describing a particular data set, execution conditions, operational steps, and expected results.
[0003] In related technologies, test cases are written by testers. In the testing workflow, test case writing accounts for 20%-30% of the testers' workload, resulting in low efficiency. Furthermore, the quality of manually written test cases is affected by various subjective and objective factors, leading to uncontrollable quality issues in the delivered test cases.
[0004] In other words, the relevant technologies suffer from inefficient test case writing and unreliable test case quality. Summary of the Invention
[0005] The purpose of this application is to provide a test case generation method, apparatus, device, and storage medium to address the shortcomings of the prior art and solve the aforementioned technical problems in the related art.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, embodiments of this application provide a test case generation method, including: An image recognition intelligent agent is used to identify and process image content blocks in the requirement information to obtain image parsing text; An attention-based intelligent agent parses and processes the required information and the image parsing text to obtain a test plan, which includes multiple functional scenarios. Retrieve relevant knowledge entries for each of the described functional scenarios from the knowledge base; A test case generation agent is used to sequentially generate test cases corresponding to each of the multiple functional scenarios based on the image parsing text, the requirement information, the test plan, and the relevant knowledge terms of each functional scenario.
[0007] Secondly, embodiments of this application also provide a test case generation apparatus, comprising: The recognition and processing module is used to identify and process image content blocks in the requirement information using an image recognition intelligent agent to obtain image parsing text; The parsing and processing module is used to employ an attention mechanism agent to parse and process the required information and the image parsing text to obtain a test plan, wherein the test plan includes multiple functional scenarios; The retrieval module is used to retrieve relevant knowledge entries for each of the aforementioned functional scenarios from the knowledge base; The generation module is used to generate intelligent agents using test cases, and to sequentially generate test cases corresponding to each of the multiple functional scenarios based on the image parsing text, the requirement information, the test plan, and the relevant knowledge entries of each of the functional scenarios.
[0008] Thirdly, embodiments of this application also provide a test case generation device, including: a memory and a processor, wherein the memory stores a computer program executable by the processor, and the processor executes the computer program to implement a test case generation method as described in any of the first aspects above.
[0009] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when read and executed, implements a test case generation method as described in any of the first aspects above.
[0010] The beneficial effects of this application are as follows: The test case generation method provided in this application includes: employing an image recognition agent to identify and process image content blocks in requirement information to obtain image parsing text; employing an attention mechanism agent to parse and process the requirement information and image parsing text to obtain a test plan, wherein the test plan includes multiple functional scenarios; retrieving relevant knowledge entries for each functional scenario from a knowledge base; and employing a test case generation agent to sequentially generate test cases corresponding to each functional scenario in multiple functional scenarios based on the image parsing text, requirement information, test plan, and relevant knowledge entries for each functional scenario. Employing an image recognition agent can automatically and accurately parse image information in requirement information. Moreover, the combined use of multiple agents, including an attention mechanism agent and a test case generation agent, to collaboratively generate test cases for each functional scenario reduces the influence of subjective factors and significantly improves the efficiency and quality of test case generation. Furthermore, during test case generation, gaps are filled based on relevant knowledge entries in the knowledge base, further improving the quality of the generated test cases. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 1 ; Figure 2 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 2 ; Figure 3 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 3 ; Figure 4 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 4 ; Figure 5 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 5 ; Figure 6 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 6 ; Figure 7 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 7 ; Figure 8 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 8 ; Figure 9 This is a schematic diagram of the structure of a test case generation device provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a test case generation device provided in an embodiment of this application. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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 some embodiments of this application, but not all embodiments.
[0014] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0015] In the description of this application, it should be noted that if the terms "upper", "lower", etc. appear to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship that the product of this application is usually placed in, it is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0016] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0017] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.
[0018] The following is an explanation of the terms used in the embodiments of this application.
[0019] AI, short for Artificial Intelligence, is an important component of the discipline of intelligence. It attempts to understand the nature of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. Artificial intelligence is a very broad science, including robotics, speech recognition, image recognition, natural language processing, expert systems, machine learning, computer vision, and more.
[0020] LLM, short for large language model, is a type of language model composed of artificial neural networks with many parameters (typically billions or more weights), trained on large amounts of unlabeled text using self-supervised or semi-supervised learning. Large language models can handle a variety of natural language tasks, such as text classification, question answering, and dialogue.
[0021] An agent, or intelligent agent, is a proxy capable of perceiving its environment and taking actions to achieve specific goals. It can be software, hardware, or a system, possessing autonomy, adaptability, and interactivity. An intelligent agent perceives changes in the environment (such as data input), makes judgments and decisions based on its learned knowledge and algorithms, and then executes actions to influence the environment or achieve predetermined goals.
[0022] OCR, short for Optical Character Recognition, refers to the process of processing and recognizing images or videos containing text content, and extracting the text and layout information contained therein.
[0023] This application provides a test case generation method, which is applied to a test case generation device. The test case generation device can be a terminal device or a server. The terminal device can be any of the following: computer device, laptop computer, tablet computer, or smartphone.
[0024] With the continuous advancement of artificial intelligence (AI) technology, large language models (LLMs) have rapidly emerged. These models possess hundreds of billions or even trillions of parameters and can be trained on massive datasets to deeply understand the structure and meaning of language. These models have demonstrated unprecedented capabilities and potential in multiple fields such as text generation, question-answering systems, language translation, and information retrieval. The multiple agents involved in the embodiments of this application can be agents based on large language models, and these agents collaborate to generate test cases. The following explains a test case generation method provided in the embodiments of this application.
[0025] Figure 1 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 1 ;like Figure 1 As shown, the method may include: S101. Using an image recognition intelligent agent, the image content blocks in the requirement information are identified and processed to obtain image parsing text.
[0026] The input format for requirement information can be text, images, file uploads, etc., and users do not need to preprocess the input information. In practical applications, requirement information can include: requirement documents, interaction drafts, design drafts, front-end and back-end technical solutions, test plans, etc.
[0027] In some implementations, demand information is acquired, and in response to a generation operation based on the demand information input, processes S101 to S104 are executed. Multiple content blocks within the demand information are identified, and an image recognition agent is used to identify and process the image content blocks in the demand information to obtain image parsing text.
[0028] It should be noted that an image content block refers to a content block of type image among multiple content blocks.
[0029] S102. An intelligent agent using an attention mechanism parses and processes the requirement information and image parsing text to obtain a test plan.
[0030] The test plan includes multiple functional scenarios. The test plan may also include: background information on requirements and key test points.
[0031] In some implementations, the requirement information and image parsing text are fused to generate fused information. An attention-based intelligent agent is then used to perform in-depth analysis of the fused information to obtain a structured test plan.
[0032] S103. Retrieve relevant knowledge entries for each functional scenario from the knowledge base.
[0033] In some implementations, based on the name and key information of the functional scenario, a semantic vector-based matching method is used to retrieve relevant knowledge entries of the functional scenario from the knowledge base.
[0034] This process involves pre-converting all terms in the knowledge base into semantic vectors using a text embedding model and establishing a vector index. During retrieval, the name and key information of the functional scenario are converted into a semantic vector for that scenario. In the knowledge base, vector similarity calculations are used to retrieve the multiple knowledge terms most relevant to the semantic vector of the functional scenario.
[0035] In addition, relevant knowledge terms can be sorted according to their relevance to functional scenarios. The sorted relevant knowledge terms can be used as supplementary contextual information in the following S104 process.
[0036] S104. Use a test case generation agent to generate test cases for each functional scenario in multiple functional scenarios in sequence, based on image parsing text, requirement information, test plan and relevant knowledge entries for each functional scenario.
[0037] Among them, the relevant knowledge entries for each functional scenario can improve the understanding of historical experience, known risk points and test focus points in each functional scenario, and fill in the gaps in the test case generation process.
[0038] In some implementations, a test case generation agent is used to initiate multiple rounds of test case generation operations based on image parsing text, requirement information, test plans, and relevant knowledge entries for each functional scenario. Each round generates corresponding test cases for only a single functional scenario.
[0039] In the embodiments of this application, the use case generation agent can be any one of the following: a general use case generation agent, a precise use case generation agent, a regression use case generation agent, or an abnormal scenario use case generation agent. These agents are essentially based on the same model, but differ in the prompt words they use.
[0040] In summary, the test case generation method provided in this application includes: employing an image recognition agent to identify and process image content blocks in the requirement information to obtain image parsing text; employing an attention mechanism agent to parse and process the requirement information and image parsing text to obtain a test plan, wherein the test plan includes multiple functional scenarios; retrieving relevant knowledge entries for each functional scenario from a knowledge base; and employing a test case generation agent to sequentially generate test cases corresponding to each functional scenario in the multiple functional scenarios based on the image parsing text, requirement information, test plan, and relevant knowledge entries for each functional scenario. The image recognition agent can automatically and accurately parse image information in the requirement information. Furthermore, the collaborative generation of test cases for each functional scenario by multiple agents, including the attention mechanism agent and the test case generation agent, reduces the influence of subjective factors and significantly improves the efficiency and quality of test case generation. During test case generation, gaps are also filled based on relevant knowledge entries in the knowledge base, further improving the quality of the generated test cases.
[0041] Optionally, Figure 2 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 2 ;like Figure 2 As shown, the process in S101 above, which uses an image recognition agent to identify and process image content blocks in the demand information to obtain image parsing text, may include: S201. Convert the demand information into an ordered sequence of content blocks.
[0042] Since the sources and formats of demand information vary, it is necessary to parse demand information from multiple sources into an ordered sequence of content blocks, which is structured data.
[0043] In some implementations, the type of each input information in the requirement information is identified. If the input information is plain text, the text content is directly extracted. If the input information is a file type (such as docx, pdf, etc.), a document parsing engine is used to extract the internal structural information of the document, including heading levels, paragraph text, embedded tables, and embedded images, while preserving the original order of appearance of each content element in the document. If the input information is a document link type, the corresponding document interface is called to obtain the document content, and then the specific content is directly extracted.
[0044] It should be noted that each content block in the content block sequence contains the following fields: content block type (text or image), content body (text string or image binary data), source location index (records the order in which the content block appears in the original document), and paragraph title (records the parent title to which the content block belongs).
[0045] In this embodiment of the application, the demand information is converted into an ordered sequence of content blocks, enabling the image recognition agent and the attention mechanism agent to accurately locate the contextual relationship between each content block.
[0046] S202. Determine the image content blocks from the content block sequence.
[0047] In some implementations, multiple content blocks in the content block sequence are traversed to determine the content block whose content block type is an image, i.e., the image content block. The image in the image content block is then uploaded, and its unique access address is obtained for subsequent retrieval.
[0048] In practical applications, requirement information often includes image information such as interface prototype diagrams, flowcharts, and screenshots of data tables. In other words, the image content blocks in the content block sequence contain this image information, which contains key details not directly reflected in the text description. In this embodiment, identifying this image information facilitates the accurate generation of test cases.
[0049] S203. An image recognition agent is used to perform recognition processing based on image content blocks and content block sequences to obtain image parsing text.
[0050] The content block sequence is used to represent the contextual text of the image within the image content block.
[0051] In some implementations, an image recognition agent is employed to classify images within an image content block based on the image content block and its sequence, determining the image type. For example, the image type could be a screenshot, flowchart, data table, architecture diagram, or other types. Based on the image type, a corresponding parsing strategy is determined, and this strategy is used to process the images within the image content block, yielding parsed image text.
[0052] It should be noted that different types of images require different parsing strategies. For example, screenshots focus on extracting page elements and interaction relationships, flowcharts focus on extracting node paths and conditional branches, and data tables focus on extracting row and column structures and data constraints.
[0053] Optionally, Figure 3 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 3 ;like Figure 3 As shown, the process of using an image recognition agent in S203 above to obtain image parsing text by recognizing and processing image content blocks and their sequences can include: S301. Extract text from the image content block to obtain the text content in the image content block and the position information of the text in the image content block.
[0054] In some implementations, an OCR tool is invoked to perform high-precision text extraction on the image content block, obtaining all the text content contained in the image, as well as the positional relationship and hierarchical structure of the text in the image.
[0055] S302. An image recognition agent is used to perform recognition processing based on image content blocks and content block sequences to obtain semantic information of image content blocks.
[0056] The content block sequence is used to represent the contextual text of the image content block.
[0057] In some implementations, an image recognition agent is used to perform deep semantic understanding of the images in the image content blocks based on the contextual text represented by the content block sequence, thereby obtaining the semantic information of the image content blocks.
[0058] For example, if the image is a screenshot, the semantic information can include: the interaction logic between the elements in the screenshot. If the image is a flowchart, the semantic information can include: the execution order and branch conditions of each node in the flowchart. If the image is a table, the semantic information can include: the business meaning and constraint relationships of each field in the table, etc.
[0059] S303. Determine the image parsing text based on the text content in the image content block, the position information of the text in the image content block, and the semantic information of the image content block.
[0060] Specifically, the text content in the image content block, the positional information of the text in the image content block, and the semantic information of the image content block are merged to determine the image parsing text.
[0061] In the embodiments of this application, the text content in the image content block and the position information of the text in the image content block can represent the precise text details in the image, and the semantic information of the image content block can represent the understanding of the overall semantics of the image. The two complement each other, so that the final image parsing text is more accurate.
[0062] Optionally, Figure 4 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 4 ;like Figure 4As shown, the process in S102 above, which employs an attention-based agent to parse and process demand information and image-to-text parsing to obtain a test plan, may include: S401. Replace the image content blocks in the content block sequence with image parsing text to generate an image enhancement sequence.
[0063] It should be noted that by using image parsing to replace the target content blocks in the content block sequence, all image content blocks in the sequence are replaced with text content blocks containing precise textual information and semantic descriptions, generating an image enhancement sequence. In this image enhancement sequence, all content blocks are text content blocks.
[0064] Among them, the image enhancement sequence preserves the complete information structure and content order of the original document in the requirement information, while representing the information implied in the image using text.
[0065] S402. An attention-based intelligent agent analyzes and processes the image enhancement sequence to obtain a test scheme.
[0066] Among them, the image enhancement sequence is a fusion of image parsing text and content block sequences.
[0067] In some implementations, an attention-based intelligent agent is used to perform deep analysis of the image enhancement sequence to obtain a test plan. This test plan includes: the background requirements, multiple functional scenarios, and key test points.
[0068] Optionally, Figure 5 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 5 ;like Figure 5 As shown, the process of parsing the image enhancement sequence to obtain the test scheme in S402 above may include: S501. Based on the image enhancement sequence, generate the requirement background, multiple functional scenarios, and test point information corresponding to each functional scenario.
[0069] Among them, test point information can also be called change points, which are some functions that have been modified.
[0070] In this embodiment of the application, the requirement background in the test plan specifically refers to an overview of the requirement background, such as business objectives and involved user roles. The test plan includes multiple core functional scenarios, which can be presented in list form, mainly including the main process and the functional scenarios corresponding to each sub-process. The test point information in the test plan can include test points that distinguish between newly added functions, modified functions, and decommissioned functions.
[0071] In addition, the test plan may also include: strong constraints and high-risk point identification. For example, strong constraints include permission requirements, temporal dependencies, and state preconditions; high-risk point identification includes: fund operations, idempotency requirements, concurrent access, and abnormal branches.
[0072] S502 employs an attention-based intelligent agent to assign priority labels to information from each functional scenario and each test point.
[0073] Each functional scenario has corresponding test point information. The same priority label is assigned to the same functional scenario and the test point information corresponding to that functional scenario. Of course, priority labels can also be assigned separately to the test point information corresponding to the same functional scenario. This application embodiment does not impose specific restrictions on this.
[0074] For example, the priority labels corresponding to functional scenarios can include: P0, P1, and P2. Among them, P0 represents core scenarios that must be covered with priority, P1 represents important scenarios that need to be fully covered, and P2 represents general scenarios that only need basic coverage.
[0075] S503 employs an attention-based intelligent agent to generate multiple scene units based on the image enhancement sequence. Each scene unit includes: a functional scene name, an associated content block, and a priority label.
[0076] In this embodiment, the boundaries of each functional scene are determined based on the image enhancement sequence, generating multiple scene units. The associated content block within a scene unit refers to the content block corresponding to that functional scene in the image enhancement sequence, and the priority label is the priority label of that functional scene.
[0077] S504 employs an attention-based intelligent agent to generate test plans based on the background requirements, multiple functional scenarios, test point information corresponding to each functional scenario, priority labels, and multiple scenario units.
[0078] In some implementations, an attention mechanism agent is used to analyze and summarize the background requirements, multiple functional scenarios, test point information corresponding to each functional scenario, priority labels, and multiple scenario units to generate a test plan.
[0079] In summary, by generating three semantically clear and structured elements—the background requirements, functional scenarios, and test point information—based on image enhancement sequences, the problem of missing or redundant test case coverage caused by ambiguous intent and unclear boundaries is reduced. Priority tags are dynamically assigned to each functional scenario and test point, mapping business importance to model attention. This facilitates prioritizing functional scenarios based on priority tags, allowing for the generation of test plans for high-priority functional scenarios and test point information. The generated scenario units bind the functional scenario name, associated content blocks, and priority tags, making the content corresponding to each scenario more accurate and clear, ensuring that each generation task is executed semantically. Finally, a test plan with inherent logical constraints is formed based on the output of all structured content. This significantly improves the business relevance, technical accuracy, and iteration consistency of the generated test plans, fundamentally alleviating the inherent divergence and context drift problems of large models, resulting in higher test case quality and adoption rates.
[0080] Optionally, Figure 6 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 6 ;like Figure 6 As shown, the process in S104 above, which uses a test case generation agent to sequentially generate test cases corresponding to each functional scenario in multiple functional scenarios based on image parsing text, requirement information, test plans, and relevant knowledge terms for each functional scenario, may include: S601. Based on the priority labels in the multiple scenario units of the test plan, sort the multiple functional scenarios to obtain the sorted multiple functional scenarios.
[0081] Specifically, based on the priority tags of functional scenarios in multiple scenario units of the test plan, multiple functional scenarios are sorted from high to low priority to construct a functional scenario queue. This queue includes the sorted functional scenarios. High-priority scenarios are placed at the front of the functional scenario queue and generated first; low-priority scenarios are placed at the back of the queue and generated later.
[0082] S602. Based on the image enhancement sequence, test plan, and relevant knowledge entries for each functional scenario, generate test cases corresponding to each functional scenario in the sorted multiple functional scenarios in sequence.
[0083] In some implementations, the test plan is used as attention-guided information to fuse the image enhancement sequence, the test plan, and relevant knowledge terms of each functional scenario to obtain the fused result; a test case generation agent is used to generate test cases corresponding to each functional scenario in the sorted multiple functional scenarios according to the fused result.
[0084] In the fused results, the test scheme is placed at the beginning as a global guide.
[0085] In summary, prioritizing functional scenarios by using priority tags ensures that core scenarios are generated and covered first, significantly improving the response speed for generating test cases for core scenarios. During the sequential generation of test cases, feedback from the previous functional scenario can be dynamically injected into prompts for the next scenario, allowing the model to maintain consistency while automatically avoiding known errors, reusing effective patterns, and filling in missing dimensions. This enables generation, verification, and testing to be completed in a single process, greatly improving the overall efficiency and pass rate of test case generation.
[0086] Optionally, Figure 7 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 7 ;like Figure 7 As shown, the process in S602 above, which generates test cases corresponding to each functional scenario in a sorted set of multiple functional scenarios based on the image enhancement sequence, test plan, and relevant knowledge terms for each functional scenario, may include: S701. Based on the content block associated with the first functional scenario in the test plan, the test point information corresponding to the first functional scenario, and the relevant knowledge terms of the first functional scenario, generate prompt word information for the first functional scenario using a prompt word template.
[0087] The first functional scenario is the first functional scenario among multiple functional scenarios.
[0088] In some implementations, a first functional scenario is determined based on multiple sorted functional scenarios, and a content block associated with the first functional scenario is determined according to the scenario unit in the test plan. Based on the content block associated with the first functional scenario, the test point information, constraints, risk points, and relevant knowledge terms of the first functional scenario, a preset prompt word template is used to generate prompt word information for the first functional scenario.
[0089] It should be noted that the preset prompt template can also be called the preset prompt template. The test case generation agent can choose any one of the following based on actual needs: general test case generation agent, precise test case generation agent, regression test case generation agent, and abnormal scenario test case generation agent. When different test case generation agents are used, the corresponding preset prompt templates will also be different.
[0090] In this application's embodiments, the general test case generation agent addresses conventional testing needs. Its prompt design covers the complete test case dimensions, including positive scenarios, negative scenarios, boundary scenarios, and abnormal scenarios, aiming to generate a comprehensive test case set. The precise test case generation agent targets scenarios requiring in-depth verification of core changes. Its prompt design focuses on positive scenario coverage and boundary value analysis of the changes, providing finer-grained test case descriptions and more detailed operation steps. The regression test case generation agent addresses regression testing needs in version iterations. Its prompt design requires the model to focus on analyzing the impact range of changes during generation, generating regression verification test cases for potentially affected related functions. The abnormal scenario test case generation agent addresses system robustness verification needs. Its prompt design focuses on generating test cases for abnormal scenarios such as abnormal branches, fault tolerance handling, concurrent access, permission violations, and network anomalies.
[0091] S702. Generate test cases corresponding to the first functional scenario based on the prompt information of the first functional scenario.
[0092] In some implementations, a list of test cases corresponding to the first functional scenario can be generated based on the prompt information of the first functional scenario. The test case list is in the format of a JSON array, and each test case includes: the module to which it belongs, the scenario name, the test case title, the preconditions, the operation steps, the expected result, the priority, and the test case type label (positive / negative / boundary / abnormal).
[0093] In practical applications, once the test cases for the first functional scenario are generated, test cases for the next functional scenario can be generated based on the sorted multiple functional scenarios, until test cases for multiple functional scenarios are generated.
[0094] Optionally, Figure 8 A flowchart illustrating a test case generation method provided in this application embodiment. Figure 8 ,like Figure 8 As shown, the second functional scenario is a functional scenario following the first functional scenario. The process in S602 above, which generates test cases corresponding to each functional scenario in the sorted multiple functional scenarios based on the image enhancement sequence, test plan, and relevant knowledge terms for each functional scenario, may include: S801. Obtain the adoption feedback information for the first functional scenario.
[0095] In this embodiment, after test cases for each functional scenario are generated, the user can select, reject, or modify each test case on the system interface. The user can also manually add test cases not covered for that functional scenario. The system automatically records the adoption feedback information for that functional scenario.
[0096] The adoption feedback information for this functional scenario includes: a list of adopted use cases (including the final confirmed use case content), rejected use cases and corresponding rejection reasons (such as "the scenario is irrelevant", "the step description is incorrect", "the granularity is too coarse", etc.), and a list of use cases manually supplemented by the user.
[0097] In some implementations, the test case adoption page displays a list of test cases, from which each test case can be selected, and adoption feedback information can be generated based on the results.
[0098] S802. Based on the content blocks associated with the second functional scenario in the test plan, the test point information corresponding to the second functional scenario, the relevant knowledge terms of the second functional scenario, and the adoption feedback information of the first functional scenario, generate the prompt word information for the second functional scenario using the prompt word template.
[0099] In some implementations, a first functional scenario is determined based on multiple sorted functional scenarios, and a content block associated with the second functional scenario is determined according to the scenario unit in the test plan. Based on the content block associated with the second functional scenario, the test point information, constraints, risk points, and adoption feedback information of the first functional scenario related to the second functional scenario, a preset prompt word template is used to generate prompt word information for the second functional scenario.
[0100] It should be noted that the adoption feedback information from the previous round (adoption feedback information for the first functional scenario) is injected into the prompt word information for the next round (prompt word information for the second functional scenario). The test cases adopted in the previous round serve as positive examples to guide the test cases generated in the next round to maintain consistency in format style, description granularity, and scenario coverage. The rejected test cases and their reasons serve as negative constraints, clearly informing the model of the types of problems to be avoided in subsequent generation. The test cases supplemented by users serve as supplementary perspectives to help the model discover test dimensions that were not previously considered.
[0101] S803. Generate test cases corresponding to the second functional scenario based on the prompt information of the second functional scenario.
[0102] In this embodiment, after generating test cases corresponding to the second functional scenario, prompt word information for the third functional scenario can be generated using a prompt word template, based on the content block associated with the third functional scenario in the test plan, the test point information corresponding to the third functional scenario, the relevant knowledge terms of the third functional scenario, and the adoption feedback information of the second functional scenario. Based on the prompt word information of the third functional scenario, test cases corresponding to the third functional scenario are then generated. This process continues until test cases for each functional scenario are generated.
[0103] Furthermore, in practical applications, content blocks associated with high-priority (P0, P1) functional scenarios are emphasized in the prompt information using structured markers, while content blocks associated with low-priority (P2) scenarios are arranged normally. This approach achieves differentiated weight allocation for information of different importance at the level of associated content blocks, guiding the generative model to focus on the core testing intent, thereby effectively reducing the divergence of generated content.
[0104] In this embodiment, through a closed-loop iteration of generating test cases, adopting feedback information, and providing feedback and calibration, the process of generating test cases for each functional scenario is continuously corrected, resulting in test cases corresponding to multiple functional scenarios. Finally, the output of test cases corresponding to multiple functional scenarios is merged into a complete test case set. This improves the quality of test case generation.
[0105] For each test case, a corresponding test case title, preconditions, execution steps, and expected results can be generated.
[0106] In addition, the establishment of a knowledge base can improve the accuracy of test case generation and scenario coverage. The knowledge base involved in the embodiments of this application will be described below.
[0107] In terms of the structural design of the knowledge entries, this application adopts a four-layer hierarchical structure to organize the knowledge content: the first layer is the business domain, corresponding to the division of product lines or business modules; the second layer is the functional scenario, corresponding to the specific functional points or business processes under the business domain; the third layer is the key test points, corresponding to the test dimensions that need to be focused on in the corresponding functional scenario, including boundary value rules, data constraints, interaction logic, etc.; the fourth layer is historical issues, recording historical defects, online issue reviews, frequently adopted test case templates, and typical counterexamples related to the test point. The knowledge entries are stored in Markdown (a lightweight markup language) format, which is convenient for manual reading and editing.
[0108] In the knowledge entry generation process, the system achieves low-cost automated construction through the following methods: After each round of test case generation and adoption, the system automatically collects the input information (requirement content), adopted test cases, rejected test cases, and supplementary test cases for this round. This information is then sent to the knowledge entry generation agent, which parses and generates or updates the corresponding knowledge entry according to the four-layer structure described above. The generated entries enter a review queue and are officially added to the database after manual verification. Furthermore, the system also supports using links to historical defect records, business documents, and other documents as input. The knowledge entry generation agent extracts information from these and supplements the generated knowledge entries, further enriching the knowledge base content. Through this process of generation, adoption, automatic extraction, and review and database entry, the knowledge base can continuously accumulate and update as the system is used, significantly reducing reliance on manual writing and maintenance.
[0109] In summary, the test case generation method provided in this application designs multiple dedicated agents, fully utilizing the semantic understanding and content generation capabilities of Large Language Models (LLMs). Compared to single-model generation schemes, this system achieves significant improvements in test case adoption rate and test case coverage. Employing an attention-based agent in collaboration with other agents effectively generates test cases for test points and functional scenarios, significantly reducing the divergence in test case generation and improving the adoption and coverage rates of test cases for core functional scenarios. Using OCR and image recognition agents, the system can accurately parse images within requirement information and deeply integrate them with the original requirement information, enhancing the understanding of image content and facilitating accurate test case generation.
[0110] Furthermore, by employing a multi-functional scenario breakdown and step-by-step generation approach, and by using feedback from the previous round of adoption to guide the generation of test cases in the next round, the integrity, scenario coherence, and high reliability of the test case set in large-scale projects are ensured. Based on the input and output of the test case generation process, it is automatically transformed into structured knowledge entries in the knowledge base, achieving knowledge entry accumulation and significantly reducing the reliance on manual maintenance of the knowledge base.
[0111] The following describes the test case generation apparatus, test case generation device, and storage medium used to execute the test case generation method provided in this application. For the specific implementation process and technical effects, please refer to the relevant content of the test case generation method above, which will not be repeated below.
[0112] Figure 9 This is a schematic diagram of the structure of a test case generation device provided in an embodiment of this application, as shown below. Figure 9 As shown, the device includes: The recognition and processing module 101 is used to use an image recognition intelligent agent to recognize and process the image content blocks in the demand information to obtain image parsing text; The parsing and processing module 102 is used to employ an attention mechanism agent to parse and process the requirement information and the image parsing text to obtain a test plan, wherein the test plan includes multiple functional scenarios. The retrieval module 103 is used to retrieve relevant knowledge entries for each of the aforementioned functional scenarios from the knowledge base; The generation module 104 is used to generate intelligent agents using test cases, and to sequentially generate test cases corresponding to each of the multiple functional scenarios based on the image parsing text, the requirement information, the test plan and the relevant knowledge entries of each of the functional scenarios.
[0113] Optionally, the recognition processing module 101 is specifically used to convert the demand information into an ordered sequence of content blocks; determine the image content blocks from the content block sequence; and use the image recognition agent to perform recognition processing based on the image content blocks and the content block sequence to obtain image parsing text.
[0114] Optionally, the recognition processing module 101 is specifically used to extract text from the image content block to obtain the text content in the image content block and the position information of the text in the image content block; to use an image recognition agent to perform recognition processing based on the image content block and the content block sequence to obtain the semantic information of the image content block; and to determine the image parsing text based on the text content in the image content block, the position information of the text in the image content block, and the semantic information of the image content block.
[0115] Optionally, the parsing processing module 102 is specifically used to replace the image content block in the content block sequence with the image parsing text to generate an image enhancement sequence; and to use the attention mechanism agent to perform parsing processing based on the image enhancement sequence to obtain a test scheme.
[0116] Optionally, the parsing and processing module 102 is specifically used to generate a requirement background, multiple functional scenarios, and test point information corresponding to each functional scenario based on the image enhancement sequence; assign priority labels to each functional scenario and each test point information using the attention mechanism agent; generate multiple scene units based on the image enhancement sequence using the attention mechanism agent, each scene unit including: a functional scenario name, an associated content block, and the priority label; and generate the test plan based on the requirement background, multiple functional scenarios, test point information corresponding to each functional scenario, the priority label, and multiple scene units using the attention mechanism agent.
[0117] Optionally, the generation module 104 is specifically used to sort the multiple functional scenarios according to the priority tags in the multiple scene units of the test scheme to obtain the sorted multiple functional scenarios; and to generate test cases corresponding to each functional scenario in the sorted multiple functional scenarios in sequence according to the image enhancement sequence, the test scheme, and the relevant knowledge terms of each functional scenario.
[0118] Optionally, the generation module 104 is specifically used to generate prompt word information for the first functional scenario based on the content block associated with the first functional scenario in the test plan, the test point information corresponding to the first functional scenario, and the relevant knowledge terms of the first functional scenario, using a prompt word template; and to generate test cases corresponding to the first functional scenario based on the prompt word information of the first functional scenario.
[0119] Optionally, the second functional scenario is a functional scenario following the first functional scenario. The generation module 104 is specifically used to obtain the adoption feedback information of the first functional scenario; generate prompt word information for the second functional scenario using a prompt word template based on the content block associated with the second functional scenario in the test plan, the test point information corresponding to the second functional scenario, the relevant knowledge terms of the second functional scenario, and the adoption feedback information of the first functional scenario; and generate test cases corresponding to the second functional scenario based on the prompt word information of the second functional scenario.
[0120] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0121] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).
[0122] Figure 10 This is a schematic diagram of the structure of a test case generation device provided in an embodiment of this application, as shown below. Figure 10 As shown, the test case generation device includes: processor 201 and memory 202.
[0123] The memory 202 is used to store programs, and the processor 201 calls the programs stored in the memory 202 to execute the above method embodiments. The specific implementation and technical effects are similar, and will not be described in detail here.
[0124] For example, the method includes: An image recognition intelligent agent is used to identify and process image content blocks in the requirement information to obtain image parsing text; An attention-based intelligent agent parses and processes the required information and the image parsing text to obtain a test plan, which includes multiple functional scenarios. Retrieve relevant knowledge entries for each of the described functional scenarios from the knowledge base; A test case generation agent is used to sequentially generate test cases corresponding to each of the multiple functional scenarios based on the image parsing text, the requirement information, the test plan, and the relevant knowledge terms of each functional scenario.
[0125] Optionally, the step of employing an image recognition agent to identify and process image content blocks in the demand information to obtain image parsing text includes: The requirement information is converted into an ordered sequence of content blocks; The image content block is determined from the content block sequence; The image recognition agent is used to perform recognition processing based on the image content blocks and the content block sequence to obtain image parsing text.
[0126] Optionally, the step of using the image recognition agent to perform recognition processing based on the image content blocks and the content block sequence to obtain image parsing text includes: Text is extracted from the image content block to obtain the text content in the image content block and the position information of the text in the image content block; An image recognition agent is used to perform recognition processing based on the image content blocks and the sequence of content blocks to obtain the semantic information of the image content blocks; The image parsing text is determined based on the text content in the image content block, the position information of the text in the image content block, and the semantic information of the image content block.
[0127] Optionally, the agent employing the attention mechanism parses and processes the demand information and the image-to-text parsing to obtain a test plan, including: The image content blocks in the content block sequence are replaced with the image parsing text to generate an image enhancement sequence; The agent employing the attention mechanism performs parsing and processing based on the image enhancement sequence to obtain a test scheme.
[0128] Optionally, the step of parsing the image enhancement sequence to obtain a test scheme includes: Based on the image enhancement sequence, generate the requirement background, multiple functional scenarios, and test point information corresponding to each functional scenario; The attention mechanism agent assigns priority labels to each of the aforementioned functional scenarios and each of the aforementioned test point information; The agent employing the attention mechanism generates multiple scene units based on the image enhancement sequence. Each scene unit includes: a functional scene name, an associated content block, and a priority label. The attention mechanism agent generates the test plan based on the required background, multiple functional scenarios, test point information corresponding to each functional scenario, priority labels, and multiple scenario units.
[0129] Optionally, the use case generation agent generates test cases corresponding to each of the functional scenarios in a plurality of functional scenarios sequentially based on the image parsing text, the requirement information, the test plan, and relevant knowledge terms for each functional scenario, including: Based on the priority tags in the multiple scenario units of the test plan, the multiple functional scenarios are sorted to obtain the sorted multiple functional scenarios; Based on the image enhancement sequence, the test plan, and the relevant knowledge terms for each of the functional scenarios, test cases corresponding to each of the sorted functional scenarios are generated sequentially.
[0130] Optionally, the step of generating test cases corresponding to each of the sorted functional scenarios in a plurality of functional scenarios according to the image enhancement sequence, the test plan, and relevant knowledge terms of each functional scenario includes: Based on the content block associated with the first functional scenario in the test plan, the test point information corresponding to the first functional scenario, and the relevant knowledge terms of the first functional scenario, a prompt word template is used to generate prompt word information for the first functional scenario. Based on the prompt information of the first functional scenario, generate test cases corresponding to the first functional scenario.
[0131] Optionally, the second functional scenario is a functional scenario following the first functional scenario. The step of generating test cases corresponding to each of the sorted functional scenarios sequentially based on the image enhancement sequence, the test plan, and relevant knowledge terms for each functional scenario includes: Obtain the adoption feedback information for the first functional scenario; Based on the content block associated with the second functional scenario in the test plan, the test point information corresponding to the second functional scenario, the relevant knowledge terms of the second functional scenario, and the adoption feedback information of the first functional scenario, a prompt word template is used to generate prompt word information for the second functional scenario. Based on the prompt information of the second functional scenario, generate test cases corresponding to the second functional scenario.
[0132] In summary, the image recognition agent can automatically and accurately parse image information in the requirements. Moreover, by jointly employing multiple agents, including an attention mechanism agent and a test case generation agent, to collaboratively generate test cases for various functional scenarios, the influence of subjective factors is reduced, significantly improving the efficiency and quality of test case generation. Furthermore, during test case generation, relevant knowledge entries in the knowledge base are used to identify and fill gaps, further enhancing the quality of the generated test cases.
[0133] Optionally, this application also provides a program product, such as a computer-readable storage medium, including a program that, when executed by a processor, performs the above-described method embodiments.
[0134] For example, the method includes: An image recognition intelligent agent is used to identify and process image content blocks in the requirement information to obtain image parsing text; An attention-based intelligent agent parses and processes the required information and the image parsing text to obtain a test plan, which includes multiple functional scenarios. Retrieve relevant knowledge entries for each of the described functional scenarios from the knowledge base; A test case generation agent is used to sequentially generate test cases corresponding to each of the multiple functional scenarios based on the image parsing text, the requirement information, the test plan, and the relevant knowledge terms of each functional scenario.
[0135] Optionally, the step of employing an image recognition agent to identify and process image content blocks in the demand information to obtain image parsing text includes: The requirement information is converted into an ordered sequence of content blocks; The image content block is determined from the content block sequence; The image recognition agent is used to perform recognition processing based on the image content blocks and the content block sequence to obtain image parsing text.
[0136] Optionally, the step of using the image recognition agent to perform recognition processing based on the image content blocks and the content block sequence to obtain image parsing text includes: Text is extracted from the image content block to obtain the text content in the image content block and the position information of the text in the image content block; An image recognition agent is used to perform recognition processing based on the image content blocks and the sequence of content blocks to obtain the semantic information of the image content blocks; The image parsing text is determined based on the text content in the image content block, the position information of the text in the image content block, and the semantic information of the image content block.
[0137] Optionally, the agent employing the attention mechanism parses and processes the demand information and the image-to-text parsing to obtain a test plan, including: The image content blocks in the content block sequence are replaced with the image parsing text to generate an image enhancement sequence; The agent employing the attention mechanism performs parsing and processing based on the image enhancement sequence to obtain a test scheme.
[0138] Optionally, the step of parsing the image enhancement sequence to obtain a test scheme includes: Based on the image enhancement sequence, generate the requirement background, multiple functional scenarios, and test point information corresponding to each functional scenario; The attention mechanism agent assigns priority labels to each of the aforementioned functional scenarios and each of the aforementioned test point information; The agent employing the attention mechanism generates multiple scene units based on the image enhancement sequence. Each scene unit includes: a functional scene name, an associated content block, and a priority label. The attention mechanism agent generates the test plan based on the required background, multiple functional scenarios, test point information corresponding to each functional scenario, priority labels, and multiple scenario units.
[0139] Optionally, the use case generation agent generates test cases corresponding to each of the functional scenarios in a plurality of functional scenarios sequentially based on the image parsing text, the requirement information, the test plan, and relevant knowledge terms for each functional scenario, including: Based on the priority tags in the multiple scenario units of the test plan, the multiple functional scenarios are sorted to obtain the sorted multiple functional scenarios; Based on the image enhancement sequence, the test plan, and the relevant knowledge terms for each of the functional scenarios, test cases corresponding to each of the sorted functional scenarios are generated sequentially.
[0140] Optionally, the step of generating test cases corresponding to each of the sorted functional scenarios in a plurality of functional scenarios according to the image enhancement sequence, the test plan, and relevant knowledge terms of each functional scenario includes: Based on the content block associated with the first functional scenario in the test plan, the test point information corresponding to the first functional scenario, and the relevant knowledge terms of the first functional scenario, a prompt word template is used to generate prompt word information for the first functional scenario. Based on the prompt information of the first functional scenario, generate test cases corresponding to the first functional scenario.
[0141] Optionally, the second functional scenario is a functional scenario following the first functional scenario. The step of generating test cases corresponding to each of the sorted functional scenarios sequentially based on the image enhancement sequence, the test plan, and relevant knowledge terms for each functional scenario includes: Obtain the adoption feedback information for the first functional scenario; Based on the content block associated with the second functional scenario in the test plan, the test point information corresponding to the second functional scenario, the relevant knowledge terms of the second functional scenario, and the adoption feedback information of the first functional scenario, a prompt word template is used to generate prompt word information for the second functional scenario. Based on the prompt information of the second functional scenario, generate test cases corresponding to the second functional scenario.
[0142] In summary, the image recognition agent can automatically and accurately parse image information in the requirements. Moreover, by jointly employing multiple agents, including an attention mechanism agent and a test case generation agent, to collaboratively generate test cases for various functional scenarios, the influence of subjective factors is reduced, significantly improving the efficiency and quality of test case generation. Furthermore, during test case generation, relevant knowledge entries in the knowledge base are used to identify and fill gaps, further enhancing the quality of the generated test cases.
[0143] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0144] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0145] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0146] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0147] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A test case generation method, characterized in that, include: An image recognition intelligent agent is used to identify and process image content blocks in the requirement information to obtain image parsing text; An attention-based intelligent agent parses and processes the required information and the image parsing text to obtain a test plan, which includes multiple functional scenarios. Retrieve relevant knowledge entries for each of the described functional scenarios from the knowledge base; A test case generation agent is used to sequentially generate test cases corresponding to each of the multiple functional scenarios based on the image parsing text, the requirement information, the test plan, and the relevant knowledge terms of each functional scenario.
2. The method according to claim 1, characterized in that, The method employs an image recognition intelligent agent to identify and process image content blocks in the demand information, obtaining image parsing text, including: The requirement information is converted into an ordered sequence of content blocks; The image content block is determined from the content block sequence; The image recognition agent is used to perform recognition processing based on the image content blocks and the sequence of content blocks to obtain image parsing text.
3. The method according to claim 2, characterized in that, The image recognition agent is used to perform recognition processing based on the image content blocks and the content block sequence to obtain image parsing text, including: Text is extracted from the image content block to obtain the text content in the image content block and the position information of the text in the image content block; An image recognition agent is used to perform recognition processing based on the image content blocks and the sequence of content blocks to obtain the semantic information of the image content blocks; The image parsing text is determined based on the text content in the image content block, the position information of the text in the image content block, and the semantic information of the image content block.
4. The method according to claim 2, characterized in that, The agent employing an attention mechanism parses and processes the required information and the image-to-text parsing to obtain a test plan, including: The image content blocks in the content block sequence are replaced with the image parsing text to generate an image enhancement sequence; The attention mechanism agent is used to analyze and process the image enhancement sequence to obtain a test scheme.
5. The method according to claim 4, characterized in that, The step of parsing and processing the image enhancement sequence to obtain the test scheme includes: Based on the image enhancement sequence, generate the requirement background, multiple functional scenarios, and test point information corresponding to each functional scenario; The attention mechanism agent assigns priority labels to each of the aforementioned functional scenarios and each of the aforementioned test point information; The agent employing the attention mechanism generates multiple scene units based on the image enhancement sequence. Each scene unit includes: a functional scene name, an associated content block, and a priority label. The attention mechanism agent generates the test plan based on the required background, multiple functional scenarios, test point information corresponding to each functional scenario, priority labels, and multiple scenario units.
6. The method according to claim 5, characterized in that, The method employs a test case generation agent to sequentially generate test cases corresponding to each of the multiple functional scenarios based on the image parsing text, the requirement information, the test plan, and relevant knowledge terms for each functional scenario, including: Based on the priority tags in the multiple scenario units of the test plan, the multiple functional scenarios are sorted to obtain the sorted multiple functional scenarios; Based on the image enhancement sequence, the test plan, and the relevant knowledge terms for each of the functional scenarios, test cases corresponding to each of the sorted functional scenarios are generated sequentially.
7. The method according to claim 6, characterized in that, The step of generating test cases corresponding to each of the sorted functional scenarios in a plurality of functional scenarios based on the image enhancement sequence, the test plan, and relevant knowledge terms of each functional scenario includes: Based on the content block associated with the first functional scenario in the test plan, the test point information corresponding to the first functional scenario, and the relevant knowledge terms of the first functional scenario, a prompt word template is used to generate prompt word information for the first functional scenario. Based on the prompt information of the first functional scenario, generate test cases corresponding to the first functional scenario.
8. A test case generation device, characterized in that, include: The recognition and processing module is used to identify and process image content blocks in the requirement information using an image recognition intelligent agent to obtain image parsing text; The parsing and processing module is used to employ an attention mechanism agent to parse and process the required information and the image parsing text to obtain a test plan, wherein the test plan includes multiple functional scenarios; The retrieval module is used to retrieve relevant knowledge entries for each of the aforementioned functional scenarios from the knowledge base; The generation module is used to generate intelligent agents using test cases, and to sequentially generate test cases corresponding to each of the multiple functional scenarios based on the image parsing text, the requirement information, the test plan, and the relevant knowledge entries of each of the functional scenarios.
9. A test case generation device, characterized in that, include: A memory and a processor, wherein the memory stores a computer program executable by the processor, and the processor executes the computer program to implement a test case generation method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when read and executed, implements a test case generation method according to any one of claims 1-7.