[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN113971133A - Test coverage monitoring method and device - Google Patents

Test coverage monitoring method and device Download PDF

Info

Publication number
CN113971133A
CN113971133A CN202111266469.6A CN202111266469A CN113971133A CN 113971133 A CN113971133 A CN 113971133A CN 202111266469 A CN202111266469 A CN 202111266469A CN 113971133 A CN113971133 A CN 113971133A
Authority
CN
China
Prior art keywords
test coverage
test
monitoring
coverage rate
coverage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111266469.6A
Other languages
Chinese (zh)
Inventor
梁悦
梁春花
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202111266469.6A priority Critical patent/CN113971133A/en
Publication of CN113971133A publication Critical patent/CN113971133A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for monitoring test coverage rate, which can be applied to the field of software test or the field of finance. The existing multiple test coverage rate measurement indexes are divided into two types of monitoring requirements based on codes and monitoring requirements based on requirements, and expected values and priority factors are set for each test coverage rate based on software test monitoring requirements. On the basis, according to the measurement index value of the multidimensional test coverage rate corresponding to the monitoring requirement and the preset expected value and priority factor of each test coverage rate, the comprehensive test coverage rate calculation based on the codes and/or the comprehensive test coverage rate calculation based on the requirements are/is carried out, and the measurement analysis of the comprehensive test coverage rate based on the codes and the requirements in the software test process is realized.

Description

Test coverage monitoring method and device
Technical Field
The invention relates to the technical field of software testing, in particular to a method and a device for monitoring test coverage rate.
Background
Currently, research on software testing focuses mainly on how to perform software testing, including test process organization, management, and specific test methods. And the dynamic tracking and quantitative online evaluation method is lacked for the testing capability, efficiency, weak points and the like of the test case set and the testing method.
At present, although various test coverage rate calculation methods are used for measuring the sufficiency and completeness of software test, such as statement coverage, branch coverage, condition coverage and the like, comprehensive measurement analysis of the software test cannot be realized.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for monitoring test coverage, which implement comprehensive test coverage measurement analysis based on codes and based on requirements in a software test process.
In order to achieve the above purpose, the invention provides the following specific technical scheme:
a test coverage monitoring method, comprising:
under the condition that a test coverage monitoring instruction is received, analyzing the test coverage monitoring instruction, and determining a monitoring requirement of the test coverage, wherein the monitoring requirement is a code-based monitoring requirement and/or a requirement-based monitoring requirement;
acquiring a measurement index value of each test coverage rate corresponding to the monitoring requirement;
and calculating the comprehensive test coverage rate corresponding to the monitoring requirement according to the measurement index value of each test coverage rate corresponding to the monitoring requirement, and the preset expected value and priority factor of each test coverage rate.
Optionally, the test coverage corresponding to the monitoring requirement based on the code includes: statement coverage, branch coverage, path coverage, branch-condition coverage, combination coverage, instruction coverage, input-output domain coverage, and block coverage.
Optionally, the test coverage corresponding to the monitoring requirement based on the requirement includes: functional coverage, demand coverage, and interface coverage.
Optionally, in a case that the monitoring requirement is a code-based monitoring requirement, the test software is pre-divided into a plurality of software modules, each of the software modules corresponds to a critical test influence factor, and each of the test coverage rates corresponding to each of the software modules corresponds to a priority factor;
calculating the comprehensive test coverage rate corresponding to the monitoring requirement according to the measurement index value of each test coverage rate corresponding to the monitoring requirement, and the preset expected value and priority factor of each test coverage rate, wherein the calculation comprises the following steps:
calculating the satisfaction degree of each test coverage rate corresponding to each software module according to the measurement index value and the expected value of each test coverage rate corresponding to each software module;
according to the satisfaction degree and the priority factor of each test coverage rate corresponding to each software module, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to each software module to obtain the code test coverage rate corresponding to each software module;
and based on the key influence factor corresponding to each software module, performing weighted summation calculation on the code test coverage rate corresponding to each software module to obtain the code-based comprehensive test coverage rate.
Optionally, when the monitoring requirement is a requirement-based monitoring requirement, each test coverage rate corresponding to the requirement-based monitoring requirement corresponds to a priority factor;
calculating the comprehensive test coverage rate corresponding to the monitoring requirement according to the measurement index value of each test coverage rate corresponding to the monitoring requirement, and the preset expected value and priority factor of each test coverage rate, wherein the calculation comprises the following steps:
calculating the satisfaction degree of each test coverage rate corresponding to the monitoring requirement based on the requirement according to the measurement index value and the expected value of each test coverage rate corresponding to the monitoring requirement based on the requirement;
and according to the satisfaction degree and the priority factor of each test coverage rate corresponding to the demand-based monitoring demand, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to the demand-based monitoring demand to obtain the demand-based comprehensive test coverage rate.
A test coverage monitoring apparatus comprising:
the monitoring instruction analyzing unit is used for analyzing the testing coverage monitoring instruction and determining the monitoring requirement of the testing coverage under the condition that the testing coverage monitoring instruction is received, wherein the monitoring requirement is a code-based monitoring requirement and/or a requirement-based monitoring requirement;
a coverage index value obtaining unit, configured to obtain a measurement index value of each test coverage corresponding to the monitoring requirement;
and the comprehensive test coverage rate calculation unit is used for calculating the comprehensive test coverage rate corresponding to the monitoring requirement according to the measurement index value of each test coverage rate corresponding to the monitoring requirement, and the preset expected value and priority factor of each test coverage rate.
Optionally, the test coverage corresponding to the monitoring requirement based on the code includes: statement coverage, branch coverage, path coverage, branch-condition coverage, combination coverage, instruction coverage, input-output domain coverage, and block coverage.
Optionally, the test coverage corresponding to the monitoring requirement based on the requirement includes: functional coverage, demand coverage, and interface coverage.
Optionally, in a case that the monitoring requirement is a code-based monitoring requirement, the test software is pre-divided into a plurality of software modules, each of the software modules corresponds to a critical test influence factor, and each of the test coverage rates corresponding to each of the software modules corresponds to a priority factor;
the comprehensive test coverage rate calculation unit is specifically configured to:
calculating the satisfaction degree of each test coverage rate corresponding to each software module according to the measurement index value and the expected value of each test coverage rate corresponding to each software module;
according to the satisfaction degree and the priority factor of each test coverage rate corresponding to each software module, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to each software module to obtain the code test coverage rate corresponding to each software module;
and based on the key influence factor corresponding to each software module, performing weighted summation calculation on the code test coverage rate corresponding to each software module to obtain the code-based comprehensive test coverage rate.
Optionally, when the monitoring requirement is a requirement-based monitoring requirement, each test coverage rate corresponding to the requirement-based monitoring requirement corresponds to a priority factor;
the comprehensive test coverage rate calculation unit is specifically configured to:
calculating the satisfaction degree of each test coverage rate corresponding to the monitoring requirement based on the requirement according to the measurement index value and the expected value of each test coverage rate corresponding to the monitoring requirement based on the requirement;
and according to the satisfaction degree and the priority factor of each test coverage rate corresponding to the demand-based monitoring demand, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to the demand-based monitoring demand to obtain the demand-based comprehensive test coverage rate.
Compared with the prior art, the invention has the following beneficial effects:
the invention discloses a test coverage monitoring method, which divides the existing multiple test coverage measurement indexes into two types of monitoring requirements based on codes and monitoring requirements based on requirements, and sets expected values and priority factors for each test coverage based on software test monitoring requirements. On the basis, according to the measurement index value of the multidimensional test coverage rate corresponding to the monitoring requirement and the preset expected value and priority factor of each test coverage rate, the comprehensive test coverage rate calculation based on the codes and/or the comprehensive test coverage rate calculation based on the requirements are/is carried out, and the measurement analysis of the comprehensive test coverage rate based on the codes and the requirements in the software test process is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart of a test coverage monitoring method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for calculating comprehensive test coverage corresponding to code-based monitoring requirements according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for calculating a comprehensive test coverage corresponding to a demand-based monitoring demand according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a test coverage monitoring apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The inventor finds out through research that: at present, software is developed according to a test plan in the test process, but because test cases are huge, the effectiveness of test execution lacks on-line quantitative evaluation, so that the weak points of the test are difficult to find in time in the test execution process, a test optimization strategy is provided, and the test efficiency is effectively controlled and improved. The measuring method based on the test coverage rate mainly carries out statistics on various coverage rates respectively, measures the test sufficiency degree of software and aims to meet the corresponding test sufficiency criterion. How to comprehensively utilize the dynamic change characteristics of various test coverage rates, and related researches on dynamic tracking and quantitative evaluation on the test effects and test weaknesses of various test methods and test cases are not few. More than 10 test coverage measurement indexes such as statement coverage, branch coverage, condition coverage and the like are provided at present, but in engineering application, due to the constraint of test time and cost, corresponding test coverage rates are counted respectively according to a few test sufficiency criteria, and the sufficiency degree of software test is evaluated independently. Therefore, how to fully utilize all the various coverage rate data capable of being counted and the characteristics thereof and provide a comprehensive measurement method of software testing sufficiency is a technical problem which needs to be solved urgently in the field.
In order to solve the technical problem, the invention discloses a test coverage monitoring method which is applied to a software test server and used for carrying out code-based comprehensive test coverage calculation and/or demand-based comprehensive test coverage calculation according to a measurement index value of multi-dimensional test coverage corresponding to a monitoring demand and a preset expected value and priority factor of each test coverage, so as to realize code-based and demand-based comprehensive test coverage measurement analysis in a software test process.
Specifically, referring to fig. 1, the method for monitoring test coverage disclosed in this embodiment includes the following steps:
s101: analyzing the test coverage monitoring instruction under the condition of receiving the test coverage monitoring instruction, and determining the monitoring requirement of the test coverage, wherein the monitoring requirement is a code-based monitoring requirement and/or a requirement-based monitoring requirement;
it should be noted that the test coverage monitoring instruction may be received in the software testing process, or may be received after the software testing is finished, and in the software testing process, the coverage monitoring may be performed multiple times at random, or multiple times at regular time, so as to implement real-time monitoring on the software testing effect.
Because the objects of each software test are different, the test requirements are also different, and the monitoring requirements of each software test are also possibly different, the embodiment supports the monitoring of the code-based monitoring requirements and/or the requirement-based monitoring requirements. The main test stage where the two types of test coverage rates based on codes and based on requirements are located is greatly different from the adopted test method, and the requirements and measurement emphasis points of different test stages on various test coverage rates are different, so that the multi-dimensional test coverage rate is divided into two types of monitoring requirements based on codes and based on requirements in the embodiment.
S102: acquiring a measurement index value of each test coverage rate corresponding to the monitoring requirement;
specifically, a measurement index value of the test coverage is obtained according to the execution condition of the test case.
The Test Case (Test Case) refers to the description of a Test task performed on a specific software product, and embodies Test schemes, methods, techniques and strategies. The contents of the test object, the test environment, the input data, the test steps, the expected results, the test scripts and the like are included, and finally, a document is formed. Simply considered, a test case is a set of test inputs, execution conditions, and expected results tailored for a particular purpose to verify whether a particular software requirement is met.
Test coverage can be expressed by a ratio formula:
Figure BDA0003326995030000061
wherein, item is a test case.
Suppose that the coverage of item, i.e. coverage, is to be calculated. In order to measure the sufficiency of software testing from different angles, more than 10 test coverage indexes focusing on different angles are proposed at present, and mainly comprise: code-based coverage (e.g., statement coverage, branch coverage, path coverage, branch-condition coverage, combination coverage, instruction coverage, input-output domain coverage, block coverage), demand-based coverage (e.g., function coverage, demand coverage, interface coverage), and object-oriented coverage (e.g., legacy context coverage, state-based context coverage, thread-based context coverage), among others.
The present embodiment refers to each coverage as one dimensional coverage index of the software test, and the multi-dimensional test coverage represents a plurality of test coverage indexes for measuring the test sufficiency.
Taking the coverage rate of the calculation statement as an example, item in the coverage rate calculation formula is a test case including a specific statement.
Suppose the dimension of the test coverage is m, namely, there are m test coverage C1,C2,...,Cm,0≤Cj≤1,j=1,...,m。ncaseAnd t can be used as the statistic of the test coverage rateVariable, ncaseMeans the total number of test cases executed when the current test coverage is reached, and t represents the execution of the ncaseEach test case accumulates CPU time occupied, and thus can be represented by a variable x, i.e., x can be ncaseOr t.
Defining expected values for test coverage for each dimension
Figure BDA0003326995030000062
And is
Figure BDA0003326995030000063
j ═ 1.., m. If the expected value of the statement coverage rate is usually set to be 90% -100%; since the path coverage rate is limited by the exponential increase of the number of paths, the path coverage rate is difficult to reach 100%, and therefore the expected value of the path coverage rate is usually about 70% to 80%, or even lower.
S103: and calculating the comprehensive test coverage rate corresponding to the monitoring requirement according to the measurement index value of each test coverage rate corresponding to the monitoring requirement, and the preset expected value and priority factor of each test coverage rate.
Under the condition that the monitoring requirement is based on codes, the test software is divided into a plurality of software modules in advance, and each software module corresponds to a critical test influence factor thetakN, n is the number of software modules.
In the multi-dimensional test coverage, the test angles reflected by various test coverage are different, the difficulty degree of realization is different, the expected target and the influence degree on the software reliability are different, so the attention degrees given to different test coverage in the test are different. In this embodiment, a "priority factor" is introduced as a weight value of each dimension test coverage, and each test coverage corresponding to each software module corresponds to a priority factor respectively
Figure BDA0003326995030000072
The value must satisfy the constraint condition:
Figure BDA0003326995030000073
j 1.. m, m is the number of metrics of the test coverage corresponding to the monitoring requirement based on the code. The higher the priority is to be given,
Figure BDA0003326995030000074
the larger the value of (c). In software testing, it is desirable to implement test coverage with high priority.
Referring to fig. 2, the method for calculating the comprehensive test coverage corresponding to the monitoring requirement based on the code is as follows:
s201: calculating the satisfaction degree of each test coverage rate corresponding to each software module according to the measurement index value and the expected value of each test coverage rate corresponding to each software module;
in the software test, when the n-th execution is finishedcaseAfter each test case, in order to represent the extent to which the actually realized test coverage reaches its expected value, a test coverage C is definedjCurrent satisfaction Satj(x) Comprises the following steps:
Figure BDA0003326995030000071
wherein j is 1j(x) To test coverage CjX is ncaseOr t.
The expected value of each test coverage is preset according to the test requirements, and thus, the expected value of each test coverage may be different.
Since the measured coverage may exceed the expected value, for example, the expected value of coverage of a certain measured software branch is set to 75%, but actually reaches 76%, at this time Satj(x) > 1, this example states if Satj(x) When greater than 1, Satj(x) 1 is taken.
S202: according to the satisfaction degree and the priority factor of each test coverage rate corresponding to each software module, carrying out weighted summation calculation on the measurement index value of each test coverage rate corresponding to each software module to obtain the code test coverage rate corresponding to each software module;
s203: and based on the key influence factor corresponding to each software module, performing weighted summation calculation on the code test coverage rate corresponding to each software module to obtain the code-based comprehensive test coverage rate.
Specifically, the calculation formula of the comprehensive test coverage rate based on the code is as follows:
Figure BDA0003326995030000081
based on the comprehensive test coverage rate based on the codes, the following characteristics can be embodied:
i) the higher the satisfaction degree of certain test coverage rate is, the higher the weight of the certain test coverage rate in the comprehensive test coverage rate is;
ii) the higher the priority factor of a certain test coverage, the higher its weight in the integrated test coverage;
iii) the higher the critical test impact factor of a module with certain test coverage, the higher its weight in the overall test coverage.
Under the condition that the monitoring demand is based on the demand, each test coverage rate corresponding to the demand-based monitoring demand corresponds to a priority factor omega respectivelyj
Referring to fig. 3, calculating the comprehensive test coverage corresponding to the monitoring requirement according to the measurement index value of each test coverage corresponding to the monitoring requirement, and the preset expected value and priority factor of each test coverage, includes:
s301: calculating the satisfaction degree of each test coverage rate corresponding to the monitoring requirement based on the requirement according to the measurement index value and the expected value of each test coverage rate corresponding to the monitoring requirement based on the requirement;
s302: and according to the satisfaction degree and the priority factor of each test coverage rate corresponding to the demand-based monitoring demand, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to the demand-based monitoring demand to obtain the demand-based comprehensive test coverage rate.
Specifically, the calculation formula of the comprehensive test coverage rate based on the demand is as follows:
Figure BDA0003326995030000082
and if the coverage rate of each dimension in the test reaches the expected value, respectively deducing the corresponding expected value of the comprehensive test coverage rate according to the comprehensive test coverage rate based on the codes and the comprehensive test coverage rate based on the requirements. The integrated test coverage expectation value may be used as a criterion for defining the adequacy of the integrated test coverage of the software and will not be discussed in detail here.
It should be noted that although there is a certain intersection and inclusion relationship between the multidimensional coverage rates, since the various test coverage rates are independently counted in the test, the intersection and inclusion relationship is not considered when calculating the comprehensive test coverage rate.
In the method for monitoring the test coverage, the existing multiple test coverage measurement indexes are divided into two types, namely a code-based monitoring requirement and a requirement-based monitoring requirement, and an expected value and a priority factor are set for each test coverage based on the software test monitoring requirement. On the basis, according to the measurement index value of the multidimensional test coverage rate corresponding to the monitoring requirement and the preset expected value and priority factor of each test coverage rate, the comprehensive test coverage rate calculation based on the codes and/or the comprehensive test coverage rate calculation based on the requirements are/is carried out, and the measurement analysis of the comprehensive test coverage rate based on the codes and the requirements in the software test process is realized.
Based on the method for monitoring test coverage disclosed in the above embodiments, this embodiment correspondingly discloses a device for monitoring test coverage, please refer to fig. 4, and the device includes:
a monitoring instruction analyzing unit 401, configured to analyze the test coverage monitoring instruction and determine a monitoring requirement of the test coverage under the condition that the test coverage monitoring instruction is received, where the monitoring requirement is a code-based monitoring requirement and/or a requirement-based monitoring requirement;
a coverage index value obtaining unit 402, configured to obtain a measurement index value of each test coverage corresponding to the monitoring requirement;
a comprehensive test coverage calculating unit 403, configured to calculate a comprehensive test coverage corresponding to the monitoring requirement according to the measurement index value of each test coverage corresponding to the monitoring requirement, and a preset expected value and priority factor of each test coverage.
Optionally, the test coverage corresponding to the monitoring requirement based on the code includes: statement coverage, branch coverage, path coverage, branch-condition coverage, combination coverage, instruction coverage, input-output domain coverage, and block coverage.
Optionally, the test coverage corresponding to the monitoring requirement based on the requirement includes: functional coverage, demand coverage, and interface coverage.
Optionally, in a case that the monitoring requirement is a code-based monitoring requirement, the test software is pre-divided into a plurality of software modules, each of the software modules corresponds to a critical test influence factor, and each of the test coverage rates corresponding to each of the software modules corresponds to a priority factor;
the comprehensive test coverage calculating unit 403 is specifically configured to:
calculating the satisfaction degree of each test coverage rate corresponding to each software module according to the measurement index value and the expected value of each test coverage rate corresponding to each software module;
according to the satisfaction degree and the priority factor of each test coverage rate corresponding to each software module, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to each software module to obtain the code test coverage rate corresponding to each software module;
and based on the key influence factor corresponding to each software module, performing weighted summation calculation on the code test coverage rate corresponding to each software module to obtain the code-based comprehensive test coverage rate.
Optionally, when the monitoring requirement is a requirement-based monitoring requirement, each test coverage rate corresponding to the requirement-based monitoring requirement corresponds to a priority factor;
the comprehensive test coverage calculating unit 403 is specifically configured to:
calculating the satisfaction degree of each test coverage rate corresponding to the monitoring requirement based on the requirement according to the measurement index value and the expected value of each test coverage rate corresponding to the monitoring requirement based on the requirement;
and according to the satisfaction degree and the priority factor of each test coverage rate corresponding to the demand-based monitoring demand, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to the demand-based monitoring demand to obtain the demand-based comprehensive test coverage rate.
In the test coverage monitoring device disclosed in this embodiment, the existing multiple test coverage measurement indexes are divided into two types, namely, a code-based monitoring requirement and a demand-based monitoring requirement, and an expected value and a priority factor are set for each test coverage based on the software test monitoring requirement. On the basis, according to the measurement index value of the multidimensional test coverage rate corresponding to the monitoring requirement and the preset expected value and priority factor of each test coverage rate, the comprehensive test coverage rate calculation based on the codes and/or the comprehensive test coverage rate calculation based on the requirements are/is carried out, and the measurement analysis of the comprehensive test coverage rate based on the codes and the requirements in the software test process is realized.
It should be noted that the test coverage monitoring method and device provided by the invention can be applied to the field of software test or the field of finance. The above is only an example, and the application field of the test coverage monitoring method and the test coverage monitoring device provided by the present invention is not limited.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above embodiments can be combined arbitrarily, and the features described in the embodiments in the present specification can be replaced or combined with each other in the above description of the disclosed embodiments, so that those skilled in the art can implement or use the present application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A test coverage monitoring method, comprising:
under the condition that a test coverage monitoring instruction is received, analyzing the test coverage monitoring instruction, and determining a monitoring requirement of the test coverage, wherein the monitoring requirement is a code-based monitoring requirement and/or a requirement-based monitoring requirement;
acquiring a measurement index value of each test coverage rate corresponding to the monitoring requirement;
and calculating the comprehensive test coverage rate corresponding to the monitoring requirement according to the measurement index value of each test coverage rate corresponding to the monitoring requirement, and the preset expected value and priority factor of each test coverage rate.
2. The method of claim 1, wherein monitoring the test coverage for demand based on the code comprises: statement coverage, branch coverage, path coverage, branch-condition coverage, combination coverage, instruction coverage, input-output domain coverage, and block coverage.
3. The method of claim 1, wherein monitoring the test coverage for demand-based monitoring comprises: functional coverage, demand coverage, and interface coverage.
4. The method according to claim 2, wherein, in a case that the monitoring requirement is a code-based monitoring requirement, the test software is pre-divided into a plurality of software modules, each of the software modules corresponds to a critical test influence factor, and each of the test coverage rates corresponding to each of the software modules corresponds to a priority factor;
calculating the comprehensive test coverage rate corresponding to the monitoring requirement according to the measurement index value of each test coverage rate corresponding to the monitoring requirement, and the preset expected value and priority factor of each test coverage rate, wherein the calculation comprises the following steps:
calculating the satisfaction degree of each test coverage rate corresponding to each software module according to the measurement index value and the expected value of each test coverage rate corresponding to each software module;
according to the satisfaction degree and the priority factor of each test coverage rate corresponding to each software module, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to each software module to obtain the code test coverage rate corresponding to each software module;
and based on the key influence factor corresponding to each software module, performing weighted summation calculation on the code test coverage rate corresponding to each software module to obtain the code-based comprehensive test coverage rate.
5. The method according to claim 3, wherein, in the case that the monitoring demand is a demand-based monitoring demand, each test coverage rate corresponding to the demand-based monitoring demand corresponds to a priority factor;
calculating the comprehensive test coverage rate corresponding to the monitoring requirement according to the measurement index value of each test coverage rate corresponding to the monitoring requirement, and the preset expected value and priority factor of each test coverage rate, wherein the calculation comprises the following steps:
calculating the satisfaction degree of each test coverage rate corresponding to the monitoring requirement based on the requirement according to the measurement index value and the expected value of each test coverage rate corresponding to the monitoring requirement based on the requirement;
and according to the satisfaction degree and the priority factor of each test coverage rate corresponding to the demand-based monitoring demand, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to the demand-based monitoring demand to obtain the demand-based comprehensive test coverage rate.
6. A test coverage monitoring apparatus, comprising:
the monitoring instruction analyzing unit is used for analyzing the testing coverage monitoring instruction and determining the monitoring requirement of the testing coverage under the condition that the testing coverage monitoring instruction is received, wherein the monitoring requirement is a code-based monitoring requirement and/or a requirement-based monitoring requirement;
a coverage index value obtaining unit, configured to obtain a measurement index value of each test coverage corresponding to the monitoring requirement;
and the comprehensive test coverage rate calculation unit is used for calculating the comprehensive test coverage rate corresponding to the monitoring requirement according to the measurement index value of each test coverage rate corresponding to the monitoring requirement, and the preset expected value and priority factor of each test coverage rate.
7. The apparatus of claim 6, wherein the test coverage corresponding to the code-based monitoring requirement comprises: statement coverage, branch coverage, path coverage, branch-condition coverage, combination coverage, instruction coverage, input-output domain coverage, and block coverage.
8. The apparatus of claim 6, wherein monitoring demand-based test coverage for demand comprises: functional coverage, demand coverage, and interface coverage.
9. The apparatus according to claim 7, wherein in a case that the monitoring requirement is a code-based monitoring requirement, the test software is pre-divided into a plurality of software modules, each of the software modules corresponds to a critical test impact factor, and each of the test coverage rates corresponding to each of the software modules corresponds to a priority factor;
the comprehensive test coverage rate calculation unit is specifically configured to:
calculating the satisfaction degree of each test coverage rate corresponding to each software module according to the measurement index value and the expected value of each test coverage rate corresponding to each software module;
according to the satisfaction degree and the priority factor of each test coverage rate corresponding to each software module, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to each software module to obtain the code test coverage rate corresponding to each software module;
and based on the key influence factor corresponding to each software module, performing weighted summation calculation on the code test coverage rate corresponding to each software module to obtain the code-based comprehensive test coverage rate.
10. The apparatus according to claim 8, wherein, in the case that the monitoring requirement is a requirement-based monitoring requirement, each test coverage rate corresponding to the requirement-based monitoring requirement corresponds to a priority factor;
the comprehensive test coverage rate calculation unit is specifically configured to:
calculating the satisfaction degree of each test coverage rate corresponding to the monitoring requirement based on the requirement according to the measurement index value and the expected value of each test coverage rate corresponding to the monitoring requirement based on the requirement;
and according to the satisfaction degree and the priority factor of each test coverage rate corresponding to the demand-based monitoring demand, performing weighted summation calculation on the measurement index value of each test coverage rate corresponding to the demand-based monitoring demand to obtain the demand-based comprehensive test coverage rate.
CN202111266469.6A 2021-10-28 2021-10-28 Test coverage monitoring method and device Pending CN113971133A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111266469.6A CN113971133A (en) 2021-10-28 2021-10-28 Test coverage monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111266469.6A CN113971133A (en) 2021-10-28 2021-10-28 Test coverage monitoring method and device

