A test case loading method, an electronic device, and a storage medium

By establishing associated files and index files, and using grouping numbering and dynamic loading of test cases, the problems of low loading efficiency and large memory consumption of coverage databases were solved, achieving more efficient memory usage and loading speed.

CN121029273BActive Publication Date: 2026-02-10SHANGHAI UNIVISTA IND SOFTWARE GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511564756.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-10
Estimated Expiration
2045-10-30

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency and excessive memory consumption when loading coverage databases due to large data volumes, and cannot effectively solve this problem.

Method used

By establishing associated files and index files, and using grouping numbering and dynamic loading of test cases, the size of associated files is reduced. Furthermore, test cases are located through lightweight index files and line number queries, thereby reducing memory usage and improving loading efficiency.

Benefits of technology

It significantly reduced memory usage, improved the loading efficiency of the coverage database, and solved the problems of slow loading and high memory consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121029273B_ABST
    Figure CN121029273B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electronic design automation, in particular to a test case loading method, an electronic device and a storage medium, which establishes an association file and an index file, each line in the association file includes a test group number list of all coverage items under a coverage domain, the index file is indexed by an N-level index key and a line number, the index file is loaded into the memory, the line number where the coverage object is located is quickly obtained by querying the index file according to the user's query request, and the test group number associated with the coverage object is obtained by querying the association file according to the line number, and then the test case list is obtained. By loading the lightweight index file, the query speed and the query efficiency are improved, and the problems of slow loading and large memory occupation are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electronic design automation, in particular to a test case loading method, an electronic device and a storage medium. BACKGROUND

[0002] In the design and implementation of coverage function, it is necessary to establish and maintain the mapping relationship between the coverage objects in the code under test and the test cases covering them. The current implementation is to obtain all test cases covering each coverage object, for example, for line coverage, all test cases covering the first executable line include test1, test2 and test3, all test cases covering the second executable line include test2, test3 and test4, and so on. After obtaining all test cases covering each coverage object, the association relationship between the coverage objects and the test cases covering them is established. The association relationship between the coverage objects and the test cases is loaded into the memory at one time when the coverage database is loaded. When the total number of coverage objects is N and the total number of test cases is M, the amount of data loaded is the product of N and M. Since the user design is generally millions of lines, the corresponding test cases may also be tens of thousands of levels, at this time the amount of data loaded at one time will be very large, which will lead to low efficiency of loading the coverage database and large memory occupation. Therefore, a method is needed to improve the loading efficiency while reducing the memory occupation. SUMMARY

[0003] In view of the above technical problems, the technical solution adopted by the present application is as follows: a test case loading method, the method comprising the following steps:

[0004] S100, an association file is established, the association file includes multiple lines of data, each line of data includes a test group number list of all coverage items under a coverage domain, and each coverage item corresponds to a test group number.

[0005] S200, U index files are established according to the association file, U is greater than or equal to 1; the index file includes multiple index mapping relationships, each index mapping relationship includes an N-level index key and a line number of the test group number list corresponding to each coverage domain in the association file, wherein the N-level index key includes a unique identifier of an instance and a unique identifier of a coverage domain.

[0006] S300, the index file is loaded into the memory.

[0007] S400, a query request of a user for a target coverage domain is obtained; wherein the query request carries a unique identifier of a target instance and a unique identifier of a target coverage domain.

[0008] S500: Based on the unique identifier of the target instance and the unique identifier of the target coverage area in the query request, query the index file to obtain the target row number corresponding to the target coverage area.

[0009] S600: Based on the target line number, query the corresponding test group number list in the associated file, obtain the test case list according to all the target coverage items in the test group list, and dynamically load the test case list into memory.

[0010] In addition, the present invention also provides another method for loading test cases, the method comprising the following steps:

[0011] S100, Establish an association file, the association file includes multiple rows of data, each row of data includes a list of test group numbers of all coverage items under a coverage domain, wherein each coverage item corresponds to a test group number;

[0012] S200, establish U index files based on the associated file, where U is greater than or equal to 1; the index file includes multiple index mapping relationships, each index mapping relationship includes an N-level index key and the line number of the test group number list corresponding to each coverage domain in the associated file, wherein the N-level index key includes the unique identifier of the instance and the unique identifier of the coverage domain;

