Test case generation method, computer program product, electronic equipment and medium

Automatically generates automotive test cases through large language models and knowledge bases, solving the problem of time-consuming and labor-consuming traditional manual writing, achieving efficient and automated test case generation, and improving testing efficiency and coverage.

CN120407412APending Publication Date: 2025-08-01CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510505547.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The traditional automotive test cases are time-consuming and labor-intensive, easy to miss and poor repetition, which affects test efficiency and coverage.

Method used

The large language model is used to automatically generate test cases by combining the knowledge base. By obtaining the requirements document information, the large language model and knowledge base are used to generate standard test cases, and populating them into the test case template.

Benefits of technology

It improves the automation level and quality of test case generation, reduces the pressure of manual testing, reduces the cost of testing, and improves test efficiency and coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407412A_ABST
    Figure CN120407412A_ABST
Patent Text Reader

Abstract

The invention relates to the field of vehicle testing, in particular to a test case generation method, a computer program product, electronic equipment and a medium. The test case generation method comprises the following steps: acquiring a demand document of a tested object; extracting document information required by a test case from the demand document; inputting the document information into a large language model to obtain information of a standard test case; and filling the information of the standard test case into a template of the test case to obtain the test case. According to the invention, the pressure of manual test work can be reduced, the test efficiency is improved, and the test cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of vehicle testing. Specifically, it relates to a method for generating test cases, a computer program product, an electronic device, and a medium. Background Art

[0002] Test cases are used in automotive testing to define and execute the test process to ensure that the functions, performance, and safety of the vehicle meet the expected standards. Test cases usually include a series of predefined conditions, inputs, operation steps, and expected results, aiming to verify whether a specific function or system module works as expected.

[0003] The traditional way of writing automotive test cases mainly relies on manual work, and testers need to write test cases manually. This method not only consumes time and effort but also easily has problems such as omissions, incompleteness, and poor repeatability, seriously affecting the test efficiency and test coverage.

[0004] In view of this, this application is proposed. Summary of the Invention

[0005] The purpose of this application is to provide a method for generating test cases, a computer program product, an electronic device, and a medium to solve the problems of low efficiency, incompleteness, and poor repeatability in writing test cases in the existing technology.

[0006] To achieve the above purpose, this application adopts the following technical solutions: In a first aspect, this application provides a method for generating test cases, including: Obtain the requirement document of the object under test; Extract the document information required for test cases from the requirement document; Input the document information into a large language model to obtain the information of standard test cases; Fill the information of the standard test cases into the template of the test cases to obtain the test cases.

[0007] In a second aspect, this application provides a computer program product that, when running on a computer, enables the computer to execute the method for generating test cases described in the first aspect above.

[0008] In a third aspect, this application provides an electronic device, including: At least one processor, and a memory communicatively connected to at least one of the processors; Wherein, the memory stores instructions executable by at least one of the processors, and the instructions are executed by at least one of the processors so that at least one of the processors can execute the method for generating test cases described above.

[0009] Fourthly, the present application provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the above-mentioned method for generating test cases.

[0010] Compared with the prior art, the beneficial effects of the present application are as follows: The present application obtains the requirement document of the object under test; extracts the document information required for test cases from the requirement document; and inputs the document information into a large language model to obtain the information of standard test cases, which can accurately extract information from complex requirement documents and, combined with the processing ability of the large language model, automatically generate the information of standard test cases. The present application can reduce the pressure of manual testing work, improve the testing efficiency, and reduce the testing cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0012] Figure 1 is a schematic flowchart of a method for generating test cases provided by the present application; Figure 2 is a flowchart of another method for generating test cases provided by an embodiment of the present application Figure 3 is a flowchart of yet another method for generating test cases provided by an embodiment of the present application; Figure 4 is a schematic structural diagram of an electronic device provided by the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0013] The following makes an explanation of the exemplary embodiments of the present application with reference to the drawings, including various details of the embodiments of the present application to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described here without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.

[0014] The following further elaborates on the present application in detail with reference to the embodiments.

[0015] Figure 1It is a flowchart of a method for generating test cases provided by this embodiment. This method can be executed by a computer program and integrated in an electronic device, which can be a vehicle head unit, a central control unit, or other devices that can run a computer program. As Figure 1 shown, this embodiment provides a method for generating test cases, including the following steps: S110. Obtain the requirement document of the object under test.

[0016] The embodiments of the present application do not limit the type of the object under test, which can be an instrument, a seat, a battery, a steering wheel, etc.

