A test case precondition intelligent modification method, device, equipment and medium

By automating the determination of test case module levels and synchronizing test case sets, the problem of low efficiency in modifying preconditions in software testing is solved, achieving efficient and automated precondition synchronization and improving the efficiency and consistency of test case modification.

CN117215949BActive Publication Date: 2026-11-03INSPUR NETWORK TECH (SHANDONG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311243476.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2026-11-03
Estimated Expiration
2043-09-22

AI Technical Summary

Technical Problem

In existing technologies, modifying the preconditions of software test cases is inefficient and prone to omissions or errors, especially at the module level where manual modifications are required one by one, leading to low efficiency.

Method used

By determining the test case module level of the test case to be modified, and using a preset query algorithm and test database, the test case module level and synchronous test case set are processed automatically to achieve intelligent modification of preconditions.

Benefits of technology

It improves the efficiency of modifying the preconditions of test software cases, reduces manual operations, avoids omissions and errors, and improves the accuracy and efficiency of modifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117215949B_ABST
    Figure CN117215949B_ABST
Patent Text Reader

Abstract

The application discloses a test case precondition intelligent modification method, device, equipment and medium, and belongs to the technical field of test case management. The method comprises the following steps: determining a to-be-modified case in a test platform, and modifying the precondition of the to-be-modified case to obtain a modified case and a modified precondition; wherein the test platform comprises a plurality of module levels, the module levels comprise a case module level and a plurality of module levels, and the case module level is a module level comprising a plurality of cases; the precondition is compared with the modified precondition to determine the case module level of the to-be-modified case; wherein the case module level is a module level comprising a plurality of cases; the case module level and a preset test database are processed based on a preset query algorithm to determine a synchronous case set; wherein the test database comprises a case database and a module database; and the preconditions of all cases in the synchronous case set are modified to the modified precondition. The modification efficiency of the test software case is improved by the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of test case management, and in particular to a method, apparatus, device, and medium for intelligent modification of test case preconditions. Background Technology

[0002] In current software testing, testing is often conducted on a module-by-module basis. When testing various functional points within the same module, the environment configuration items for each functional point within the module are common. This part of the environment configuration is called the preconditions.

[0003] In existing technologies, because preconditions exist in each use case, modifying the preconditions of only one use case leaves the preconditions of other use cases within the same module level unchanged, leading to discrepancies between preconditions of use cases within the same module level. Changing the preconditions of other use cases within the same module level requires manual modification, resulting in repetitive and meaningless work, inefficiency, and a high risk of omissions and errors. Furthermore, when the use case structure changes, each changed use case needs to be recorded, and its preconditions modified individually, a process that is both inefficient and cumbersome.

[0004] Therefore, improving the efficiency of modifying test cases for software has become an urgent problem to be solved. Summary of the Invention

[0005] This application provides a method, apparatus, device, and medium for intelligent modification of test case preconditions, in order to solve the following technical problem: how to improve the efficiency of modifying the preconditions of test cases for software under test.

[0006] In a first aspect, embodiments of this application provide a method for intelligent modification of test case preconditions, characterized in that the method includes: determining test cases to be modified in a test platform, and modifying the preconditions of the test cases to be modified to obtain the modified test cases and the modified preconditions; wherein, the test platform includes multiple module levels, the module levels including test case module levels and multi-level module levels; comparing the preconditions and the modified preconditions to determine the test case module level of the test cases to be modified; wherein, the test case module level is a module level including multiple test cases; processing the test case module level and a preset test database based on a preset query algorithm to determine a synchronized test case set; wherein, the test database includes a test case database and a module database; and modifying the preconditions of all test cases in the synchronized test case set to the modified preconditions.

[0007] In one implementation of this application, comparing the preconditions and the modified preconditions to determine the use case module level of the use case to be modified specifically includes: extracting the text of the preconditions and converting it into first standard precondition text; extracting the text of the modified preconditions and converting it into second standard precondition text; retrieving the first standard precondition text and the second standard precondition text according to preset search terms to obtain a first detection set and a second detection set; wherein the first detection set and the second detection set are sets containing information about the module level; comparing the first detection set and the second detection set to determine the modification scope; wherein the modification scope is the modification of the preconditions relative to the information about the module level of the preconditions; and determining the use case module level of the use case to be modified based on the modification scope.

[0008] In one implementation of this application, the text of the preconditions is extracted and converted into first standard precondition text, and the text of the modified preconditions is extracted and converted into second standard precondition text. Specifically, this includes: extracting the text of the preconditions and extracting a first module-level segment; wherein, the module-level segment is the field related to the module level in the text of the modified preconditions; extracting the text of the modified preconditions and extracting a second module-level segment; arranging the first module-level segments in the order of acquisition to obtain the first standard precondition text; and arranging the second module-level segments in the order of acquisition to obtain the second standard precondition text.

[0009] In one implementation of this application, comparing a first set to be tested and a second set to be tested to determine the scope of modification specifically includes: selecting a first module-level segment in the first set to be tested in chronological order and comparing it with all second module-level segments in the second set to be tested until all first module-level segments in the first set to be tested have been selected to obtain a comparison result; determining the information of the module-level segments added to the second set to be tested and the information of the module-level segments deleted from the first set to be tested based on the comparison result; and determining the use case module level of the use case to be modified based on the information of the module-level segments added to the second set to be tested and the information of the module-level segments deleted from the first set to be tested.

[0010] In one implementation of this application, a set of synchronized test cases is determined by processing the test case module level and a preset test database based on a preset query algorithm. Specifically, this includes: obtaining the test case database and module database of the test database; wherein, the test case database is a database that records information about all test cases of the test platform, and the module database is a database that records information about all module levels of the test platform; and processing the test case database and module database based on the test cases to be modified to determine the set of synchronized test cases.

[0011] In one implementation of this application, a set of synchronized use cases is determined based on a database of use cases to be modified and a module database. Specifically, this includes: comparing the module database with the use case module hierarchy to obtain a set of use case module hierarchies that have relationships; retrieving all use cases under the use case module hierarchies to obtain a preliminary set of synchronized use cases; and comparing the preliminary set of synchronized use cases with the use case database to obtain a complete set of synchronized use cases.

[0012] In one implementation of this application, the preconditions of all test cases in the synchronous test case set are modified to change the preconditions. Specifically, this includes: adding modified preconditions to the synchronous test case set; generating a first number of modified precondition files based on the number of test cases in the synchronous test case set; wherein the first number is the number of test cases in the synchronous test case set to be modified; matching the modified precondition files with the test cases in the synchronous test case set and deleting the preconditions of the test cases in the synchronous test case set.

[0013] Secondly, this application also provides an intelligent modification device for test case preconditions, characterized in that the device includes a modification module, a format conversion module, a query module, and a replacement module, specifically including: the modification module is used to determine the test cases to be modified in the test platform and modify the preconditions of the test cases to be modified, so as to obtain the modified test cases and the modified preconditions; wherein, the test platform includes multiple module levels, including test case module levels and multi-level module levels; the format conversion module is used to determine the test case module level of the test cases to be modified based on the modified preconditions; wherein, the test case module level is a module level including multiple test cases; the query module is used to determine the test case module level of the test cases to be modified based on the modified preconditions; wherein, the test case module level is a module level including multiple test cases; the replacement module is used to modify the preconditions of all test cases in the synchronized test case set to the modified preconditions.

[0014] Thirdly, embodiments of this application also provide a test case precondition intelligent modification device, characterized in that the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: determine the test case to be modified in a test platform, and modify the preconditions of the test case to be modified, thereby obtaining the modified test case and the modified preconditions; wherein the test platform includes multiple module levels, the module levels including a test case module level and a multi-level module level; compare the preconditions and the modified preconditions to determine the test case module level of the test case to be modified; wherein the test case module level is a module level including multiple test cases; process the test case module level and a preset test database based on a preset query algorithm to determine a synchronized test case set; wherein the test database includes a test case database and a module database; modify the preconditions of all test cases in the synchronized test case set to modified preconditions.

[0015] Fourthly, embodiments of this application also provide a non-volatile computer storage medium for intelligent modification of test case preconditions, storing computer-executable instructions. The computer-executable instructions are characterized by: determining a test case to be modified in a test platform and modifying the preconditions of the test case to obtain the modified test case and the modified preconditions; wherein the test platform includes multiple module levels, including a test case module level and a multi-level module level; comparing the preconditions and the modified preconditions to determine the test case module level of the test case to be modified; wherein the test case module level includes multiple test cases; processing the test case module level and a preset test database based on a preset query algorithm to determine a synchronized test case set; wherein the test database includes a test case database and a module database; and modifying the preconditions of all test cases in the synchronized test case set to the modified preconditions.

[0016] This application provides a method, apparatus, device, and medium for intelligent modification of test case preconditions. By identifying the test case whose preconditions need modification, and comparing the modified preconditions with the existing preconditions, the corresponding test case module level is obtained, thus determining the scope of modification. Based on the test case to be modified, the test case module level, and the test database, other test case module levels associated with the test case to be modified, as well as test cases with the same preconditions, are obtained, thus acquiring a synchronized test case set. The preconditions of all test cases in the synchronized test case set are modified to the modified preconditions, thereby synchronously modifying all test cases with the same preconditions, thus improving the efficiency of test case modification. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 A flowchart of a method for intelligently modifying test case preconditions provided in an embodiment of this application;

[0019] Figure 2 A schematic diagram of a test case precondition intelligent modification device provided in an embodiment of this application;

[0020] Figure 3 This is a schematic diagram of the internal structure of a device that intelligently modifies the preconditions for test cases, as provided in an embodiment of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] This application provides a method, apparatus, device, and medium for intelligent modification of test case preconditions, in order to solve the following technical problem: how to improve the efficiency of modifying the preconditions of test cases for software under test.