[0013] S300, the index file is loaded into memory;

[0014] S400, Obtain the user's query request for the target coverage item; wherein, the query request carries the unique identifier of the target instance, the unique identifier of the target coverage domain, and the index of the target coverage item;

[0015] S500: Based on the unique identifier of the target instance and the unique identifier of the target coverage area in the query request, query the index file to obtain the target row number corresponding to the target coverage area;

[0016] S600: Based on the target line number, query the target test group number list corresponding to the associated file, and based on the index of the target coverage item, find the target test group number in the target test group number list, obtain the test case list according to the target test group number, and dynamically load the test case list into memory.

[0017] Furthermore, the present invention also provides a non-transitory computer-readable storage medium storing at least one instruction or at least one program segment, wherein the at least one instruction or the at least one program segment is loaded and executed by a processor to implement the above-described method.

[0018] In addition, the present invention provides an electronic device including a processor and the aforementioned non-transitory computer-readable storage medium.

[0019] The present invention has at least the following beneficial effects:

[0020] This invention provides a test case loading method, electronic device, and storage medium. First, it reduces the size of associated files by grouping and numbering test cases. Second, it replaces the traditional method of directly loading coverage domains, coverage items, and test cases covering them into memory with a lightweight index file and dynamically loading related test cases into memory. In this invention's index file, the index mapping relationship between coverage domains and their test group numbers is established only through rows, minimizing the index file size. Furthermore, by querying associated files and dynamically loading related test cases into memory, it significantly reduces memory usage and improves the loading efficiency of the coverage database compared to traditional methods, solving the current problems of slow loading and large memory consumption. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0022] Figure 1 A flowchart illustrating a test case loading method provided in an embodiment of the present invention. Detailed Implementation

[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] Unless otherwise defined, all technical and scientific terms used in the embodiments of this invention have the same meaning as commonly understood by those skilled in the art.

[0025] Please see Figure 1 It illustrates a method for loading test cases, the method comprising the following steps:

[0026] S100, Establish an association file, which includes multiple lines, each line including a list of test group numbers for all coverage items under a coverage domain, wherein each coverage item corresponds to a test group number.

[0027] The coverage database is organized and managed using a hierarchical structure conforming to the UCIS standard. This structure consists of multiple levels, primarily including modules or instances, coverage scopes, and coverage items. A module or instance is the root node of the hierarchical structure, coverage items are the leaf nodes, and metric coverage scopes are the intermediate nodes. A module can be instantiated into multiple instances, each instance contains multiple coverage scopes, and each coverage scope contains multiple coverage items. Coverage items are the basic unit for measuring coverage; for example, in row coverage, coverage items are statements, and coverage scopes are blocks.

[0028] The test group number refers to the number of the test group consisting of all test cases that cover the current coverage item.

[0029] In one implementation, the associated file is stored in disk space as a persistent backup.

[0030] In one implementation, a new association file is regenerated when test cases change. The index file does not need to be updated when the coverage model of the coverage database remains unchanged.

[0031] In one implementation, step S100, the step of establishing the associated file, includes:

[0032] S110: Retrieve all test cases in the current coverage database and renumber each test case.

[0033] It should be noted that the purpose of renumbering test cases is to further reduce the memory space occupied by the test cases. There are several ways to renumber them, such as sorting and numbering them by name, simulation order, or contribution.

[0034] In one implementation, step S110, renumbering the test cases, can be any of the following: Sort the test cases by name and increment the number of each sorted test case; Sort the test cases according to the simulation order and increment the number of each sorted test case; Sort the test cases by their contribution to coverage from highest to lowest and increment the number of each sorted test case. For example, the original test cases "test1", "test2", ... are renumbered as "1", "2", ... . It should be noted that when coverage analysis has been performed and data has been collected, sorting and renumbering based on coverage contribution means that the greater the contribution, the more coverage items it can cover, i.e., the higher the frequency of occurrence. Test cases with higher frequency have smaller numbers, resulting in smaller associated files, faster loading and searching speeds, and less space usage. The method of sorting and numbering by test case name is applicable to all application scenarios and has strong versatility.

[0035] S120, based on the number of each test case, obtain the combination of numbers of all test cases covering each coverage item.

