JUnit Questions and Answers – Mock Objects

This set of JUnit Interview Questions and Answers focuses on “Mock Objects”.

1. ____________ is a software analysis method used to identify structural units in code under test.
a) Linear code sequence and jump
b) State coverage
c) Lossless packs
d) Linear jumps
View Answer

Answer: a
Explanation: Linear code sequence and jump helps to answer the question “how much testing is enough”?

2. LCSAJ stands for _______________
a) Loading Code standard as Jumps
b) Linear code sequence and jump
c) Loading code sequence and jump
d) Linear coverage sequence and jump
View Answer

Answer: b
Explanation: LCSAJ is primarily used with dynamic software analysis.

3. The JJ in JJ-path stands for ___________
a) Just Jump
b) Jump-in-JUnit
c) Java-JUnit
d) Jump-to-Jump
View Answer

Answer: d
Explanation: JJ-path or Jump-to-Jump-path is a well-defined linear region of a program’s code.
advertisement
advertisement

4. In a narrower sense, LCSAJ is also called ____________
a) JJ-Path
b) Code Coverage
c) System Code Analysis
d) Code Breakdown
View Answer

Answer: a
Explanation: LCSAJ is now always referred to as a JJ-path.

5. ______________________ is the most common and least efficient debugging technique.
a) Brute force debugging
b) Backtracking
c) Cause elimination
d) Program slicing
View Answer

Answer: a
Explanation: In brute force debugging, all possible combinations are used and studied.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. An effective method for locating errors in small programs is to ___________ the incorrect results through the logic of the program until the point where the logic went astray is found.
a) Search
b) Backtrack
c) Slice
d) Eliminate
View Answer

Answer: b
Explanation: This type of debugging is known as backtracking.

7. __________ involves the use of induction or deduction and introduces the concept of binary partitioning.
a) Brute force debugging
b) Backtracking
c) Cause elimination
d) Program slicing
View Answer

Answer: c
Explanation: Cause elimination bases debugging on the basis of induction.
advertisement

8. ________________ is the computation of the set of programs statements.
a) Brute force debugging
b) Backtracking
c) Cause elimination
d) Program slicing
View Answer

Answer: d
Explanation: The whole code is sliced into segments and their computation is known as Program Slicing.

9. The point at which the program slice affects the values at some point of interest is __________
a) Slicing criterion
b) Program criterion
c) Sliced Parts criterion
d) Information flow control
View Answer

Answer: a
Explanation: The slicing criterion is the point at which values start being affected.
advertisement

10. Program slicing can be used in ______________ to locate source of errors more easily.
a) Testing
b) Coding
c) Debugging
d) Checking
View Answer

Answer: c
Explanation: Program slicing is a debugging technique.

Sanfoundry Global Education & Learning Series – JUnit.
To practice all areas of JUnit for Interviews, 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.