[0023] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0024] Figure 1 This document provides a flowchart for intelligent modification of test case preconditions in an embodiment of this application. Figure 1 As shown in the figure, the intelligent modification method for test case preconditions provided in this application embodiment specifically includes the following steps:

[0025] Step 1: Identify the test cases to be modified in the test platform and modify the preconditions of the test cases to obtain the test cases to be modified and the preconditions to be modified.

[0026] The test case to be modified refers to the test case that needs to be modified. In this embodiment, the test case to be modified refers to the test case whose preconditions need to be modified. A test case includes a brief description of its name, event flow, relationship, activity diagram, state diagram, use case diagram, special requirements, preconditions, and postconditions. During software testing, if the preconditions of a test case need to be modified due to changes in testing requirements, the test case to be modified is determined based on these changes.

[0027] The testing platform includes a test case library and a test database. The test case library stores module levels, and each module level has at least one module level or at least one test case. The smallest unit in the test case library is a "test case", and each test case includes the update time of the preconditions and the information of the preconditions.

[0028] In specific examples, if module level 'a' exists, then module levels 'b' and 'c' may exist under module level 'a'. If module level 'd' exists, then module level 'd' includes use cases 'e', ​​'f', and 'g'. In the above examples, module level 'b' can be either a use case or a new module level.