[0036] As an example, the numbering combination of the first cover item is "1,2,3", the numbering combination of the second cover item is "2,3,4", the numbering combination of the third cover item is "3", the numbering combination of the fourth cover item is "1,2,3", the numbering combination of the fifth cover item is "1,2,3" and so on.

[0037] It should be noted that as the coverage score gradually converges to 100%, a large number of coverage items will be covered by the same set of test cases, and these coverage items will all have the same combination of test cases attached to them, resulting in wasted memory. Since the number of test cases M and the number of coverage items N can both be large, if direct association is used, M×N records need to be loaded into memory at once, which will consume a lot of memory. Since viewing the test case group associated with a coverage object is user-oriented, i.e., the user first selects the coverage object, and then selects to view the test cases corresponding to that object through menu options. Since the design is often very large, the coverage objects that the user cares about are often only a small part of them. If all the association information is loaded at the same time as loading the coverage database, it will cause wasted memory and reduce the efficiency of loading the coverage database. To solve the above three problems, the embodiments of the present invention number the test case groups and associate the numbers with the corresponding coverage objects.

[0038] S130, number the number combination for each coverage item to obtain the test group number for each coverage item.

[0039] As an example, let's renumber the test case groups for the five coverage items above: "1,2,3" is renumbered as "1", "2,3,4" is renumbered as "2", and "2" is renumbered as "3". This results in the test group number for the first coverage item being "1", the second coverage item being "2", the third coverage item being "3", the fourth coverage item being "1", the fifth coverage item being "1", and so on.

[0040] It should be noted that by obtaining the test group number of each coverage item, the size of the associated files can be further reduced, resulting in faster memory loading and less memory usage.

[0041] In one implementation, in S130, the index of the coverage item in the test group number list of the associated file is consistent with the index of the coverage item in the coverage field; when the coverage item is not covered, the position of the corresponding index is filled with a default value.

[0042] It should be noted that each line in the association file records a list of test group numbers for all coverage items under a coverage domain. During the generation of the association file, the test group numbers for each coverage item are written sequentially, forming a fixed line order.

[0043] In one implementation, the association information of test groups for each coverage item under a coverage domain is stored as a single data record. This record is formatted as a string strictly ordered by a specific delimiter, where the order of each data unit corresponds strictly one-to-one with the storage index of the coverage item in the data structure within the coverage domain; the value of each data unit is a test group number, indicating which test group covers the coverage item at that position. A structured format, such as a JSON string, can also be used, explicitly containing the coverage domain identifier and a list of all associated test groups. Other organizational methods also fall within the scope of this invention. In one implementation, the delimiter is a comma or semicolon; other types of delimiters also fall within the scope of this invention.

[0044] Since the strategy adopted in this embodiment of the invention is to dynamically load the associated test cases of the covered objects on demand, it is necessary to create an index file to determine the location of the associated data.

[0045] In one implementation, the disk space also stores a mapping relationship between test groups and their test case number lists, as well as a mapping relationship between test case numbers and their test case names. Therefore, when a test group number is found, the test case number list can be retrieved using the test group number, and then the corresponding test case name can be retrieved based on the test case number list to obtain the test case name list.

[0046] In one implementation, a mapping relationship between test groups and their list of test case names is also stored in the disk space. Therefore, when a test group number is retrieved, the list of test case names can be retrieved using the test group number.

[0047] S200, establish U index files based on the associated file, where U is greater than or equal to 1; the index file includes multiple index mapping relationships, each index mapping relationship includes an N-level index key and the line number of the test group number list corresponding to each coverage domain in the associated file, wherein the N-level index key includes the unique identifier of the instance and the unique identifier of the coverage domain.

[0048] Each index mapping consists of two parts: the N-level index key, used to uniquely identify instances and covered domains in the query request; and the associated file line number, pointing to the line number position of the associated file containing the test group number corresponding to the query request. Using this line number, the system can quickly index the specific record in the associated file during a query without parsing the entire file.

[0049] In one implementation, the index mapping relationship can be stored as a key-value pair structure or organized in the form of a hash table.

