Class Notes (vi)

Source: Internet
Author: User

Test coverage

1. Coverage concept:

· Coverage is a means to measure the integrity of a test. Coverage is a measure of the effectiveness of testing techniques. Coverage =(The item numberexecuted at least once ) The total number of /item ;

· Coverage can be broadly divided into two broad categories: logical coverage and functional coverage;

· Test case design can not blindly pursue coverage, because the cost of testing, although the increase in coverage increases.

2, the main types of logic cover: statement coverage, decision coverage, conditional coverage, decision - conditional coverage, path coverage.

3. Statement coverage: (Statement coverage), the ratio of executable statements that are executed in the program after the test is run;

Statement coverage = (number of statements executed at least once)/(total number of statements performed)

4, Branch coverage: (Branch coverage) is also called the decision coverage (decision coverage), its meaning is: In the test run after the program is tested, The ratio of the true branch and the false branch of all judgment statements in the program;

Decision Coverage =(number of times the decision result was evaluated)/(total number of results determined)

5. Condition Coverage: (Condition coverage) means that the rate at which the possible values (truth and false values) of each condition in the judgment statement have occurred after the program is run during testing;

Conditional coverage =(number of values that the condition action value is evaluated at least once)/(total number of conditional action values)

6. Branch - condition Coverage:(Branch Condition coverage) is also called the decision condition override (decision Condition Coverage), which means that the program is run during testing

, the ratio of all possible values of each condition in the judgment statement (true false) and the result of each judgment itself (true false);

Branch condition Coverage =(the number of times thecondition operation of a branch or decision result is evaluated at least once)/(total number of conditional operations + total of decision results)

7. Path coverage: (path coverage) means that the rate at which all possible paths in the program are executed after the program is run at the time of the test;

Path coverage =(number of paths executed at least once)/(total number of paths)

8. Other coverage: function coverage; object-oriented coverage; function overrides; instruction block overlay; determine path overlay.

Class Notes (vi)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.