A test case generation method and device, electronic equipment, and storage medium

CN122985601APending Publication Date: 2026-10-27UNITED AUTOMOTIVE ELECTRONICS SYST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510538883.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0004]鉴于以上现有技术的缺陷,本发明提供一种测试用例生成方法及装置、电子设备、存储介质,以解决现有技术中不能测试耗时耗力、易出错、不能完成实现修正条件/判定覆盖度测试的技术问题

Benefits of technology

[0015]本发明的有益效果:本发明提出的一种测试用例生成方法及装置、电子设备、存储介质,该方法通过用户提出的自然语言需求,并通过自然语言处理模型、预设规则、预设数据库,来高效、全面、自动地生成测试用例,这样不仅能显著提高测试工程师编写测试用例的效率,还能提升测试用例的质量,进一步加快汽车研发的进程,确保汽车系统的稳定性和安全性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985601A_ABST
    Figure CN122985601A_ABST
Patent Text Reader

Abstract

The application provides a test case generation method and device, electronic equipment and a storage medium. The method comprises the following steps: obtaining a natural language description of a test requirement; processing the natural language description by using a natural language processing model and a preset rule to obtain a plurality of requirement points and a logical relationship between the requirement points; splitting the requirement points by using the natural language processing model and a preset database to obtain a splitting result of each requirement point; and generating a test case according to the splitting result of the requirement points and the logical relationship between the requirement points. The natural language requirement proposed by a user is processed by using the natural language processing model, the preset rule and the preset database to efficiently, comprehensively and automatically generate the test case. Therefore, the efficiency of a test engineer in writing the test case can be significantly improved, the quality of the test case can be improved, the process of automobile research and development can be further accelerated, and the stability and safety of an automobile system can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of testing technology, and in particular to a test case generation method and apparatus, electronic device, and storage medium. Background Technology

[0002] Application layer testing of automotive systems plays a crucial role in the automotive R&D process. This stage primarily focuses on the integration of various functional modules at the system application layer according to design requirements and rigorously examines them against application layer testing standards. Its aim is to verify the smoothness of interaction between the various application components of the system, while simultaneously meeting technical standards and functional safety requirements, ensuring that system operation does not violate predetermined safety guidelines, thereby improving system stability and security.

[0003] In current practice, test engineers typically need to manually write test cases based on test requirements when performing application-layer testing. On the one hand, manually writing test cases requires looking up multiple tables such as signal matrices and PIN pins, which is time-consuming and prone to errors. On the other hand, it is difficult for humans to correctly and completely implement correction condition / decision coverage tests. Summary of the Invention

[0004] In view of the above-mentioned deficiencies of the prior art, the present invention provides a test case generation method and apparatus, electronic device, and storage medium to solve the technical problems of the prior art, such as inability to test time-consuming and labor-intensive tests, susceptibility to errors, and inability to complete the implementation of correction condition / decision coverage tests.

[0005] To achieve the above and other related objectives, the present invention provides a test case generation method, comprising: obtaining a natural language description of test requirements; processing the natural language description using a natural language processing model and preset rules to obtain several requirement points and the logical relationships between the requirement points; splitting the requirement points using the natural language processing model and a preset database to obtain a splitting result for each requirement point; and generating test cases based on the splitting results of the requirement points and the logical relationships between the requirement points.

[0006] In one embodiment of the present invention, the natural language description is processed using a natural language processing model and preset rules to obtain several requirement points and the logical relationships between the requirement points, including: using the natural language processing model to transform the natural language description to obtain a mathematical language description; and using the preset rules to process the mathematical language description to obtain several requirement points and the logical relationships between the requirement points.

[0007] In one embodiment of the present invention, the mathematical language description is processed using the preset rules to obtain several requirement points and the logical relationships between the requirement points, including: extracting several requirement points from the mathematical language description using the preset rules; assigning a number to each requirement point; and using the number to transform the mathematical language description into the logical relationships between the requirement points.

[0008] In one embodiment of the present invention, the demand points are split using the natural language processing model and a preset database to obtain a splitting result for each demand point, including: using the natural language processing model to initially split the demand points to obtain a first signal name; using the preset database to perform semantic matching based on the first signal name to obtain a preset number of second signal names and their corresponding values; and using the natural language processing model to further split the demand points, the preset number of second signal names, and their corresponding values ​​to obtain a splitting result for each demand point.