[0050] It's important to note that the index file does not directly store the test group number; instead, it stores its row number in the associated file. This row number is an integer, which saves more space than storing a complete string, reducing the index file size, memory usage, and improving loading and query efficiency. When the test group number changes, only the associated file needs to be modified; the index does not need to be rebuilt. The index only handles location; the data can be managed independently, facilitating version control and incremental updates. When the coverage model of the coverage database changes, the index file in memory is updated.

[0051] There are at least two disk storage schemes for index files. The first is to store all index information in a single index file. The second is to create a separate index file for each coverage metric type.

[0052] In one implementation, in S200, U equals 1, and the index file includes index mappings for all covering index types. When the index file needs to be loaded, it is loaded into memory all at once.

[0053] In one implementation, in S200, U=L, where L is the number of coverage indicator types. That is, an independent index file is created for each coverage indicator type. When an index file needs to be loaded, the index file for the corresponding coverage indicator type is loaded as needed.

[0054] It should be noted that other values ​​of U also fall within the protection scope of this invention.

[0055] In one implementation, regardless of whether U equals 1 or L, when the unique identifier of the coverage domain is not globally unique but locally unique within the same coverage index type, the N-level index key also includes the unique identifier of the coverage index type. It should be noted that for locally uniqueness, the coverage index type to which the unique identifier of the coverage domain belongs needs to be known. Therefore, the row number bound to the coverage domain to which the coverage item belongs can only be obtained based on the unique identifier of the instance, the coverage index type, and the unique identifier of the coverage domain.

[0056] It's important to note that "globally unique" means that the unique identifier of a coverage domain is unique across all types of coverage metrics in the current coverage database; different coverage domains will not have the same unique identifier. "Locally unique," on the other hand, means that the unique identifier of a coverage domain only needs to be unique within its own coverage metric type. Different coverage metric types use independent namespaces, allowing for the existence of identical unique identifiers for coverage domains.

[0057] In one implementation, when the unique identifier of the coverage domain is globally unique, the N-level index key only includes the unique identifier of the instance and the unique identifier of the coverage domain, excluding the unique identifier of the coverage indicator type. This is because the unique identifier of the coverage domain is sufficient to determine its coverage indicator type, and the unique identifier of the coverage indicator type is redundant information and can be omitted.

[0058] S300, the index file is loaded into memory.

[0059] In one implementation, in step S300, the index file is loaded into memory at one time when the graphical tool loads the coverage database to support fast response to subsequent queries; or, when a user first queries the list of test cases associated with a coverage object, the index file is dynamically loaded into memory to reduce initial memory usage and startup latency. The loaded index information is cached in memory, and subsequent queries on coverage objects can directly use the cached data. Other times when the index file is loaded into memory also fall within the scope of this invention.

[0060] It should be noted that by loading the index file into memory and building an efficient multi-level mapping structure, when querying the test case group associated with a certain coverage object, it is not necessary to traverse the original coverage data file. Instead, it can be located directly through the N-level index key, achieving millisecond-level response.

[0061] S400, Obtain the user's query request for the target coverage area; wherein the query request carries the unique identifier of the target instance and the unique identifier of the target coverage area.

[0062] The unique identifier of the target coverage domain is consistent with its index order under the target instance. In one implementation, the unique identifier of the target coverage domain is equal to the index of the target coverage domain under the target instance.

[0063] The index of a cover item refers to its position within its respective cover domain, also known as the list offset within the cover item list of the cover domain. It's important to note that the cover item index is not an external index file, nor is it a globally unique identifier; rather, it refers to the item's sequential position within the cover item list maintained by a specific cover domain. As an example, a cover domain contains multiple cover items, and the position of each cover item in the list (counted from 0) is its index, such as coveritem1, coveritem2, coveritem3, etc.

[0064] It should be noted that when users view the test case group associated with the coverage object in the graphical visualization window, they should first select the target instance, then select the target coverage metric type, then select the corresponding code in the source code, and finally select to visualize the associated test case group. At this time, the system will parse the corresponding code selected by the user into the corresponding coverage object and generate a query request to query the index file.

[0065] S500: Based on the unique identifier of the target instance and the unique identifier of the target coverage area in the query request, query the index file to obtain the target row number corresponding to the target coverage area.