[0017] The requirement document of the object under test is an official document used to clarify requirements during the development process of the object under test, and its purpose is to provide clear guidance for subsequent design, development, and testing. For example, the requirement document includes 1) product description: an overall description of the product, including functions, uses, and target users; 2) design requirements: details of the design requirements of the product at the hardware and software levels, such as circuit design, sensor configuration, communication protocols, etc.; 3) functional requirements: list of specific functions that the product needs to implement, such as charge and discharge management, temperature monitoring, and fault warning in the battery management system; 4) test requirements: test items that the product needs to pass, including electrical performance tests, reliability tests, environmental adaptability tests, etc.; 5) test methods and standards: such as EMC tests, long-term overvoltage tests, transient overvoltage tests, etc.

[0018] S120. Extract the document information required for test cases from the requirement document.

[0019] A test case includes a series of predefined conditions, inputs, operation steps, and expected results, aiming to verify whether a specific function or system module works as expected. Therefore, in this embodiment, the document information required for test cases can be mainly extracted from the functional requirements, test requirements, test methods, and standards of the requirement document.

[0020] Optionally, the steps for extracting the document information required for test cases from the requirements document are as follows: 1) Import the requirements document: Convert the requirements document into text format and then import it into an electronic device. If the requirements document is in pdf or word format, it needs to be converted into text format before import. 2) Extract text from the requirements document: Identify sentence boundaries for the text-format requirements document and perform word segmentation and part-of-speech tagging. For example, use regular expressions or specific rules (such as punctuation marks, line breaks, etc.) to split sentence boundaries. Split the continuous text sequence in a sentence into independent lexical units, and then use predefined part-of-speech tagging rules to tag each word segment with parts of speech such as nouns, verbs, adjectives, etc. 3) Text segmentation processing: Split the text into multiple sentence paragraphs according to sentence boundaries. 4) Templatization processing: Perform formatting processing on the segmented text to obtain document information in text format, such as adding titles, unifying formats, etc.

[0021] S130. Input the document information into a large language model to obtain the information of standard test cases.

[0022] Large Language Models (LLMs) parse and understand the natural language description of the document information and convert this information into the information of specific test cases. Optionally, the type of the large language model in this embodiment is not limited and can be a model based on Transformer, such as a deep bidirectional language model (Bidirectional Encoder Representations from Transformers, BERT), GPT (Generative Pre-trained Transformer) model, or deepseek model.

[0023] Due to the limitations of large language models, it is difficult to generate test cases with the characteristics of the object under test by combining the characteristics of the object under test. In this embodiment, the information output by the large language model is called the information of standard test cases. For example, the information of the standard test cases includes titles, preconditions, execution steps, and expected results.

[0024] S140. Fill the information of the standard test cases into the template of the test cases to obtain the test cases.

[0025] The template of the test cases stipulates the information such as the fields and formats required for the test cases. Extract the corresponding information from the information of the standard test cases according to the fields in the template, and organize the extracted information according to the format provided by the template, so as to automatically form the test cases.

[0026] This application obtains the requirement document of the object under test; extracts the document information required for test cases from the requirement document; inputs the document information into a large language model to obtain the information of standard test cases, can accurately extract information from complex requirement documents, and combines the processing ability of the large language model to automatically generate the information of standard test cases. This application can reduce the pressure of manual testing work, improve testing efficiency, and reduce testing costs.

[0027] Figure 2 It is a flowchart of another method for generating test cases provided by an embodiment of this application, which adds the retrieval of a knowledge base to enrich the document information input into the large language model and obtain more comprehensive and higher-coverage test cases. See Figure 2 , which specifically includes the following operations: S210. Obtain the requirement document of the object under test.

[0028] S220. Extract the document information required for test cases from the requirement document.

[0029] S230. Retrieve the document information in a pre-constructed knowledge base and determine whether there is returned information; if there is returned information, execute S240, and if there is no returned information, execute S250.

[0030] The following details the construction process of the knowledge base, including: 1) Prepare the data for constructing the knowledge base. For example, standardize the historical requirement documents of the instrument to obtain the data for constructing the knowledge base. The standardization process includes, but is not limited to: identifying sentence boundaries, word segmentation and part-of-speech tagging, and text segmentation processing. 2) Convert the aforementioned prepared data into vectors, that is, represent the data in vector form. 3) Construct an index, that is, use the generated vectors to construct an index for retrieval use.