[0009] In one embodiment of the present invention, semantic matching is performed using the preset database based on the first signal name to obtain a preset number of second signal names and their corresponding values, including: converting the first signal name into a vector using a text retrieval model to represent its semantic features; loading vectors of all signal names from the preset database, wherein the vectors of all signal names are obtained by encoding all signal names in the preset database using the text retrieval model; calculating the similarity between the vector of the first signal name and the vectors of all signal names in the preset database; selecting a preset number of signal names most similar to the first signal name based on the similarity to obtain the second signal name; and obtaining the second signal name and its corresponding value based on the second signal name and the preset database.

[0010] In one embodiment of the present invention, test cases are generated based on the breakdown results of the requirement points and the logical relationships between the requirement points, including: obtaining positive and negative examples of test case forms for each requirement point based on the breakdown results of each requirement point; and generating the test cases based on the positive and negative examples of test case forms for each requirement point.

[0011] In one embodiment of the present invention, generating test cases based on positive and negative examples of test case format for each requirement point includes: incorporating positive and negative examples of test case format for each requirement point into a modified condition / decision coverage truth table to ensure that the independent impact of each condition is covered; and generating test cases based on the modified condition / decision coverage truth table.

[0012] To achieve the above and other related objectives, the present invention also provides a test case generation apparatus, comprising: a data acquisition unit for acquiring a natural language description of test requirements; a requirement rewriting unit for processing the natural language description using a natural language processing model and preset rules to obtain several requirement points and the logical relationships between the requirement points; a requirement splitting unit for splitting the requirement points using the natural language processing model and a preset database to obtain a splitting result for each requirement point; and a generation unit for generating test cases based on the splitting results of the requirement points and the logical relationships between the requirement points.

[0013] To achieve the above and other related objectives, the present invention also provides an electronic device, including a processor, a memory, and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the method provided in any of the above embodiments.

[0014] To achieve the above and other related objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, the computer program being used to cause a computer to perform the method provided in any of the above embodiments.

[0015] The beneficial effects of this invention are as follows: This invention proposes a test case generation method, device, electronic device, and storage medium. This method generates test cases efficiently, comprehensively, and automatically by taking the natural language requirements proposed by the user and using a natural language processing model, preset rules, and preset database. This not only significantly improves the efficiency of test engineers in writing test cases but also enhances the quality of test cases, further accelerating the automotive R&D process and ensuring the stability and safety of automotive systems. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 A flowchart of a test case generation method provided in an embodiment of the present invention;

[0018] Figure 2 A detailed flowchart of step S200 provided in an embodiment of the present invention;

[0019] Figure 3 A detailed flowchart of step S220 provided in an embodiment of the present invention;

[0020] Figure 4 A detailed flowchart of step S300 provided in an embodiment of the present invention;

[0021] Figure 5 A detailed flowchart of step S320 provided in an embodiment of the present invention;

[0022] Figure 6 A detailed flowchart of step S400 provided in an embodiment of the present invention;

[0023] Figure 7 A detailed flowchart of step S420 provided in an embodiment of the present invention;

[0024] Figure 8 This is a schematic diagram of a test case generation device provided in an embodiment of the present invention;

[0025] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0026] Explanation of reference numerals in the attached figures: 101, data acquisition unit; 102, requirement rewriting unit; 103, requirement splitting unit; 104, generation unit; 201, processor; 202, memory. Detailed Implementation

[0027] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. It should be noted that, unless otherwise specified, the following embodiments and features can be combined with each other. In addition to the specific methods, equipment, and materials used in the embodiments, based on the knowledge of the prior art and the description of the present invention by those skilled in the art, any prior art methods, equipment, and materials similar to or equivalent to those described in the embodiments of the present invention can be used to implement the present invention.

[0028] It should be understood that the terminology used in the embodiments of this invention is for describing specific particular implementations and not for limiting the scope of protection of this invention. Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art.

[0029] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In some embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.

[0030] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functions, and operations that may be implemented in the methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0031] Please see Figure 1 , Figure 1 A test case generation method provided in an embodiment of the present invention includes steps S100 to S400.