[0066] The target row number includes a list of test group numbers associated with all coverage items under the target coverage domain, including the target test group number of the target coverage item. To obtain the target test group number, the index of the target coverage item is required.

[0067] It should be noted that if the index file is loaded into memory for the first time when a user queries the list of test cases associated with the coverage objects, and this is also the first time the index file is queried, then the index file is directly loaded into memory and queried. Compared to existing technologies, this results in a smaller index file and higher loading and query efficiency. If the index file is loaded into memory when a graphical tool loads the coverage database, or when the index file is not queried for the first time, the index file cached in memory can be used directly, resulting in even faster response times.

[0068] S600: Based on the target line number, query the corresponding test group number list in the associated file, obtain the test case name list according to the target test group number in the test group list, and dynamically load the test case name list into memory.

[0069] The target object queried by the user may be a coverage domain or a coverage item. When the target object queried by the user is a coverage item, S400 involves: obtaining the user's query request for the target coverage item; wherein the query request carries a unique identifier of the target instance, a unique identifier of the target coverage domain, and an index of the target coverage item; correspondingly, S600 involves: querying the list of target test group numbers corresponding to the target line number in the associated file, and finding the target test group number in the list of target test group numbers based on the index of the target coverage item, obtaining a list of test case names based on the target test group number, and dynamically loading the list of test case names into memory.

[0070] As an example, when the target line number includes a list of test group numbers of "2,1,2,2,3" and the index of the target coverage item is 1, then the target test group number of the target coverage item is 1, and the list of test cases for this target test group number is "1,2,3", where "1,2,3" are the numbers of the test cases that cover the target coverage item. That is, the target coverage item is covered by test cases numbered 1, 2, and 3.

[0071] Specifically, when the coverage object is a coverage item, a list of test cases for the target coverage item is obtained. When the coverage object is a coverage domain, a list of test cases for all target coverage items in the target line number is obtained.

[0072] In summary, this invention provides a method for loading test cases. It establishes an association file and an index file. Each line in the association file includes a list of test group numbers for all coverage items under a coverage domain. The index file is indexed using an N-level index key and line numbers. By loading the index file into memory, the method quickly retrieves the line number of the coverage object based on the user's query request, and then queries the association file based on the line number to obtain the test group number associated with the coverage object, thereby obtaining the test case list. By loading a lightweight index file, query speed and efficiency are improved, solving the current problems of slow loading and high memory consumption.

[0073] Embodiments of the present invention also provide a non-transitory computer-readable storage medium that can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiments, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiments.

[0074] Embodiments of the present invention also provide an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0075] Embodiments of the present invention also provide a computer program product including program code, which, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above in various exemplary embodiments of the present invention.

[0076] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0077] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of this invention is defined by the appended claims.

Claims

1. A method for loading test cases, characterized in that, The method includes the following steps: S100, Establish an association file, the association file includes multiple rows of data, each row of data includes a list of test group numbers of all coverage items under a coverage domain, wherein each coverage item corresponds to a test group number; S200, establish U index files based on the associated file, where U is greater than or equal to 1; the index file includes multiple index mapping relationships, each index mapping relationship includes an N-level index key and the line number of the test group number list corresponding to each coverage domain in the associated file, wherein the N-level index key includes the unique identifier of the instance and the unique identifier of the coverage domain; S300, the index file is loaded into memory; S400, Obtain the user's query request for the target coverage area; wherein, the query request carries a unique identifier of the target instance and a unique identifier of the target coverage area; S500: Based on the unique identifier of the target instance and the unique identifier of the target coverage area in the query request, query the index file to obtain the target row number corresponding to the target coverage area; S600: Based on the target line number, query the corresponding test group number list in the associated file, obtain the test case name list according to all target test group numbers in the test group list, and dynamically load the test case name list into memory; In step S100, the step of creating the associated file includes: S110: Retrieve all test cases in the current coverage database and renumber each test case. S120, based on the number of each test case, obtain the combination of numbers of all test cases covering each coverage item; S130, number the number combination for each coverage item to obtain the test group number for each coverage item.

2. The method according to claim 1, characterized in that, In S110, the step of renumbering test cases is any of the following: Sort the test cases by name and assign them sequentially increasing numbers. The test cases are sorted according to the simulation order, and each sorted test case is sequentially numbered. The test cases are sorted from highest to lowest according to their contribution to coverage, and then numbered sequentially.