[0029] Step 2: Compare the preconditions and the modified preconditions to determine the use case module level of the use case to be modified.

[0030] After identifying the use case to be modified with altered preconditions, i.e., after identifying the use case and the altered preconditions, the text of the preconditions is extracted and converted into the first standard precondition text, and the text of the altered preconditions is extracted and converted into the second standard precondition text.

[0031] To some extent, the format of modifying preconditions differs from that of the original preconditions. Therefore, to compare modifying preconditions and maintaining variable consistency, both preconditions and modifying preconditions are converted to the same format, namely, into standard precondition text. Specifically, preconditions are converted to the first standard precondition text, and modified preconditions are converted to the second standard precondition text.

[0032] Specifically, this involves extracting the text of the preconditions, extracting the first module-level segment, extracting the text of the modified preconditions, and extracting the second module-level segment. The module-level segment is a field or text related to the module level, such as "speech recognition module" or "speech shutdown module." These fields or paragraphs are extracted as either the first or second module-level segment.

[0033] The first module-level segments are arranged in the order of acquisition to obtain the first standard pre-text. The second module-level segments are arranged in the order of acquisition to obtain the second standard pre-text. Because the pre-text is read and extracted or modified sequentially, arranging the first or second module-level segments in the order of acquisition ensures the standardization of the standard pre-text to a certain extent.

[0034] The first and second standard pre-condition texts are retrieved based on preset search terms to obtain a first and a second set of conditions to be tested. These sets contain information about module levels. The first and second sets are compared to determine the scope of modification. The scope of modification refers to changes made to the pre-conditions regarding module-level information compared to the pre-conditions.

[0035] After obtaining the first and second test sets, they are compared to determine the use case module level for which preconditions need modification. In a specific example, first module level segments within the first test set are selected chronologically and compared with all second module level segments within the second test set until all first module level segments in the first test set have been selected to obtain the comparison results. Based on the comparison results, information on added module levels in the second test set and deleted module levels in the first test set are determined. Based on the information on added and deleted module levels in the second and first test sets, the use case module level for the test case to be modified is determined.

