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.
advertisement

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.

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.
advertisement

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.

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.

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.

advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn