Java8 Qualis Interview Question-Answer Part – 2

Q.1 MockMvc builder ______ tests one controller at a time.

       A. xmlConfigSetup

       B. annotationConfigSetup

       C. standaloneSetup

       D. webAppContextSetup

Ans : standaloneSetup


Q.1 Identify the Java code coverage tool.

       A. PMD

       B. Jtrac

       C. JaCoCo

       D. Jwalk

Ans : JaCoCo


Q.3 JaCoCo collects events from ____ for performing code coverage analysis.

       A. JVM TI

       B. JDK

       C. ASM

       D. Java agent

Ans : JVM TI


Q.4 JaCoCo threshold rule can be configured for which element?

       A. BUNDLE

       B. class

       C. package

       D. All the options

Ans : All the options


Q.5 JaCoCo can be integrated with which Continuous Integration tools?

       A. Travis

       B. Codeship Inc

       C. Jenkins

       D. None of the options

Ans : Jenkins


Q.6 ______ goal can be used to generate code coverage reports in readable formats like HTML,CSV, XML etc.

       A. JaCoCo:report

       B. JaCoCo:prepare-agent

       C. JaCoCo:analyse

       D. JaCoCo:dump

Ans : JaCoCo:report


Q.7 Which among the following is a warning category as defined by the latest version of FindBugs?

       A. Bad Practice

       B. Dodgy code

       C. Performance

       D. All the options

Ans : All the options


Q.8 FindBugs performs static analysis of code to identify potential bug patterns.

       A. True

       B. False

Ans : True


Q.9 JaCoCo is an open source code coverage tool that generates coverage reports by instrumenting Java byte code.

       A. True

       B. False

Ans : True


Q.10 JUnit can be integrated with build automation tools like Maven, Ant, Gradle etc.

       A. True

       B. False

Ans : True


Q.11 FindBugs tool analyzes Java source code.

       A. True

       B. False

Ans : False


Q.12 This comes under which category of a bug: “Using string concatenation in a loop rather than using a StringBuffer?”

       A. Bad Practice

       B. Dodgy code

       C. Performance

       D. All the options

Ans : Performance


Q.13 _________ factor reflects the possibility of the bug patterns identified by FindBugs being real.

       A. Priority

       B. Confidence

       C. Critical

       D. Assurance

Ans : Confidence


Q.14 Bugs ranking from Rank 1 to 4 are classified as ________.

       A. Scary

       B. Troubling

       C. Scariest

       D. OfConcern

Ans : Scariest


Q.15 What is true about parameterized test class?

       A. Choosing the test method based on parameters passed

       B. Process of passing arguments to the test methods

       C. Executing the same test with different sets of parameters

       D. None of the options

Ans : Executing the same test with different sets of parameters


Q.16 Which among the following is a Java mocking framework?

       A. EasyMock

       B. Mockito

       C. PowerMock

       D. All the options

Ans : All the options


Q.17 Which of the following is a JUnit extension?

       A. Litmus

       B. Cactus

       C. Postgres

       D. Thymus

Ans : Thymus


Q.18 _______ in the MockMVC class is used to invoke a Spring MVC controller indirectly through a URI.

       A. .andGet()

       B. .andExpect()

       C. .andDo(print())

       D. .perform()

Ans : .andExpect()


Q.19 _______ is a goal that performs Checkstyle analysis during compilation to be configured with checkstyle plugin with maven pom.xml.

       A. checkstyle:checkstyle

       B. checkstyle:check

       C. checkstyle:verify

       D. checkstyle:report

Ans : checkstyle:check


Q.20 Comparison of String parameters using == or != is categorized as ________.

       A. Performance

       B. Dodgy code

       C. Bad practice

       D. Experimental

Ans : Bad practice


Q.21 Assertion methods for test cases are included in which JUnit class?

       A. Assertions

       B. Test

       C. CoreMatchers

       D. Assume

Ans : Assertions


Q.22 Checkstyle cannot check code layout and formatting issues.

       A. True

       B. False

Ans : True


Q.23 Checkstyle is a static code analysis tool that analyses Java bytecode.

       A. True

       B. False

Ans : False


Q.24 Mockito can mock asynchronous classes.

       A. True

       B. False

Ans : True


Leave a Comment