[0036] The module level of the test case to be modified is determined based on the scope of modification. Once the scope of modification is obtained, it becomes clear which module levels of information have been added or removed from the preconditions compared to the original preconditions. This information corresponds to the module level of the preconditions that need to be modified.

[0037] For example, the preconditions state: This method is built into the speech recognition module and the speech shutdown module to identify noise in speech recognition, with a noise setting of 50.

[0038] The preconditions are modified as follows: This method is built in the speech recognition module and the speech acquisition module to identify speech noise, with a noise setting of 45.

[0039] If the preconditions are modified by adding a voice acquisition module and removing the voice shutdown module, then the preconditions of the use case modules corresponding to the voice acquisition module and the voice shutdown module need to be modified.

[0040] It should be noted that all test cases within the test case module level where the test case to be modified is located will have their preconditions modified. This step is used to obtain the preconditions of test cases in module levels other than the test case module level where the test case to be modified is located.

[0041] Understandably, operators can manually select the hierarchical module that needs to be modified. That is, if the preconditions of use case a need to be modified, and the operator wants to synchronize the preconditions of all use cases under hierarchical b based on the modified preconditions of use case a, then the operator can directly select hierarchical b, thus confirming that hierarchical b is the use case hierarchical module.

[0042] Step 3: Process the test case module level and the preset test database based on the preset query algorithm to determine the set of synchronous test cases.

[0043] The query algorithm is used to determine the set of synchronous test cases based on the test database and the test case module hierarchy. The specific algorithm is shown in steps 31 to 34.

[0044] Step 31: Obtain the test case database and module database of the test database.

[0045] The test case database is a database that records information about all test cases in the test platform. In a specific example, the test case database stores the module level identifier information to which the test case belongs, as well as the parent identifier information of that module level identifier. The module database is a database that records information about the module levels of the test platform. In a specific instance, the module database stores the relationships between the various module levels. Both the test case database and the module database are stored in the test database and can be accessed directly.

[0046] Step 32: Compare the module database according to the use case module hierarchy to obtain the set of use case module hierarchy that have a relationship.

[0047] As shown in step 31, the module database stores the relationships between various module levels. Therefore, based on the determined use case module level, the module database can be queried to obtain the module levels associated with the determined use case module level. The use case module level set consists of at least one module level associated with the determined use case module level, because the lower levels of these module levels are all use cases, hence the term "use case module level."

[0048] Step 33: Retrieve all use cases under the use case module hierarchy set to obtain a preliminary synchronized use case set.

[0049] Retrieve the test case module hierarchy set, and retrieve the test cases from all test case module levels within the test case module hierarchy set to construct a preliminary synchronized test case set.

[0050] Step 34: Compare the preliminary synchronization test case set with the test case database to obtain the synchronization test case set.

[0051] In the initial synchronized test case set, the test cases may have special requirements, such as a fixed test environment. Therefore, it is necessary to filter through the test case database to obtain the synchronized test case set.

[0052] The synchronized test case set can be obtained by comparing the preliminary synchronized test case set with the test case database.

[0053] Step 4: Modify the preconditions of all test cases in the synchronization test case set to "Modify preconditions".

[0054] Once the set of synchronous test cases is determined, the preconditions of all test cases in the set can be modified to change the preconditions.

[0055] Specifically, this involves adding and modifying preconditions to the synchronized test case set, then generating a first set of modified precondition files based on the number of test cases in the synchronized test case set. The first set of modified precondition files then replaces the files corresponding to the preconditions with the modified precondition files.

[0056] Modify the preconditions file to match the test cases in the synchronous test case set and delete the preconditions of the test cases in the synchronous test case set.

[0057] The synchronous test case set in the above process does not include the test case to be tested or the modified test case.

[0058] When the synchronized test case set includes the modified test case, the precondition with the shortest time interval can be determined based on the update time of the precondition recorded in the test case. This precondition is the modified precondition. Then, the modified precondition is copied to generate a first number of modified precondition files. The modified precondition files are matched with the test cases in the synchronized test case set, and the preconditions of the test cases in the synchronized test case set are deleted.

[0059] It should be noted that, since the use case library is the smallest unit and the upper level of the use case is the use case module level, even if the structure of the module level changes several times or the entire use case library changes, it will not affect the use cases. Therefore, changes to the module level or the use case library will not affect the use of the application implementation.

