Search

CN-117349140-B - Marking method for covering exemption points

CN117349140BCN 117349140 BCN117349140 BCN 117349140BCN-117349140-B

Abstract

The invention relates to a method for marking coverage exemption points, which comprises the steps of S1, executing source codes based on preset test cases to generate a coverage database, wherein the coverage database comprises coverage points of all source codes, generating at least one piece of coverage exemption condition information according to a preset data structure, wherein the preset data structure comprises a condition id data segment, an application object data segment, a selection condition data segment and a verification code data segment, the initial value of the verification code data segment is empty, S2, determining the coverage exemption points based on the source codes, the coverage database and all coverage exemption condition information, S3, generating corresponding verification codes based on upper codes corresponding to each coverage exemption point, wherein the upper codes are all codes capable of affecting the coverage exemption points, updating the verification codes into the corresponding coverage exemption condition information, and generating the coverage exemption information corresponding to the coverage exemption points. The invention improves the efficiency of marking and maintaining the coverage exemption points.

Inventors

  • Ye Qingshuang

Assignees

  • 上海合见工业软件集团有限公司

Dates

Publication Date
20260508
Application Date
20220627

Claims (9)

  1. 1. A method for marking a coverage exemption point, comprising: Step S1, executing source codes based on a preset test case to generate a coverage database, wherein the coverage database comprises coverage points of all source codes, generating at least one piece of coverage exemption condition information according to a preset data structure, The preset data structure comprises a condition id data segment, an application object data segment, a selection condition data segment and a verification code data segment, wherein the initial value of the verification code data segment is null; s2, determining coverage exemption points based on source codes, coverage databases and all coverage exemption condition information; Step S3, generating corresponding verification codes based on upper codes corresponding to each coverage exemption point, wherein the upper codes are all codes capable of affecting the coverage exemption points, updating the verification codes into corresponding coverage exemption condition information, and generating coverage exemption information corresponding to the coverage exemption points; when the source code is updated, the method comprises the steps of: step S10, acquiring information of each original coverage exemption corresponding to a source code before updating; Step S20, acquiring updated upper layer codes corresponding to each original coverage exemption point in updated source codes, and updating verification codes based on the updated upper layer codes; And step S30, comparing the original verification code corresponding to each original coverage exemption point with the updated verification code, if the original verification code is consistent with the updated verification code, determining the coverage point corresponding to the original coverage exemption point in the updated source code as the updated coverage exemption point, and if the original coverage exemption points are inconsistent, generating prompt information based on the original coverage exemption points.
  2. 2. The method of claim 1, wherein the step of determining the position of the substrate comprises, The application object data segment includes an application range data segment, which is generated based on one of a design hierarchy tree id, a base module id, a module instance id, a source code file id, or a combination of at least two, and in step S2, a first candidate coverage point range is determined from all coverage points based on the application range data segment.
  3. 3. The method of claim 2, wherein the step of determining the position of the substrate comprises, The selection condition data segment is generated based on one of a logical expression, a regular expression, and a wild card, or a combination of at least two components, In the step S2, a second candidate coverage point range is determined from the first candidate coverage point range based on the selection condition data segment.
  4. 4. The method of claim 3, wherein the step of, The preset data structure further comprises a coverage type data segment, wherein the coverage type data segment is independently arranged or arranged in the application object data segment or the selection condition data segment, the application object data segment further comprises a coverage type data segment, and the coverage type data segment is null or comprises at least one target exemption type.
  5. 5. The method of claim 4, wherein the step of determining the position of the first electrode is performed, And when the coverage type data segment is empty, in the step S2, all coverage points corresponding to all exemption types in the range of the second candidate coverage point are determined to be coverage exemption points.
  6. 6. The method of claim 4, wherein the step of determining the position of the first electrode is performed, When the coverage type data segment includes at least one target exemption type, in step S2, all coverage points corresponding to all target exemption types in the second candidate coverage point range are determined as coverage exemption points.
  7. 7. The method of claim 4, wherein the step of determining the position of the first electrode is performed, The data structure comprises a condition id data segment, a first data level, a second data level and a verification code data segment, wherein the first data level comprises a first action type data segment, a first application object data segment and a first selection condition data segment, the second data level comprises a second action type data segment, a second application object data segment and a second selection condition data segment, the first action type data segment is set to be a removal identification, and the second action type data segment is set to be a add-back identification.
  8. 8. The method of claim 7, wherein the step of determining the position of the probe is performed, When the coverage type data segment is empty: In the step S2, all coverage points corresponding to all exemption types in a second candidate coverage point range determined based on the first application object data segment and the first selection condition data segment are determined to be candidate coverage exemption points, all coverage points corresponding to all exemption types in the second candidate coverage point range determined based on the second application object data segment and the second selection condition data segment are determined to be adding coverage points, and the coverage points after adding the adding coverage points in the candidate coverage exemption points are removed are determined to be covering exemption points.
  9. 9. The method of claim 7, wherein the step of determining the position of the probe is performed, When the coverage type data segment includes at least one target exemption type: The step S2 comprises the steps of determining all coverage points corresponding to all target exemption types in a second candidate coverage point range determined based on a first application object data segment and a first selection condition data segment as coverage exemption points, determining all coverage points corresponding to all target exemption types in the second candidate coverage point range determined based on the second application object data segment and the second selection condition data segment as addition coverage points, and determining the coverage points with the addition coverage points removed in the candidate coverage exemption points as coverage exemption points.