[0031] Retrieve the document information extracted from the requirement document one by one in the knowledge base. Optionally, it includes the following operations: 1) Parse the document information into an internal representation according to the representation form of the knowledge base, for example, parse it into a vector; 2) Expand the internal representation according to semantic relevance to obtain multiple query words; 3) Retrieve in the knowledge base according to the multiple query words to obtain multiple candidate information; 4) Calculate the similarity between the multiple candidate information and the document information to obtain the information that meets the similarity requirements. For example, calculate the text similarity between the document information in vector form and any candidate information, and cosine similarity can be used as the similarity score. The result of cosine similarity is between [-1, 1], and the value closer to 1 indicates that the two vectors are more similar. The calculation formula of cosine similarity Score is as follows: ; Among them, q represents candidate information, d represents document information, and ||q|| and ||d|| represent the norms of candidate information and document information respectively.

[0032] Sort multiple candidate information in descending order according to the similarity score, and select the candidate information with the highest score. Finally, convert the candidate information in vector form back to text.

[0033] Optionally, evaluate the candidate information retrieved from the knowledge base, and the evaluation metrics are as follows:

[0034] Optionally, if the retrieved candidate information does not meet any of the above evaluation metrics, discard the candidate information.

[0035] Optionally, because in the process of automatically generating test cases, it is necessary to quickly retrieve and store document information, the Faiss vector database can be used. The Faiss vector database is an efficient and scalable tool for storing and quickly retrieving high-dimensional vectors, and is widely used in various vector-based search and recommendation tasks. The process of retrieving from the knowledge base can be processed using threads to improve the retrieval efficiency.

[0036] Optionally, the document information extracted from the requirement document can be added to the knowledge base to enrich the knowledge in the knowledge base and improve the context reasoning effect.

[0037] S240: Use the information returned by the knowledge base as the document information required for the test case, and input the document information into the large language model to obtain the information of the standard test case. Continue to execute S260.

[0038] If the knowledge base can return information, use the returned information to input into the large language model; if the knowledge base does not return information, use the document information extracted from the requirement document to input into the large language model.

[0039] S250: Input the document information into the large language model to obtain the information of the standard test case.

[0040] S260: Fill the information of the standard test case into the template of the test case to obtain the test case.

[0041] Figure 3 It is a flowchart of another method for generating test cases provided by an embodiment of the present application. Based on the above embodiment, this embodiment refines the execution process of the large language model, as well as the use and post-processing process of the test case template. See Figure 3 This embodiment specifically includes the following operations: S310: Obtain the requirement document of the object under test.

[0042] S320. Extract the document information required for test cases from the requirements document.

[0043] S330. Define the standard fields for the output of the large language model; input the document information into the large language model to obtain the information of the standard fields, which is used as the information of the standard test cases.

[0044] Optionally, the standard fields include title, precondition, execution steps, and expected result. The purpose of pre - defining the standard fields is to make the large language model output according to the standard fields.

[0045] Exemplarily, construct an output template according to the standard fields and provide the output template to the large language model. In the output template, the title is identified as $title$, the precondition is identified as $condition$, the execution steps are identified as $steps$, and the expected result is identified as $result$. Do not have additional reply content other than the standard fields. If there is a line break, use \r\n to replace it. The template is in json format: {"title": "$title", "precondition": "$condition$", "execution steps": "$steps$", "expected result": "$result$"} The large language model outputs the title content, precondition content, execution steps content, and expected result content according to the input document information. These output contents are called the information of the standard test cases.

[0046] S340. Fill the information of the standard test cases into the template according to the fields of the test case template; verify the information in the template.

[0047] Pre - construct the fields of the test case template, including test case number, title, precondition, execution steps, and expected result. Fill the information of the standard test cases output by the large language model into the test case template according to the corresponding relationship of the fields. After filling, see the following table:

[0048] Optionally, to improve the accuracy of test cases, verify the information in the template, including but not limited to: 1) Logic verification: Verify the sequence of each execution step to check for logical errors; 2) Numerical range verification: Verify the rationality of the numerical values in the precondition, expected result, and execution steps to see if they exceed the normal numerical range of the object under test; 3) Consistency verification: Verify the semantic consistency of the fields and the content under the fields to check for incorrect filling.

[0049] S350. Obtain the personalized information of the object under test; traverse the information of the standard test cases, and find the corresponding standard information for the personalized information; replace the standard information with the personalized information.

