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
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
Explanation: Testing types include Unit testing, API testing among others.
3. The test instantiates ___________ and calls methods on these _________
Explanation: The test class has to be instantiated and objects are created.
4. The test runs while a ___________ or EJB container hosts the application.
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.
d) Back end
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.
Explanation: This corresponds to testing application use cases.
7. Developers often combine functional tests with __________ tests.
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.
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.
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.
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.