3. The method according to claim 1, characterized in that, In S200, U equals 1, and the index file includes index mapping relationships for all coverage index types; Alternatively, U=L, where L is the number of covered indicator types.

4. The method according to claim 1, characterized in that, In S200, when the unique identifier of the coverage domain is not globally unique, but is locally unique within the same coverage index type, the N-level index key also includes the unique identifier of the coverage index type. When the unique identifier of the coverage domain is globally unique, the N-level index key only includes the unique identifier of the instance and the unique identifier of the coverage domain, but does not include the unique identifier of the coverage index type.

5. The method according to claim 1, characterized in that, In S300, the index file is loaded into memory at the following times: when the graphical tool loads the coverage database, the index file is loaded into memory all at once; or, when the user queries the list of test cases associated with the coverage object for the first time, the index file is dynamically loaded into memory.

6. The method according to claim 1, characterized in that, In S130, the index of the coverage item in the test group number list of the associated file is consistent with the index of the coverage item in the coverage field; when the coverage item is not covered, a default value is filled in.

7. A method for loading test cases, characterized in that, The method includes the following steps: S100, Establish an association file, the association file includes multiple rows of data, each row of data includes a list of test group numbers of all coverage items under a coverage domain, wherein each coverage item corresponds to a test group number; S200, establish U index files based on the associated file, where U is greater than or equal to 1; the index file includes multiple index mapping relationships, each index mapping relationship includes an N-level index key and the line number of the test group number list corresponding to each coverage domain in the associated file, wherein the N-level index key includes the unique identifier of the instance and the unique identifier of the coverage domain; S300, the index file is loaded into memory; S400, Obtain the user's query request for the target coverage item; wherein, the query request carries the unique identifier of the target instance, the unique identifier of the target coverage domain, and the index of the target coverage item; S500: Based on the unique identifier of the target instance and the unique identifier of the target coverage area in the query request, query the index file to obtain the target row number corresponding to the target coverage area; S600: Based on the target line number, query the list of target test group numbers corresponding to the associated file, and based on the index of the target coverage item, find the target test group number in the list of target test group numbers, obtain the list of test case names according to the target test group number, and dynamically load the list of test case names into memory; In step S100, the step of creating the associated file includes: S110: Retrieve all test cases in the current coverage database and renumber each test case. S120, based on the number of each test case, obtain the combination of numbers of all test cases covering each coverage item; S130, number the number combination for each coverage item to obtain the test group number for each coverage item.

8. The method according to claim 7, characterized in that, In S110, the step of renumbering test cases is any of the following: Sort the test cases by name and assign them sequentially increasing numbers. The test cases are sorted according to the simulation order, and each sorted test case is sequentially numbered. The test cases are sorted from highest to lowest according to their contribution to coverage, and then numbered sequentially.

9. The method according to claim 7, characterized in that, In S200, U equals 1, and the index file includes index mapping relationships for all coverage index types; Alternatively, U=L, where L is the number of covered indicator types.

10. The method according to claim 7, characterized in that, In S200, when the unique identifier of the coverage domain is not globally unique, but is locally unique within the same coverage index type, the N-level index key also includes the unique identifier of the coverage index type. When the unique identifier of the coverage domain is globally unique, the N-level index key only includes the unique identifier of the instance and the unique identifier of the coverage domain, but does not include the unique identifier of the coverage index type.

11. The method according to claim 7, characterized in that, In S300, the index file is loaded into memory at the following times: when the graphical tool loads the coverage database, the index file is loaded into memory all at once; or, when the user queries the list of test cases associated with the coverage object for the first time, the index file is dynamically loaded into memory.

12. The method according to claim 7, characterized in that, In S130, the index of the coverage item in the test group number list of the associated file is consistent with the index of the coverage item in the coverage field; when the coverage item is not covered, a default value is filled in.

13. A non-transitory computer-readable storage medium storing at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the method as described in any one of claims 1-12.

14. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 13.

Citation Information

Patent Citations

  • Test case screening system based on row coverage data

    CN116561016A

  • Index database management method and device based on coverage rate and storage medium

    CN120743914A