Explore topic-wise InterviewSolutions in .

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

51.

White box testing is also known as ______________(a) Black box testing(b) Sand box testing(c) Closed testing(d) Glass box testingI got this question in unit test.I need to ask this question from Mocking an HTTP Connection in section Testing with Mock Objects of JUnit

Answer»

Correct choice is (d) Glass BOX testing

Best explanation: WHITE box REQUIRES the internals to be KNOWN just as a glass box shows what is INSIDE.

52.

The __________ test relies exclusively on the external system interface to verify its correctness.(a) White Box(b) Unit(c) Black Box(d) LossThe question was asked in an internship interview.My doubt stems from Mocking an HTTP Connection topic in portion Testing with Mock Objects of JUnit

Answer» RIGHT answer is (C) BLACK Box

To explain: Black box tests have no KNOWLEDGE of the INTERNALS of the code.
53.

A ________________is a test that focuses on the interaction between components in their real environment.(a) Logic unit test(b) Integration unit test(c) Functional unit test(d) Acceptance unit testI had been asked this question during an interview for a job.This interesting question is from Refactoring with Mock Objects in chapter Testing with Mock Objects of JUnit

Answer» RIGHT choice is (b) INTEGRATION unit test

Explanation: Integration unit TESTING is a type of unit testing which tests COMPONENTS in their real environment.
54.

________________ is the computation of the set of programs statements.(a) Brute force debugging(b) Backtracking(c) Cause elimination(d) Program slicingThe question was asked in class test.The question is from Mock Objects in section Testing with Mock Objects of JUnit

Answer» CORRECT CHOICE is (d) Program slicing

Best explanation: The whole CODE is sliced into segments and their computation is KNOWN as Program Slicing.
55.

_______________ can easily be used to substitute application code with the test code.(a) Encapsulation(b) Polymorphism(c) Overloading(d) Static bindingThis question was posed to me in homework.Asked question is from JMock in chapter Testing with Mock Objects of JUnit

Answer» CORRECT choice is (b) POLYMORPHISM

The BEST explanation: Polymorphism is used to FORCE certain code patterns to be tested.
56.

____________ is a useful design pattern that ensures a class has only one instance.(a) Modular code(b) Lossless paradigm(c) Granular methods(d) SingletonThis question was posed to me in homework.Origin of the question is JMock in chapter Testing with Mock Objects of JUnit

Answer»

Right choice is (d) SINGLETON

Easy explanation: Most OFTEN, the implementation of a singleton defines a private CONSTRUCTOR and a STATIC variable.

57.

The ____________ parameter is used to specify the type of report.(a) datafile(b) basedir(c) encoding(d) formatThe question was posed to me in a job interview.This interesting question is from EasyMock topic in section Testing with Mock Objects of JUnit

Answer» CORRECT CHOICE is (d) format

The explanation is: The format PARAMETER defines the type of report to be generated.
58.

___________ tests are a superset of all other tests.(a) Unit(b) Integration(c) Loss(d) AcceptanceThis question was addressed to me in unit test.The above asked question is from Refactoring with Mock Objects in section Testing with Mock Objects of JUnit

Answer»

Correct choice is (d) Acceptance

The best EXPLANATION: Acceptance TESTS CONTAINS CHARACTERISTICS of other tests.

59.

The source code directories are used to calculate the ____________ of each class.(a) Data size(b) Lines of code(c) Cyclomatic code complexity(d) Mutant scoreThis question was posed to me in final exam.This intriguing question comes from EasyMock in chapter Testing with Mock Objects of JUnit

Answer» CORRECT answer is (c) CYCLOMATIC code complexity

Easiest EXPLANATION: The cyclomatic code complexity is a METRIC to indicate the complexity of the code.
60.

______________________ is the most common and least efficient debugging technique.(a) Brute force debugging(b) Backtracking(c) Cause elimination(d) Program slicingI got this question in an interview for internship.I'm obligated to ask this question of Mock Objects topic in portion Testing with Mock Objects of JUnit

Answer» CORRECT OPTION is (a) Brute force debugging

To EXPLAIN I would say: In brute force debugging, all possible combinations are used and studied.
61.

In a narrower sense, LCSAJ is also called ____________(a) JJ-Path(b) Code Coverage(c) System Code Analysis(d) Code BreakdownI had been asked this question in an international level competition.My question comes from Mock Objects in division Testing with Mock Objects of JUnit

Answer»

The CORRECT OPTION is (a) JJ-Path

Explanation: LCSAJ is now ALWAYS REFERRED to as a JJ-path.

62.

In order to write testable code, ______________ should be reduced as much as possible.(a) Dependencies(b) Redundancies(c) Objects(d) ClassesI had been asked this question during a job interview.Origin of the question is JMock topic in division Testing with Mock Objects of JUnit

Answer» RIGHT option is (a) Dependencies

Easiest explanation: CLASSES with too many dependencies REQUIRE COMPLICATED tests.
63.

____________ tests examine whether the application can process a large number of requests test types within a given period.(a) Unit(b) Integration(c) Stress(d) AcceptanceThe question was posed to me during a job interview.My question comes from Unit Testing with Mock Objects topic in chapter Testing with Mock Objects of JUnit

Answer»

Right ANSWER is (c) Stress

The best explanation: Stress tests should AUTOMATICALLY sends preprogramed REQUESTS and TRACKS how quickly the application responds.

64.

________ specifies the output directory for the instrumented classes.(a) −−datafile(b) −−destination(c) −−ignore(d) −−basedirI have been asked this question in an internship interview.Query is from Using Mocks as Trojan Horses topic in division Testing with Mock Objects of JUnit

Answer»

The correct option is (B) −−destination

Best EXPLANATION: The –destination PARAMETER is used to fix an output directory.