Description

Marking method for covering exemption points Technical Field The invention relates to the technical field of computers, in particular to a marking method for covering exemption points. Background In software testing and chip verification, coverage is often used to gauge whether testing and verification is adequate. However, software and chip designs often include test points that cannot be tested, verified, or do not need to be tested, verified, and these test points are referred to as coverage exemption points. To achieve 100% coverage, the developer needs to review the source code and mark such coverage exemptions. In software and chip design, as the design is bigger and bigger, the coverage exemption points needing to be marked are more and more, a developer spends a great deal of time analyzing and searching one-to-one to mark the coverage exemption points, checking the coverage exemption points, and spending a great deal of time to recheck and change the coverage exemption points when the design is changed, so that the efficiency of marking and maintaining the coverage exemption points is low, and therefore, how to improve the efficiency of marking and maintaining the coverage exemption points becomes a technical problem to be solved urgently. Disclosure of Invention The invention aims to provide a marking method for covering the exemption points, which improves the efficiency of marking and maintaining the coverage exemption points. The invention provides a method for marking coverage exemption points, which comprises the following steps: Step S1, executing source codes based on a preset test case to generate a coverage database, wherein the coverage database comprises coverage points of all source codes, generating at least one piece of coverage exemption condition information according to a preset data structure, The preset data structure comprises a condition id data segment, an application object data segment, a selection condition data segment and a verification code data segment, wherein the initial value of the verification code data segment is null; s2, determining coverage exemption points based on source codes, coverage databases and all coverage exemption condition information; and S3, generating corresponding verification codes based on upper codes corresponding to the coverage exemption points, wherein the upper codes are all codes capable of affecting the coverage exemption points, updating the verification codes into corresponding coverage exemption condition information, and generating coverage exemption information corresponding to the coverage exemption points. Compared with the prior art, the invention has obvious advantages and beneficial effects. By means of the technical scheme, the marking method for covering the exemption points can achieve quite technical progress and practicality, has wide industrial utilization value, and has at least the following advantages: According to the invention, the coverage exemption condition information is generated through the preset data structure, the coverage exemption points with common characteristics can be marked in batches based on one coverage exemption condition information, the batch marking and the modification are convenient, and the efficiency of marking and maintaining the coverage exemption points is improved. In addition, after the source code is updated, a plurality of coverage exemption points in the original code can be referenced based on simple verification code comparison, so that the efficiency of marking and maintaining the coverage exemption points is further improved. The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention, as well as the preferred embodiments thereof, together with the following detailed description of the invention, given by way of illustration only, together with the accompanying drawings. Drawings FIG. 1 is a flowchart of a method for marking coverage exemption points according to an embodiment of the present invention; FIG. 2 is a diagram of a pre-update design code according to an embodiment of the present invention; FIG. 3 is a diagram of an updated design code according to an embodiment of the present invention. Detailed Description In order to further describe the technical means and effects adopted for achieving the preset aim of the present invention, the following detailed description refers to the specific implementation and effects of a method for marking covered exemption points according to the present invention by combining the accompanying drawings and the preferred embodiments. The embodiment of the invention provides a method for marking coverage exemption points, which is shown in fig. 1 and comprises the following steps: Step S1, executing source codes based on a preset test case to generate a coverage database, wherein the coverage database comprises coverage points of all