[0060] The above are embodiments of the method proposed in this application. Based on the same inventive concept, embodiments of this application also provide a device for intelligent modification of test case preconditions. Figure 2 The test case preconditions provided in this application embodiment can only be modified by a device, such as... Figure 2 As shown.

[0061] The modification module identifies test cases to be modified in the test platform and modifies their preconditions to obtain the modified test cases and their preconditions. The test platform comprises multiple module levels, including test case module levels and multi-level module levels. The format conversion module determines the test case module level of the test cases to be modified based on the modified preconditions. The test case module level is a module level containing multiple test cases. The query module determines the test case module level of the test cases to be modified based on the modified preconditions. The test case module level is a module level containing multiple test cases. The replacement module modifies the preconditions of all test cases in the synchronized test case set to the modified preconditions.

[0062] The above are embodiments of the method proposed in this application. Based on the same inventive concept, embodiments of this application also provide an intelligent modification device for test case preconditions, the structure of which is as follows: Figure 3 As shown.

[0063] Figure 3 This is a schematic diagram of the internal structure of a device that intelligently modifies test case preconditions, as provided in an embodiment of this application. Figure 3As shown, the device includes: at least one processor 301 and a memory 302 communicatively connected to the at least one processor. The memory 302 stores instructions executable by the at least one processor 301, which, when executed, enable the at least one processor 301 to: determine the test cases to be modified in a test platform and modify the preconditions of the test cases to obtain modified test cases and modified preconditions. The test platform includes multiple module levels, including test case module levels and multi-level module levels. The preconditions and modified preconditions are compared to determine the test case module level of the test case to be modified. The test case module level includes multiple test cases. The test case module level and a preset test database are processed based on a preset query algorithm to determine a synchronized test case set. The test database includes a test case database and a module database. The preconditions of all test cases in the synchronized test case set are modified to the modified preconditions.

[0064] Some embodiments of this application provide corresponding to Figure 1 A non-volatile computer storage medium for intelligent modification of test case preconditions stores computer-executable instructions. These instructions are configured to: determine the test case to be modified in a test platform and modify its preconditions to obtain the modified test case and its modified preconditions. The test platform includes multiple module levels, including a test case module level and a multi-level module level. The preconditions and the modified preconditions are compared to determine the test case module level of the test case to be modified. The test case module level comprises multiple test cases. A preset query algorithm processes the test case module level and a preset test database to determine a synchronized test case set. The test database includes a test case database and a module database. The preconditions of all test cases in the synchronized test case set are modified to the modified preconditions.

[0065] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for IoT devices and media are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0066] The systems, media, and methods provided in this application are one-to-one correspondences. Therefore, the systems and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and media will not be repeated here.

[0067] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0068] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0069] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0070] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0071] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0072] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0073] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0074] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0075] The above are merely embodiments of this application and are not intended to limit the scope of 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 scope of the claims of this application.

Claims

1. A method for intelligently modifying preconditions for test cases, characterized in that, The method includes: Identify the test cases to be modified in the test platform, and modify the preconditions of the test cases to be modified in order to obtain the modified test cases and the modified preconditions; wherein, the test platform includes multiple module levels, including test case module levels and multi-level module levels; By comparing the preconditions and the modified preconditions, the use case module level of the use case to be modified is determined; wherein, the use case module level is a module level that includes multiple use cases; The test case module hierarchy and the preset test database are processed based on a preset query algorithm to determine the synchronous test case set; wherein, the test database includes a test case database and a module database; Modify the preconditions of all use cases in the synchronous use case set to the modified preconditions; The process of comparing the preconditions and the modified preconditions to determine the use case module level of the use case to be modified includes: extracting the text of the preconditions and converting it into first standard precondition text; extracting the text of the modified preconditions and converting it into second standard precondition text; retrieving the first standard precondition text and the second standard precondition text according to preset search terms to obtain a first detection set and a second detection set; wherein the first detection set and the second detection set are sets containing information about the module level; comparing the first detection set and the second detection set to determine the modification range; wherein the modification range is the modification of the modified preconditions relative to the information about the module level of the preconditions; and determining the use case module level of the use case to be modified based on the modification range. Extracting the text of the preconditions and converting it into first standard precondition text, and extracting the text of the modified preconditions and converting it into second standard precondition text, specifically includes: extracting the text of the preconditions and extracting a first module-level segment; wherein, the module-level segment is a field related to the module level in the text of the modified preconditions; extracting the text of the modified preconditions and extracting a second module-level segment; arranging the first module-level segments in the order of acquisition to obtain the first standard precondition text; and arranging the second module-level segments in the order of acquisition to obtain the second standard precondition text.