[0032] Step S100: Obtain the natural language description of the test requirements. Natural language refers to languages ​​that humans naturally form, develop, and widely use in daily life (such as Chinese, English, Spanish, etc.) for communication, expressing thoughts and emotions. Unlike artificial languages ​​(such as programming languages, mathematical symbols, and logical languages), natural language is flexible, ambiguous, and culturally dependent. In this invention, the natural language description of the test requirements is used as input, which reduces the requirements for engineers, eliminating the need for them to understand the format, specifications, etc., of the test requirements description.

[0033] Taking automotive systems as an example, a natural language description of test requirements could be something like, "When the key is in the ignition ON position, if the front wiper switch is in the OFF position, or if no front wiper return signal is detected, the BCM drives the wiper motor to rotate at low speed." This description does not restrict the format of the description, nor does it limit it to Chinese. Engineers only need to describe the test requirements using everyday language.

[0034] Step S200: Using a natural language processing model and preset rules, process the natural language description to obtain several requirement points and the logical relationships between them. This step is equivalent to formatting, extracting requirement points and the logical relationships between them from natural language descriptions of different specifications and formats to facilitate subsequent processing.

[0035] Please see Figure 2In a specific embodiment of the present invention, step S200 includes steps S210 and S220.

[0036] Step S210: Using a natural language processing model, the natural language description is transformed into a mathematical language description. This step involves converting the natural language description into a mathematical language description, which refers to the process of transforming the ambiguous and flexible language expressions used by humans in daily life into rigorous, precise, and unambiguous mathematical symbols, formulas, or logical expressions. The core purpose of this transformation is to eliminate ambiguity in natural language, making the description more suitable for logical reasoning or computer processing.

[0037] Continuing with the above natural language description as an example, after processing by the natural language processing model, its mathematical description could be, for example, "IF: Key is in ignition ON & (Front wiper switch is OFF | No front wiper return signal detected), Then: BCM drives wiper motor to rotate at low speed." In this embodiment, "Front wiper switch is OFF" and "No front wiper return signal detected" are related by "OR", so they are connected by the symbol "|"; the above two sub-requirements and "Key is in ignition ON" are related by "AND", so they are connected by the symbol "&"; the above three sub-requirements together form the condition, so they are placed in "IF"; "BCM drives wiper motor to rotate at low speed" is the output structure when the above condition is met, so it is placed in the result "Then". After the transformation, it can be clearly seen that the expression is clearer and more logical.

[0038] Step S220: Using preset rules, process the mathematical language description to obtain several requirement points and the logical relationships between them. The preset rules are predefined rules used to further transform the mathematical language description into more easily understood specific requirement points and the logical relationships between them.

[0039] Please see Figure 3 In a specific embodiment of the present invention, step S220 includes steps S221 to S223.

[0040] Step S221: Using preset rules, extract several requirement points from the mathematical language description. Preset rules can be understood as the definition rules for requirement points, that is, which expressions in the mathematical language description belong to requirement points. Again, using the above mathematical language description as an example, "key is in ignition ON," "front wiper switch is OFF," "no front wiper return signal detected," and "BCM drives wiper motor to rotate at low speed" are all requirement points.

[0041] Step S222: Assign a number to each requirement point. This step is mainly to simplify the representation of the logical relationship between requirement points. The number can be, for example, numbers, letters, etc.

[0042] Step S223: Using numbering, transform the mathematical language description into logical relationships between demand points. The transformed result of the above mathematical language description can be as follows:

[0043] IF: a&(b|c)

[0044] a. Key is in the ignition position (ON)

[0045] b. Front wiper switch is in the OFF position.

[0046] c. No front wiper return signal detected.

[0047] Then: d

[0048] d. The BCM drives the wiper motor to rotate at low speed.

[0049] As can be seen, after this step, the format of the test requirements has been standardized, and the logical relationship between each requirement and the requirements is clearly illustrated.

[0050] Step S300: Using a natural language processing model and a pre-set database, the requirement points are broken down to obtain the breakdown result for each requirement point. Although some formatting operations have been performed previously, these operations only standardize the test requirements in terms of format. For each requirement point, its content may not match the specific test content. Therefore, this step can be used to break down the requirement points.

