10 Questions
What type of structural coverage is achieved when true/false values of basic conditions are tested?
Basic Condition Coverage
What is the purpose of testing boolean values of basic conditions?
To test the true/false values of basic conditions
Which type of coverage involves testing all possible combinations of basic conditions?
Compound Condition Coverage
What is the minimum number of test cases required to achieve 100% branch coverage for the given if statement?
3
What type of coverage involves testing the execution of every statement in the code?
Statement Coverage
Which type of coverage involves testing the execution of every path in the code?
All Paths Coverage
What is the purpose of testing the execution of every path in the code?
To test the execution of every path in the code
Which type of coverage involves testing the flow of data between different parts of the code?
Data Flow Coverage
What is the purpose of testing the flow of data between different parts of the code?
To test the flow of data between different parts of the code
What type of coverage involves testing the method or function calls in the code?
Method Coverage
Study Notes
All Paths Coverage
- Requires each path in the program to be exercised by at least one test case
- Intuition: some faults may only be revealed by exercising a particular sequence of branches
- Example: function A() and function B() have a large number of paths (23 and 212 respectively)
Feasibility of All Paths Coverage
- Loops make it difficult to achieve All Paths Coverage
Statement Coverage
- Test requirement: each statement in the program is executed at least once
- Measures the number of executed statements against the total number of statements
- Example: a program with 10 statements, where 9 statements are executed, has 90% statement coverage
Branch Coverage
- Test requirement: each branch in the program is traversed at least once
- Measures the number of traversed branches against the total number of conditional branch edges
- Example 1: a program with two branches, where both branches are traversed, has 100% branch coverage
- Example 2: a program with two branches, where only one branch is traversed, requires more test cases to achieve 100% branch coverage
Basic Condition Coverage
- Test requirement: each basic condition in the program assumes all possible boolean values
- Measures the number of boolean values assumed by all basic conditions against the total number of boolean values
- Example: a program with a condition "if (x>0)" requires two test cases to achieve 100% basic condition coverage
Branch and Condition Coverage
- Test requirement: branches and truth values assumed by basic conditions
- Example: a program with a condition "if ( (a || b) && c )" requires four test cases to achieve 100% branch and condition coverage
Compound Condition Coverage
- Test requirement: all possible combinations of basic conditions
- Example: a program with a condition "if ( ( (a || b) && c ) || d ) && e)" requires a large number of test cases to achieve 100% compound condition coverage
Learn about All Paths Coverage, a software testing technique that ensures each path in a program is exercised by at least one test case. Understand the intuition behind it and its feasibility.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free