2. The intelligent modification method for test case preconditions according to claim 1, characterized in that, The first and second sets to be detected are compared to determine the scope of modification, specifically including: The first module-level segments in the first set to be detected are selected in chronological order and compared with all second module-level segments in the second set to be detected until all first module-level segments in the first set to be detected are selected to obtain the comparison results. Based on the comparison results, determine the information of the module levels added to the second set to be detected, and determine the information of the module levels deleted from the first set to be detected; Based on the information of the module levels added to the second set to be tested and the information of the module levels deleted from the first set to be tested, the use case module level of the use case to be modified is determined.

3. The intelligent modification method for test case preconditions according to claim 1, characterized in that, The test case module hierarchy and the preset test database are processed based on a preset query algorithm to determine the set of synchronized test cases, specifically including: Obtain the test case database and module database of the test database; wherein, the test case database is a database that records information on all test cases of the test platform, and the module database is a database that records information on all module levels of the test platform; Based on the use cases to be modified, process the use case database and module database to determine the set of use cases to be synchronized.

4. The intelligent modification method for test case preconditions according to claim 3, characterized in that, Based on the use cases to be modified, the use case database and module database are processed to determine the set of synchronized use cases, specifically including: The module database is compared with the use case module hierarchy to obtain a set of use case module hierarchy that have a relationship; Retrieve all use cases under the aforementioned use case module hierarchy set to obtain a preliminary synchronized use case set; The synchronization use case set is obtained by comparing the preliminary synchronization use case set with the use case database.

5. The intelligent modification method for test case preconditions according to claim 1, characterized in that, Modify the preconditions of all use cases in the synchronization use case set to the modified preconditions, specifically including: Add the modified preconditions to the synchronization test case set; A first number of modified precondition files are generated based on the number of test cases in the synchronization test case set; wherein, the first number is the number of test cases in the synchronization test case set; The modified precondition file is matched with the test cases in the synchronization test case set, and the preconditions of the test cases in the synchronization test case set are deleted.

6. A device for intelligently modifying preconditions for test cases, characterized in that, The device includes a modification module, a format conversion module, a query module, and a replacement module, specifically including: The modification module is used to determine the test cases to be modified in the test platform and modify the preconditions of the test cases to be modified in order to obtain the modified test cases and the modified preconditions; wherein, the test platform includes multiple module levels, including test case module levels and multi-level module levels; The format conversion module is used to determine the use case module level of the use case to be modified based on the modified preconditions; wherein, the use case module level is a module level that includes multiple use cases; The query module is used to process the use case module hierarchy and the preset test database based on a preset query algorithm to determine the synchronous use case set; wherein, the test database includes a use case database and a module database; The replacement module is used to modify the preconditions of all use cases in the synchronous use case set to the modified preconditions. Determining the use case module level of the use case to be modified based on the modified preconditions specifically includes: extracting the text of the preconditions and converting it into a first standard precondition text; extracting the text of the modified preconditions and converting it into a second standard precondition text; retrieving the first standard precondition text and the second standard precondition text according to preset search terms to obtain a first detection set and a second detection set; wherein the first detection set and the second detection set are sets containing information about the module level; comparing the first detection set and the second detection set to determine the modification range; wherein the modification range is the modification of the preconditions relative to the information about the module level of the preconditions; and determining the use case module level of the use case to be modified based on the modification range. Extracting the text of the preconditions and converting it into first standard precondition text, and extracting the text of the modified preconditions and converting it into second standard precondition text, specifically includes: extracting the text of the preconditions and extracting a first module-level segment; wherein, the module-level segment is a field related to the module level in the text of the modified preconditions; extracting the text of the modified preconditions and extracting a second module-level segment; arranging the first module-level segments in the order of acquisition to obtain the first standard precondition text; and arranging the second module-level segments in the order of acquisition to obtain the second standard precondition text.

7. A device for intelligently modifying preconditions for test cases, characterized in that, The device includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform a test case precondition intelligent modification method as described in any one of claims 1-5.

8. A non-volatile computer storage medium for intelligent modification of test case preconditions, storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed, the method for intelligent modification of test case preconditions as described in any one of claims 1-5 is implemented.

Citation Information

Patent Citations

  • Guiding type function safety testing method and device of vehicle

    CN116296447A

  • Method for realizing test exemple automation operation

    CN1987817A