[0051] Please see Figure 4In a specific embodiment of the present invention, step S300 includes steps S310 to S330. Since multiple requirement points have been listed above, the following will use "key is in ignition ON" as an example to describe the specific splitting process. The splitting of other requirement points follows the same strategy. The purpose of splitting is to break down the requirement points into "signal = state quantity" forms to facilitate the generation of subsequent test cases. Furthermore, the split "signal = state quantity" should match the content stored in the preset database. Thus, the requirement point will be split into a result that matches the preset database. For example, during specific testing, a test item might be "ignition key position = ON," which is stored in the preset database. The description of the requirement point obtained after steps S100 and S200 may not match the test item. For instance, in the above embodiment, the requirement point obtained is "key is in ignition ON." Although the tester can understand these two expressions, the present invention needs to achieve automatic test case generation, therefore the program also needs to understand it, hence the need to split the requirement point.

[0052] Step S310: Using a natural language processing model, the demand points are initially broken down to obtain the first signal name. For example, when "the key is in the ignition state ON", after initial breakdown, we can obtain "key = ON", where the signal quantity "key" on the left side of the equals sign is the first signal name.

[0053] Step S320: Based on the first signal name, perform semantic matching using a preset database to obtain a preset number of second signal names and their corresponding values. The purpose of this step is to find results similar to the first signal name.

[0054] Please see Figure 5 In a specific embodiment of the present invention, step S320 includes: S321, converting the first signal name into a vector using a text retrieval model to represent its semantic features; S322, loading the vectors of all signal names from a preset database, wherein the vectors of all signal names are obtained by encoding all signal names in the preset database using a text retrieval model; S323, calculating the similarity between the vector of the first signal name and the vectors of all signal names in the preset database; S324, selecting a preset number of signal names that are most similar to the first signal name based on the similarity to obtain the second signal name; S325, obtaining the second signal name and its corresponding value based on the second signal name and the preset database.

[0055] In this embodiment, the first signal name and all signal names in the preset database are first converted / encoded into vectors using the same tool, namely the text retrieval model. The similarity between the two is calculated from the vector dimension. During the calculation, a preset number of signal names with the highest similarity are selected. Then, the second signal name and its corresponding value are retrieved from the preset database.

[0056] In a specific embodiment of the present invention, a "signal matrix" table provided by the user, containing the Chinese name of the signal, the English abbreviation of the signal, the signal type, the signal value, and the initial value of the signal, can be pre-encoded using a BGE (BAAI General Embedding) model. The resulting table is the preset database, and the BGE model is a text retrieval model. For example, after calculating similarity and filtering, the aforementioned "key" can yield five signal quantities: ignition key position, Bluetooth key status, mechanical key lock cylinder signal, central locking / unlocking switch, and central locking / unlocking; thus, a second signal name is obtained, and their corresponding values ​​can then be found from the preset database.

[0057] Step S330: Using a natural language processing model, the demand point and a preset number of second signal names and their corresponding values ​​are further split to obtain the splitting result of each demand point. The five semaphores related to the original demand point (i.e., the key is in the ignition state ON) and their corresponding signal values ​​obtained in the previous step are used as reference information to feed into the natural language processing model, allowing the model to split the original demand point again based on this information. In this example, "the key is in the ignition state ON" is finally split into "ignition key position = ON".

[0058] Step S400: Generate test cases based on the breakdown of the requirements and the logical relationships between the requirements.

[0059] Please see Figure 6 In a specific embodiment of the present invention, step S400 includes steps S410 and S420.

[0060] Step S410: Based on the breakdown results of each requirement point, obtain positive and negative examples in the form of test cases for each requirement point. Taking the breakdown result "ignition key position = ON" as an example, the semaphore most similar to "ignition key position" matched in the preset database is "ignition key position". At the same time, we also obtain all the information of this semaphore, as shown in the table below.

[0061] Table 1: Contents related to ignition key position signals in the preset database

[0062]

[0063] For the Chinese name of the signal on the left side of the equals sign, we replace it with the corresponding English abbreviation. For the signal value on the right side of the equals sign, we use a large language model to find the value in the database that is most similar to the value on the right side of the requirement. In this example, the value most similar to "ON" is "2=ON", so we replace its corresponding number. This gives us the positive example of the test case for this requirement: "IgnKyPstn=2". Simultaneously, we only need to have the large language model find any value in the preset database that is dissimilar to the value on the right side of the requirement. In this example, for instance, we can find the value "1=ACC", which gives us the negative example of the test case for this requirement: "IgnKyPstn=1". For each other requirement, we can obtain positive and negative examples of the test case in the same way.

