Olete.in
Articles
Mock Tests
🧪 jUnit MCQ Quiz Hub
Junit Mcq Question Set 1
Choose a topic to test your knowledge and improve your jUnit skills
1. Which of the following is not correct about JUnit?
Junit provides test runners for running test
Junit cannot be run automatically
Junit is the open-source framework
Junit provides an annotation to identify test methods
2. Which of the following is an example of a web controller?
Php
Java
JUnit
Apache Struts Framework
3. Which of the following is not a mocking framework?
Mockito
EasyMock
MockJava
PowerMock
4. Which of the following is correct about Test Suite in JUnit?
@RunWith annotation is used to run the suite test
Test suite means bundle a few unit test cases and run them together
@Suite annotation is used to run the suite test
All of the Mentioned
5. Which of the following is also known as Beta Testing?
Unit testing
Functional testing
Box testing
Field testing
6. Which of the following is a free Java tool that calculates the percentage of code accessed by tests?
Maven
XUnit
JUnit
Cobertura
7. Which package contains interfaces that define jMock’s Domain Specific Embedded Language?
org.jmock.integration.junit3
org.jmock.lib.junit3
org.jmock
org.jmock.syntax
8. Class JUnitMatchers extends _________
java.lang.String
java.JUnit.util.*
java.util.Arrays
java.lang.Object
9. Which of the following test has to be completed before integration testing?
Unit testing
Load testing
Stress testing
Functional testing
10. Which of the following is the basic unit of development in Scrum?
Slice
Sprint
Cobertura
Manifesto
11. Which of the following translates ExpectationErrors into JUnit AssertionFailedErrors?
VerifyingTestCase
MockObjectTestCase
JUnit3Mockery
JUnit3ErrorTranslator
12. Which of the following is a JUnit Rule that manages JMock expectations and allowances?
JunitRule
JunitRuleMockery
JunitMockery
JmockRuleMockery
13. What is the full form of JJ in “JJ-path”?
Jump-to-Jump
Java-JUnit
Jump-in-JUnit
Just Jump
14. Which of the following is a Java HTTP (Web) server and Java Servlet container?
Ant
Maven
Zimbra
Jetty
15. Mocks are Trojan horses because they replace real ___________ from the inside, without the calling classes being aware of it.
Objects
Variables
Classes
Methods
16. Stubs usually provide high ______ in the tested system.
Mocking
Security
Confidence
Modularity
17. In which of the following test, Monkey Testing is also included in Android Studio as part of the standard testing tools.
Integration Testing
Functional Testing
Stress Testing
Unit Testing
18. Which testing is used for testing systems for which the specification takes in the form of rules or cause-effect combinations?
Load Testing
Decision Table Testing
Unit Testing
Functional testing
19. Which of the following rules helps to set up custom JUnit rules?
TestRule Interface
CreateRule Interface
RuleCreate Interface
RuleInitialize Interface
20. The JUnit hasItem() function is a ________
The JUnit hasItem() function is a ________
Instance Function
JUnitMatcher
Matcher
21. _______ is favoured over conditionals to better write testable code.
Polymorphism
Composition
Inheritance
Overloading
22. _______ is a programming practice that expects new code to be written only if an automated test has failed and also to eliminate duplication.
Object Oriented Testing
Test Driven Development
Acceptance Testing
Lossless Development
23. API stands for _________
Application programming interface
Application programming instruction
Android programming interface
Application performance interface
24. When the _________ is used as the method’s first client, it becomes easier to focus purely on the API.
Object
Class
Test
Stub
25. Eliminating duplication ensures that code is written that’s not only testable but also ______
Erasable
Maintainable
Upgradeable
Changeable
26. _____ platform builds the application from its various components.
Development platform
Integration platform
Acceptance platform
Stress test platform
27. The ___________ platform is the last staging area before production.
Development platform
Integration platform
Acceptance platform
Pre-production platform
28. On the development platform, _________ unit tests are executed.
Acceptance
Lossless
Logic
Functional testing
29. The ______ exercises the application under load and verifies that it scales correctly.
Development platform
Integration platform
Acceptance platform
Stress test platform
30. User feedback is got from the ________
Development platform
Integration platform
Acceptance platform
Stress test platform
31. To get an expected test outcome a standard procedure is followed which is referred as _____
Testing Mechanism
Testing Type
Test Cast
Test Scope
32. The test instantiates ___________ and calls methods on these _________
Objects
Classes
Services
Subsystems
33. The test runs while a ___________ or EJB container hosts the application.
Objects
Classes
Servlet
Subsystems
34. A layered application may have a front end to handle the presentation and a _______ to execute the business logic.
Objects
Classes
Servlet
Back end
35. _______ tests examine the code at the boundary of its public API.
Unit
Integration
Functional
Loss
36. Developers often combine functional tests with __________ tests.
Unit
Integration
Stress
Lossless Development
37. Layering provides _______ and the ability to access the back end with several different front ends.
Flexibility
Redundancy
Authorization
Simplicity
38. ____ tests examine whether the application can process a large number of requests test types within a given period.
Unit
Integration
Stress
Acceptance
39. The stress test environment should be as close as possible to the __________ environment.
Design
Review
Test
Production
40. To implement a custom URL protocol handler, the URL method __________ is called.
setURLStreamHandlerFactory
setURLStreamFactory
setURLStreamHandlerFactorySetting
setStreamHandlerFactory
41. ______ replace the objects with which the methods under test collaborate, offering a layer of isolation.
Classes
Mocks
Unified Stamps
Interfaces
42. _________ are empty shells that supply methods to let the tests have control of the behavior of all the business methods of the faked class.
Stubs
Jetty
Mocks
Interfaces
43. The most important point to consider when writing a mock is that it shouldn’t have any ______
Redundancy
Abstraction
Matchers
Business Logic
44. Applying the _________ pattern to a class means removing the creation of all object instances for which this class isn’t directly responsible and passing any needed instances instead.
Message Passing
Inversion Of Control
Observer Pattern
Strategy Pattern
45. ______ is an architectural pattern that stores in-memory object data in relational databases.
Active Record Pattern
Inversion Of Control
Observer Pattern
Strategy Pattern
46. _______ in computer science is a programming technique for converting data between incompatible type systems.
Active Record Pattern
Inversion Of Control
Object Relational Mapping
Strategy Pattern
47. The ___________ is a software design pattern that allows the interface of an existing class to be used as another interface.
Adapter Pattern
Bridge Pattern
Decorator Pattern
Composite Pattern
48. The _______________ is a design pattern that adds behavior to an individual object, either statically or dynamically, without affecting the behavior of other objects from the same class.
Adapter Pattern
Bridge Pattern
Decorator Pattern
Composite Pattern
49. The ____________ is a design pattern in object-oriented programming that allows object composition to achieve the same code reuse as inheritance.
Adapter Pattern
Bridge Pattern
Decorator Pattern
Delegation Pattern
50. When unit testing, it’s important to be able to control as much as possible of the environment in which the tests execute.
True
False
JUnit
none of the above
Submit