[0050] The personalized information of the object under test includes, but is not limited to, the personalized information of communication signals, the personalized information of control modes, and the personalized information of logical operations. The information of the standard test cases is universal and needs to be adaptively adjusted according to the above-mentioned personalized information of the object under test for special use in testing the object under test. For example, the preset conditions in the information of the standard test cases include a temperature range of 20 degrees to 39 degrees, and the temperature of the current test of the object under test is 20 degrees to 30 degrees, then the temperature range of 20 degrees to 39 degrees in the standard test cases is adjusted to 20 degrees to 30 degrees.

[0051] In some embodiments, taking the personalized information including the personalized information of communication signals as an example, the generation and adjustment process of the test case information is described.

[0052] First, pre-construct the correspondence between the personalized information of communication signals (such as CAN signals) and the information of standard signals, as shown in the following table:

[0053] In the above table, the personalized information is the English name of the CAN signal matrix specified for the object under test (such as an instrument). Since this English name will change with the business, a fixed Chinese name is bound, that is, the information of the standard signal in the last column, and the information of the standard signal is stored in the knowledge base. After extracting the document information from the requirements document, it is necessary to convert the personalized information in the document information into the corresponding standard information; moreover, the standard information retrieved from the knowledge base is also the standard information. The standard information is represented by semantics, which can enable the large language model to better perform semantic parsing, so as to output more accurate test case information.

[0054] Traverse the information of the communication signals in the standard test cases, such as the information of CAN signals; find the information of the standard signals corresponding to the personalized information of the communication signals. Replace the standard information with the personalized information. For example, replace the left turn signal with ClusterLeftLight. Finally, put the replaced test cases into the actual test process.

[0055] Compared with the existing technologies, the beneficial effects of the embodiments of the present application are as follows: (1) Improve the efficiency and coverage rate of testing.

[0056] The embodiments of the present application combine a knowledge base with a large language model, which can accurately extract key information from complex requirement documents, generate high-quality test cases, improve the automation level and quality of test case generation, solve the problems of large workload, low efficiency, easy omission and duplication in manually writing test cases, and improve the efficiency and coverage of instrument testing.

[0057] (2) Reduce testing costs.

[0058] In the embodiments of the present application, the process of constructing a knowledge base in combination with a general large model and automatically generating test cases can act as a testing expert for actual projects, can relieve the pressure of manual testing work while forming an automated processing solution, and reduce testing costs.

[0059] (3) Improve generality.

[0060] The embodiments of the present application generate test cases for requirement documents. During the process of processing requirements, knowledge base retrieval can be performed and stored in the knowledge base, continuously enriching the content of the knowledge base, and replacing standard information with personalized information, which has extremely high generality.

[0061] (4) Improve the quality of test case generation.

[0062] By standardizing the requirement documents, including scanning text, segmenting, and performing knowledge base retrieval on the segmented sentences, it is possible to better understand and process complex requirement documents. The generated test cases are targeted and comprehensive, overcoming the shortcomings of the test case generation methods based on rule matching or template filling that are difficult to accurately understand and process complex requirement documents; and defining the template fields of the test cases improves the quality of test case generation.

[0063] (5) An effective verification mechanism.

[0064] The embodiments of the present application fuse the content returned by knowledge base retrieval with the large model, and after processing through Python code, automatically fill the returned test case information into the template. Moreover, an effective verification mechanism is provided, which can verify whether the test cases meet the preset requirement item test conditions, ensuring the quality of the test cases and solving the problem that the existing automated test case generation methods lack an inspection mechanism, resulting in uneven quality of test cases.

[0065] As Figure 4 shown, this embodiment provides an electronic device, including: At least one processor; and A memory communicatively connected to at least one of the processors; wherein, The memory stores instructions executable by at least one of the processors, and the instructions are executed by at least one of the processors to enable at least one of the processors to execute the above method. At least one processor in the electronic device can execute the above method, and thus has at least the same advantages as the above method.

[0066] Optionally, the electronic device further includes an interface for connecting various components, including a high-speed interface and a low-speed interface. Each component is interconnected using different buses and can be mounted on a common motherboard or otherwise as needed. The processor can process instructions executed within the electronic device, including instructions for storing graphical information in the memory or on the memory to display a GUI (Graphical User Interface) on an external input / output device (such as a display device coupled to the interface). In other embodiments, if needed, multiple processors can be used with multiple memories, and / or multiple buses can be used with multiple memories. Similarly, multiple electronic devices can be connected (e.g., as a server array, a set of blade servers, or a multi-processor system), and each device provides part of the necessary operations. Figure 4 Taking a processor 301 as an example.

[0067] The memory 302, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the test case generation method in the embodiments of the present application. The processor 301 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 302, that is, implements the above test case generation method.

