Explore topic-wise MCQs in Junit.

This section includes 13 Mcqs, each offering curated multiple-choice questions to sharpen your Junit knowledge and support exam preparation. Choose a topic below to get started.

1.

One of the main ways to decrease complexity is to try to avoid long _________ and if statements.

A. switch
B. then
C. default
D. static
Answer» B. then
2.

For wrtiting favourable tests, __________ is perferred over inheritance.

A. Encapsulation
B. Polymorphism
C. Overloading
D. Composition
Answer» E.
3.

At runtime, code can’t change a/an ___________ hierarchy.

A. Encapsulation
B. Polymorphism
C. Overloading
D. Inheritence
Answer» E.
4.

FOR_WRTITING_FAVOURABLE_TESTS,____________IS_PERFERRED_OVER_INHERITANCE.?$

A. Encapsulation
B. Polymorphism
C. Overloading
D. Composition
Answer» E.
5.

One_of_the_main_ways_to_decrease_complexity_is_to_try_to_avoid_long___________and_if_statements.$

A. switch
B. then
C. default
D. static
Answer» B. then
6.

At runtime, code can’t change a/an ___________ hierarchy?#

A. Encapsulation
B. Polymorphism
C. Overloading
D. Inheritence
Answer» E.
7.

_______________ can easily be used to substitute application code with the test code.

A. Encapsulation
B. Polymorphism
C. Overloading
D. Static binding
Answer» C. Overloading
8.

The obvious drawback of a singleton is that it introduces _____________ into the application.

A. Redundancies
B. Errors
C. Global State
D. Modules
Answer» D. Modules
9.

____________ is a useful design pattern that ensures a class has only one instance.

A. Modular code
B. Lossless paradigm
C. Granular methods
D. Singleton
Answer» E.
10.

________________ is a design guideline that states that one class should know only as much as it needs to know.

A. Law of knowledge
B. Class laws
C. Law of Demeter
D. Action methods
Answer» D. Action methods
11.

A solution to reducing dependencies is to separate code between methods that instantiate new ____________ and methods that provide application logic.

A. Classes
B. Objects
C. Modules
D. Functions
Answer» C. Modules
12.

In order to write testable code, ______________ should be reduced as much as possible.

A. Dependencies
B. Redundancies
C. Objects
D. Classes
Answer» B. Redundancies
13.

The Cobertura command for merging datafiles is ________________

A. cobertura-report.bat
B. cobertura-instrument.bat
C. cobertura-check.bat
D. cobertura-merge.bat
Answer» E.