This set of JUnit Multiple Choice Questions & Answers (MCQs) focuses on “Unit Testing with Mock Objects”.
1. __________ is an error condition hiding another error condition.
a) Fault Masking
b) Error Hiding
c) Redundant Masking
d) Fault Gaping
View Answer
Explanation: Fault Masking is a type of redundancy analysis.
2. To get an expected test outcome a standard procedure is followed which is referred as ___________
a) Testing Mechanism
b) Testing Type
c) Test Cast
d) Test Scope
View Answer
Explanation: Testing types include Unit testing, API testing among others.
3. The test instantiates ___________ and calls methods on these _________
a) Objects
b) Classes
c) Services
d) Subsystems
View Answer
Explanation: The test class has to be instantiated and objects are created.
4. The test runs while a ___________ or EJB container hosts the application.
a) Objects
b) Classes
c) Servlet
d) Subsystems
View Answer
Explanation: The servlet attaches to any other external resource or device.
5. A layered application may have a front end to handle the presentation and a ______________ to execute the business logic.
a) Objects
b) Classes
c) Servlet
d) Back end
View Answer
Explanation: The front end is responsible for the presentation while the back end defines the logic.
6. ______________ tests examine the code at the boundary of its public API.
a) Unit
b) Integration
c) Functional
d) Loss
View Answer
Explanation: This corresponds to testing application use cases.
7. Developers often combine functional tests with __________ tests.
a) Unit
b) Integration
c) Stress
d) Loss
View Answer
Explanation: Functional tests are so designed so as to combine with integration tests easily.
8. Layering provides __________ and the ability to access the back end with several different front ends.
a) Flexibility
b) Redundancy
c) Authorization
d) Simplicity
View Answer
Explanation: Layering allows to separate the logic from the presentation.
9. ____________ 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) Acceptance
View Answer
Explanation: Stress tests should automatically sends preprogramed requests and tracks how quickly the application responds.
10. The stress test environment should be as close as possible to the __________ environment.
a) Design
b) Review
c) Test
d) Production
View Answer
Explanation: Otherwise, the results will not be accurate or useful.
Sanfoundry Global Education & Learning Series – JUnit.
To practice all areas of Junit, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check Programming Books
- Apply for Computer Science Internship
- Practice Programming MCQs
- Check JUnit Books