[0068] The memory 302 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory 302 can include high-speed random access memory and can also include non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 302 can further include a memory remotely set relative to the processor 301, and these remote memories can be connected to the device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0069] The electronic device may further include: an input device 303 and an output device 304. The processor 301, the memory 302, the input device 303, and the output device 304 can be connected through a bus or other means. Figure 4Take the bus connection as an example.

[0070] The input device 303 can receive input digital or character information. The output device 304 may include a display device, an auxiliary lighting device (e.g., an LED), a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.

[0071] This embodiment provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the above method. The computer instructions on the computer-readable storage medium are used to cause a computer to execute the above method, and thus have at least the same advantages as the above method.

[0072] The medium in this application may adopt any combination of one or more computer-readable media. The medium may be a computer-readable signal medium or a computer-readable storage medium. The medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the medium (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.

[0073] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.

[0074] The program code included on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to wireless, wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.

[0075] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0076] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire, such as coaxial cable, optical fiber, digital subscriber line (DSL), or wirelessly, such as infrared, wireless, microwave, etc. The computer-readable storage medium can be any available medium that the computer can access, or a data storage device such as a server, data center, etc. that contains one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium, or a semiconductor medium, etc. It should be noted that the computer-readable storage medium mentioned in the embodiments of this application can be a non-volatile storage medium, in other words, it can be a non-transitory storage medium.

[0077] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this application can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this application can be achieved. There is no limitation herein.

[0078] The above specific embodiments do not constitute a limitation to the protection scope of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of this application shall be included within the protection scope of this application.

Claims

1. A method for generating test cases, characterized in that, Including: Obtain the requirements document of the object under test; Extract the document information required for test cases from the requirements document; Input the document information into a large language model to obtain the information of standard test cases; Fill the information of the standard test cases into the template of test cases to obtain test cases.

2. The method for generating a test case according to claim 1, wherein Before inputting the document information into the large language model, it further includes: Retrieve the document information in a pre-constructed knowledge base to obtain the information returned by the knowledge base; Use the information returned by the knowledge base as the document information required for test cases.

3. The method for generating test cases according to claim 1, wherein Inputting the document information into the large language model to obtain the information of standard test cases includes: Define the standard fields output by the large language model; Input the document information into the large language model to obtain the information of the standard fields, which is used as the information of standard test cases; Among them, the standard fields include title, preconditions, execution steps, and expected results.

4. The method for generating a test case according to claim 1, wherein After filling the information of the standard test cases into the template of test cases to obtain test cases, it further includes: Obtain the personalized information of the object under test; Traverse the information of the standard test cases to find the standard information corresponding to the personalized information; Replace the standard information with the personalized information.

5. The method for generating a test case according to claim 4, wherein The personalized information includes the personalized information of communication signals; Traversing the information of the standard test cases to find the standard information corresponding to the personalized information includes: Traverse the information of communication signals in the standard test cases to find the information of standard signals corresponding to the personalized information of the communication signals; Replacing the standard information with the personalized information includes: Replace the information of the standard signal with the personalized information of the communication signal.

6. The method for generating a test case according to claim 1, wherein, Filling the information of the standard test cases into the template of test cases to obtain test cases includes: Fill the information of the standard test cases into the template according to the fields of the template of test cases; Verify the information in the template.

7. The method for generating a test case according to claim 2, wherein, Retrieving the document information in a pre-constructed knowledge base to obtain the information returned by the knowledge base includes: Parse the document information into an internal representation according to the representation form of the knowledge base; Expand the internal representation according to semantic relevance to obtain multiple query terms; Retrieve in the knowledge base according to the multiple query terms to obtain multiple candidate information; Calculate the similarity between the multiple candidate information and the document information to obtain the information that meets the similarity requirements.

8. A computer program product, characterized in that, Including: The computer program product stores computer instructions, and when the computer instructions are executed by a processor, the steps of the test case generation method described in any one of claims 1-7 are implemented.

9. An electronic device, characterized in that, Including: At least one processor, and a memory communicatively connected to at least one of the processors; Among them, the memory stores instructions executable by at least one of the processors, and the instructions are executed by at least one of the processors so that at least one of the processors can execute the test case generation method described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, Computer instructions are stored on the medium, and the computer instructions are used to cause a computer to execute the method for generating a test case according to any one of claims 1-7.

Citation Information

Cited By

  • Model-driven algorithm test method and system, computer and storage medium

    CN121051028A

  • A model-driven algorithm testing method, system, computer and storage medium

    CN121051028B