logo
  • Home
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Contact

JUnit Multiple Choice Questions | MCQs | Quiz

JUnit Interview Questions and Answers
Pratice JUnit questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

JUnit - Exploring Core JUnit
JUnit - Parameterized Tests
JUnit - Test Runners
JUnit - Composing Tests Suite
JUnit - Controller Component
JUnit - Component Testing
JUnit - Exception Handling
JUnit - Timeout Testing
JUnit - Hamcrest Matchers
JUnit - Unit Tests
JUnit - Integration Testing
JUnit - Functional Testing
JUnit - Stress Testing
JUnit - Acceptance Testing
JUnit - Unit Test Types
JUnit - Black Box Testing
JUnit - White Box Testing
JUnit - Test Coverage
JUnit - Cobertura
JUnit - Testable Code Creation
JUnit - Test driven Development
JUnit - Development Cycle Test
JUnit - Stubs
JUnit - HTTP Connection
JUnit - Jetty Embedded Server
JUnit - Web Server Resources
JUnit - Stubbing Connection
JUnit - Mock Objects
JUnit - Mock Unit Testing
JUnit - Mock Objects Factors
JUnit - HTTP Mock Connection
JUnit - Trojan Horses Mocks
JUnit - Easy Mock
JUnit - JMock
JUnit - Unit Testing Limitations
JUnit - Mock Objects Solution
JUnit - In Container Testing
JUnit - Stubs Comparision
JUnit - Ant Basics
JUnit - Ant Targets & Projects
JUnit - Ant Tasks
JUnit - Ivy Management
JUnit - HTML Reports Creation
JUnit - Batching Tests
JUnit - Maven Introduction
JUnit - Maven Project Settings
JUnit - Maven Plug-ins
JUnit - Maven Surefire
JUnit - Maven Downsides
JUnit - Continuous Integration

« Prev Page
Next Page »

JUnit Questions and Answers – Testing the Controller Component

Posted on May 13, 2017 by staff10

This set of JUnit Interview Questions and Answers for Experienced people focuses on “Testing the Controller Component”.

1. Improving the design of existing code is known as __________
a) Refactoring
b) Improving
c) Betterment
d) Upgrading
View Answer

Answer: a
Explanation: Refactoring is the process of restructuring existing code, changing the design.

2. In what order is multiple @Before annotated methods run?
a) Oldest First
b) Newest First
c) Randomly
d) According to argument list
View Answer

Answer: c
Explanation: It is not certain which @Before annotated method will run first as all run randomly.

3. The ___________ method confirms that both references are to the same object.
a) assertEquals
b) assertEqual
c) assertEqualObject
d) assertSame
View Answer

Answer: d
Explanation: assertSame uses the == operator to compare objects.

4. The assertEquals() method uses which underlying method to compare objects?
a) ==
b) equals()
c) isequal()
d) =
View Answer

Answer: b
Explanation: The assertEquals() method makes use of equals() to compare objects, comparing identity.

5. The equals() method is inherited from which base class?
a) Object
b) String
c) Integer
d) org.junit.Equals
View Answer

Answer: a
Explanation: The equals() method is inherited from the Objects class defined in java.lang.Object.

6. To use Parameterized.class with the @RunWith annotation, we need to import __________
a) org.junit.runners.Parameterized
b) org.junit.Parameterized
c) org.junit.runners.Parameterized
d) org.runners.Parameterized
View Answer

Answer: a
Explanation: The Parameterized.class is a part of the runner class of JUnit.

7. To avoid overdesigning an interface, usually ____________ is used.
a) Agile Development
b) Test Driven Development
c) Base Design Development
d) Waterfall Development
View Answer

Answer: b
Explanation: Since test driven development is reliant on a very short development cycle being repeated, it is used to avoid overdesigning an interface.

8. The _________ is a sequential or non-iterative design process, which is used in software development processes, in which progress is seen as flowing steadily downwards.
a) Waterfall Model
b) Iterative Model
c) Spiral Model
d) Big Bang Model
View Answer

Answer: a
Explanation: In a waterfall model, each phase or part must be completed before the next phase can begin and there is no overlapping between the phases.

9. Controller logic component accesses the ________ logic component.
a) Class
b) Object
c) Business
d) Criteria
View Answer

Answer: c
Explanation: Business logic component is responsible for the business logic and delegates data access.

10. Overuse of argument _________ can lead to fragile tests.
a) Parameters
b) Objects
c) Classes
d) Captors
View Answer

Answer: d
Explanation: The system under test is no longer a black box.

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.

« Prev Page - JUnit Questions and Answers – The Controller Component
» Next Page - JUnit Questions and Answers – Testing Exception Handling
« 0 1 Knapsack Problem – Dynamic Programming Solutions
Integer Knapsack Problem – Dynamic Programming Solutions »

Deep Dive @ Sanfoundry:

  1. Java Questions and Answers
  2. RDBMS Questions and Answers
  3. Oracle Database Questions and Answers
  4. Digital Circuits Questions and Answers
  5. Artificial Intelligence Questions and Answers
  6. PHP Questions and Answers
  7. VLSI Questions and Answers
  8. Software Engineering Questions & Answers
  9. Software Architecture & Design Questions and Answers
  10. JUnit Questions and Answers
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and 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 & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
TOS & Privacy
Jobs
Bangalore Training
Online Training
SAN Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry