This set of JUnit Multiple Choice Questions & Answers (MCQs) focuses on “Stubbing the Connection”.
1. A combination of function coverage and branch coverage is sometimes also called _______________
a) Function coverage
b) Statement coverage
c) Decision coverage
d) Condition coverage
View Answer
Explanation: In decision coverage, both aspects of function coverage and branch is used to complete code coverage.
2. ____________ criterion requires that every point of entry and exit in the program has been invoked at least once.
a) Function coverage
b) Statement coverage
c) Decision coverage
d) Condition coverage
View Answer
Explanation: Decision coverage requires that every decision in the program has taken on all possible outcomes at least once.
3. For the following code
if (a or b) and c then
The condition/decision criteria will be satisfied by:
a) a=true, b=true, c=true and a=false, b=false, c=false
b) a=false, b=true, c=true
c) a=true, b=false, c=true
d) a=true, b=true, c=false
View Answer
Explanation: Condition/decision coverage requires that both decision and condition coverage be satisfied.
4. _____________ criterion extends the decision criteria with specifications that each condition has to affect the decision outcome independently.
a) Redundant Condition/decision coverage
b) Transferred Condition/decision coverage
c) Modified Condition/decision coverage
d) Lossless Condition/decision coverage
View Answer
Explanation: Modified Condition/Decision coverage extends upon condition/decision coverage and is used for safety-critical applications.
5. ________________ criterion requires that inside each decision, all combinations of conditions are tested.
a) Redundant Condition/decision coverage
b) Multiple condition coverage
c) Modified Condition/decision coverage
d) Lossless Condition/decision coverage
View Answer
Explanation: Multiple condition coverage checks for every condition possible and each decision is tested.
6. ____________ requires that in a method taking parameters, all the common values for such parameters be considered.
a) Redundant Condition/decision coverage
b) Multiple condition coverage
c) Modified Condition/decision coverage
d) Parameter Value Coverage
View Answer
Explanation: The idea in Parameter Value Coverage is that all common possible values for a parameter are tested.
7. ______________ applications are often required to show that testing achieves 100% of some form of code coverage.
a) Non safe
b) Safety Critical
c) Critical
d) Lossless
View Answer
Explanation: A safety critical application can result in severe loss if not tested properly.
8. PVC stands for _____________
a) Parameter Value Condition
b) Parameterised Values Check
c) Parameter Value Coverage
d) Path Value Check
View Answer
Explanation: PVC is also known as parameter value coverage which tests code coverage for a parameter.
9. ______________ is a method of achieving complete branch coverage without achieving complete path coverage.
a) Basis Path Testing
b) Loss Testing
c) Universal Testing
d) Random Testing
View Answer
Explanation: Basis path testing provides a technique of total branch coverage without having total path coverage.
10. ________________ criteria checks whether each state in a finite-state machine been reached and explored.
a) Path coverage
b) Loop coverage
c) Entry/exit coverage
d) State coverage
View Answer
Explanation: State coverage ensures that every state of a finite state machine is covered by the test suite.
Sanfoundry Global Education & Learning Series – JUnit.
To practice all areas of Junit, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Buy JUnit Books
- Apply for Information Technology Internship
- Practice Programming MCQs
- Buy Programming Books
- Apply for JUnit Internship