[0064] Step S420: Generate test cases based on positive and negative examples of the test case format for each requirement point.

[0065] Please see Figure 7 In a specific embodiment of the present invention, step S420 includes: S421, incorporating positive and negative examples in the form of test cases for each requirement point into the modified condition / decision coverage truth table to ensure that the independent impact of each condition is covered; S422, generating test cases based on the modified condition / decision coverage truth table.

[0066] Modified Condition Decision Coverage (MCDC) is a logical coverage criterion in software testing. It aims to ensure that all possible outcomes of decision points (such as if statements) are tested, and that each condition independently affects these outcomes. Specifically, it requires test cases to meet the following three conditions: (1) each condition has at least one true value and one false value in the decision outcome; (2) each decision outcome has at least one true value and one false value; and (3) each condition independently affects the decision outcome.

[0067] In this step, the mathematical logical relationship between each requirement point obtained earlier is first used, such as a&(b|c). Then, the corresponding MCDC truth table is obtained based on this logical relationship, as shown below.

[0068] Table 2: Examples of MCDC Truth Value Representations

[0069] Test Case a b c d(result) 1 T T F T 2 F T F F 3 T F F F 4 T F T T

[0070] In the table above, each row corresponds to a test case. a, b, and c correspond to each sub-requirement in the IF condition, and d(result) corresponds to the output in Then. T represents a positive example of the test case format for the required requirement obtained above; F represents a negative example of the test case format for the required requirement obtained above. With this table, simply substitute the positive and negative examples of the test case format for the required requirement into the truth table to obtain the final generated test cases. The test cases generated based on the truth table are shown below.

[0071]

Test Case 1

[0072] Test steps: a(T)&b(T)&c(F)

[0073] a(T).IgnKyPstn=2

[0074] b(T).FrnWprSwtStal=0

[0075] c(F).IDL32=0

[0076] Expected result: d(T)

[0077] d(T).WindscenWipSt=1.

[0078]

Test Case 2

[0079] Test steps: a(F)&b(T)&c(F)

[0080] a(F).IgnKyPstn=1

[0081] b(T).FrnWprSwtStal=0

[0082] c(F).IDL32=0

[0083] Expected result: d(F)

[0084] d(F).WindscenWipSt=0x0.

[0085]

Test Case 3

[0086] Test steps: a(T)&b(F)&c(F)

[0087] a(T).IgnKyPstn=2

[0088] b(F).FrnWprSwtStal=1

[0089] c(F).IDL32=0

[0090] Expected result: d(F)

[0091] d(F).WindscenWipSt=0x0.

[0092]

Test Case 4

[0093] Test steps: a(T)&b(F)&c(T)

[0094] a(T).IgnKyPstn=2

[0095] b(F).FrnWprSwtStal=1

[0096] c(T).IDL32=12

[0097] Expected result: d(T)

[0098] d(T).WindscenWipSt=1.

[0099] It should be noted that the steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they contain the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.

[0100] Please see Figure 8 , Figure 8 A test case generation device provided in one embodiment of the present invention includes a data acquisition unit 101, a requirement rewriting unit 102, a requirement splitting unit 103, and a generation unit 104. The data acquisition unit 101 acquires a natural language description of the test requirements; the requirement rewriting unit 102 processes the natural language description using a natural language processing model and preset rules to obtain several requirement points and the logical relationships between them; the requirement splitting unit 103 splits the requirement points using a natural language processing model and a preset database to obtain the splitting result for each requirement point; and the generation unit 104 generates test cases based on the splitting results of the requirement points and the logical relationships between them.

[0101] It should be noted that the test case generation device in this embodiment corresponds to the test case generation method described above, and the functional modules in the test case generation device correspond to the corresponding steps in the test case generation method. The test case generation device in this embodiment can be implemented in conjunction with the test case generation method; that is, where there is no conflict, the relevant technical details mentioned in the test case generation method of the above embodiments can also be applied to the test case generation device in this embodiment.

[0102] Please see Figure 9 , Figure 9 An electronic device provided in one embodiment of the present invention includes a processor 201, a memory 202, and a communication bus; the communication bus is used to connect the processor 201 and the memory 202; the processor 201 is used to execute a computer program stored in the memory 202 to implement the above-described test case generation method.

