JUnit Questions and Answers – Stubbing the Connection

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

Answer: c
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

Answer: c
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

Answer: a
Explanation: Condition/decision coverage requires that both decision and condition coverage be satisfied.
advertisement
advertisement

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

Answer: c
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

Answer: b
Explanation: Multiple condition coverage checks for every condition possible and each decision is tested.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: d
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

Answer: b
Explanation: A safety critical application can result in severe loss if not tested properly.
advertisement

8. PVC stands for _____________
a) Parameter Value Condition
b) Parameterised Values Check
c) Parameter Value Coverage
d) Path Value Check
View Answer

Answer: c
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

Answer: a
Explanation: Basis path testing provides a technique of total branch coverage without having total path coverage.
advertisement

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

Answer: d
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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.