This set of JUnit Multiple Choice Questions & Answers (MCQs) focuses on “Refactoring with Mock Objects”.
1. A profiler can look for _________ in an application.
a) Bottlenecks
b) Redundancies
c) Nodes
d) States
View Answer
Explanation: The developer tries to optimize the bottlenecks.
2. ___________ tests are a superset of all other tests.
a) Unit
b) Integration
c) Loss
d) Acceptance
View Answer
Explanation: Acceptance tests contains characteristics of other tests.
3. A ___________ is a test that exercises code by focusing on a single method.
a) Logic unit test
b) Integration unit test
c) Functional unit test
d) Acceptance unit test
View Answer
Explanation: Logic unit tests are a type of unit test that focuses on a single method.
4. In logic unit test, the boundaries of a given test can be controlled by using __________
a) Objects
b) Mock objects
c) Controllers
d) Modules
View Answer
Explanation: Mock objects help perform specific tests by narrowing down to a specific task.
5. 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 test
View Answer
Explanation: Integration unit testing is a type of unit testing which tests components in their real environment.
6. Code that accesses a database has tests that effectively _________ the database.
a) Ignore
b) Delete
c) Call
d) Define
View Answer
Explanation: As a part of integration unit testing, the test has to call the database to test its components.
7. A _______________ is a test that extends the boundaries of integration unit testing to confirm a stimulus response.
a) Logic unit test
b) Integration unit test
c) Functional unit test
d) Acceptance unit test
View Answer
Explanation: Afunctional unit test is a type of unit test which extends the boundaries of integration tests.
8. _____________ more dependent on an external environment than pure unit tests are.
a) Logic unit test
b) Integration unit test
c) Functional unit test
d) Acceptance unit test
View Answer
Explanation: Functional Unit tests are not pure unit tests nor pure functional tests.
9. __________ are put in scope because they’re often useful as part of the battery of tests run in development.
a) Logic unit test
b) Integration unit test
c) Functional unit test
d) Acceptance unit test
View Answer
Explanation: Functional unit tests are more dependent on an external environment than pure unit tests are.
10. Functional Unit tests don’t test a complete ____________ as expected by pure functional tests.
a) Workflow
b) Object
c) Class
d) Functions
View Answer
Explanation: Functional Unit tests are not complete functional tests and hence, cannot test the complete workflow of the code.
Sanfoundry Global Education & Learning Series – JUnit.
To practice all areas of Junit, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check JUnit Books
- Check Programming Books
- Apply for Computer Science Internship
- Practice Programming MCQs