[0103] The aforementioned electronic device is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0104] The aforementioned electronic devices can be any electronic product capable of human-computer interaction with users, such as personal computers, tablets, smartphones, personal digital assistants (PDAs), game consoles, interactive network television (IPTV), smart wearable devices, etc.

[0105] The aforementioned electronic devices may also include network devices and / or user devices. The network devices include, but are not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of hosts or network servers.

[0106] The networks in which the aforementioned electronic devices are located include, but are not limited to, the Internet, wide area networks, metropolitan area networks, local area networks, and virtual private networks (VPNs).

[0107] The processors mentioned above can be, for example, general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components; the memory mentioned above may include random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device.

[0108] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, the computer program being used to cause a computer to execute the above-described test case generation method.

[0109] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. A test case generation method, characterized in that, include: Obtain a natural language description of the testing requirements; The natural language description is processed using a natural language processing model and preset rules to obtain several requirement points and the logical relationships between the requirement points. Using the natural language processing model and the preset database, the demand points are split to obtain the splitting result of each demand point; Test cases are generated based on the breakdown of the requirements and the logical relationships between them.

2. The test case generation method according to claim 1, characterized in that, Using a natural language processing model and preset rules, the natural language description is processed to obtain several requirement points and the logical relationships between these requirement points, including: The natural language description is transformed using the natural language processing model to obtain a mathematical language description; The mathematical language description is processed using the preset rules to obtain several requirement points and the logical relationships between them.

3. The test case generation method according to claim 2, characterized in that, Using the preset rules, the mathematical language description is processed to obtain several requirement points and the logical relationships between the requirement points, including: Using the preset rules, several of the required points are extracted from the mathematical language description; Assign a number to each of the aforementioned requirements; Using the numbering, the mathematical language description is transformed into a logical relationship between the demand points.

4. The test case generation method according to claim 1, characterized in that, Using the natural language processing model and the preset database, the demand points are segmented to obtain the segmentation result for each demand point, including: Using the natural language processing model, the demand points are initially segmented to obtain the first signal name; Based on the first signal name, semantic matching is performed using the preset database to obtain a preset number of second signal names and their corresponding values; Using the natural language processing model, the demand point, a preset number of second signal names and their corresponding values ​​are further split to obtain the splitting result of each demand point.

5. The test case generation method according to claim 4, characterized in that, Based on the first signal name, semantic matching is performed using the preset database to obtain a preset number of second signal names and their corresponding values, including: The first signal name is converted into a vector using a text retrieval model to represent its semantic features; The vectors of all signal names are loaded from the preset database, wherein the vectors of all signal names are obtained by encoding all signal names in the preset database through the text retrieval model; Calculate the similarity between the vector of the first signal name and the vectors of all signal names in the preset database; Based on the similarity, a preset number of signal names that are most similar to the first signal name are selected to obtain the second signal name; Based on the second signal name and the preset database, the second signal name and its corresponding value are obtained.

6. The test case generation method according to claim 1, characterized in that, Based on the breakdown of the requirements and the logical relationships between them, test cases are generated, including: Based on the breakdown results of each requirement point, positive and negative examples in the form of test cases for each requirement point are obtained; The test cases are generated based on positive and negative examples of the test case format for each requirement point.

7. The test case generation method according to claim 6, characterized in that, Based on positive and negative examples of the test case format for each of the aforementioned requirements, generate the test cases, including: Positive and negative examples in the form of test cases for each of the aforementioned requirements are incorporated into the revised condition / decision coverage truth table to ensure that the independent impact of each condition is covered; The test cases are generated based on the modified condition / decision coverage truth table.

8. A test case generation device, characterized in that, include: The data acquisition unit is used to acquire natural language descriptions of the test requirements; The requirement rewriting unit is used to process the natural language description using a natural language processing model and preset rules to obtain several requirement points and the logical relationships between the requirement points. The requirement segmentation unit uses the natural language processing model and the preset database to segment the requirement points and obtain the segmentation result for each requirement point. as well as The generation unit is used to generate test cases based on the breakdown results of the requirement points and the logical relationships between the requirement points.

9. An electronic device, characterized in that, It includes a processor, a memory, and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program thereon, the computer program being used to cause the computer to perform the method as described in any one of claims 1 to 7.