Publications (1)

Publication Number Publication Date
CN113971133A true CN113971133A (en) 2022-01-25

Family

ID=79588866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111266469.6A Pending CN113971133A (en) 2021-10-28 2021-10-28 Test coverage monitoring method and device

Country Status (1)

Country Link
CN (1) CN113971133A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100180258A1 (en) * 2009-01-15 2010-07-15 International Business Machines Corporation Weighted Code Coverage Tool
CN104063321A (en) * 2014-06-27 2014-09-24 北京控制工程研究所 Test verifying system and test verifying method for microblaze soft-core program
CN106294174A (en) * 2016-08-19 2017-01-04 北京航空航天大学 The various dimensions measure of testing adequacy and device
CN111813697A (en) * 2020-08-26 2020-10-23 四川新网银行股份有限公司 Test coverage rate statistical method based on test object calling mark

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100180258A1 (en) * 2009-01-15 2010-07-15 International Business Machines Corporation Weighted Code Coverage Tool
CN104063321A (en) * 2014-06-27 2014-09-24 北京控制工程研究所 Test verifying system and test verifying method for microblaze soft-core program
CN106294174A (en) * 2016-08-19 2017-01-04 北京航空航天大学 The various dimensions measure of testing adequacy and device
CN111813697A (en) * 2020-08-26 2020-10-23 四川新网银行股份有限公司 Test coverage rate statistical method based on test object calling mark

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
叶勇健等: "基于多维覆盖率的嵌入式软件测试分析方法", 《黑龙江工程学院学报》, vol. 35, no. 3, 30 June 2021 (2021-06-30) *
安金霞等: "基于多维度覆盖率的软件测试动态评价方法", 《软件学报》, vol. 21, no. 9, 30 September 2010 (2010-09-30), pages 2135 - 2147 *

Similar Documents

Publication Publication Date Title
JP6978541B2 (en) Computer implementation method, computer system and computer equipment to reduce dynamic deviation value bias
US20160364488A1 (en) Microblog-based event context acquiring method and system
US20100153330A1 (en) Proactive Information Technology Infrastructure Management
CN101505243A (en) Performance exception detecting method for Web application
EP2725440A1 (en) Prediction device, prediction method and prediction program
Kang et al. Sequential statistical modeling method for distribution type identification
CN115841046A (en) Accelerated degradation test data processing method and device based on wiener process
Tae-Jin Comparative study on the performance attributes of NHPP software reliability model based on Weibull family distribution
Haak et al. Autonomic benchmarking for cloud infrastructures: an economic optimization model
CN114138601A (en) Service alarm method, device, equipment and storage medium
CN111506878B (en) Node number selection device and method based on sag system index random sample estimation
CN113971133A (en) Test coverage monitoring method and device
CN117035563A (en) Product quality safety risk monitoring method, device, monitoring system and medium
US11762562B2 (en) Performance analysis apparatus and performance analysis method
CN108073629B (en) Method and device for identifying purchase mode through website access data
CN112836936B (en) Risk factor screening method and system for power sensing network perception layer planning
CN110717244B (en) Data trust analysis computer simulation method based on average deviation algorithm
Galatro et al. Exploratory Data Analysis
Yaremchuk et al. Big data and similarity-based software reliability assessment: The technique and applied tools
Seifi et al. Designing different sampling plans based on process capability index
Ferrucci et al. A case study on the conversion of function points into cosmic
CN111507639B (en) Financing risk analysis method and device
CN113554126B (en) Sample evaluation method, device, equipment and computer readable storage medium
Molawade et al. Software reliability prediction using NHPP and Least median of squares (LMS) for parameters estimation
CN118885950A (en) Operation and maintenance fault analysis and early warning method for cloud computing equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination