This set of JUnit test focuses on “Test-driven Development”.
1. White box testing is also known as _____________
a) Structure-based testing
b) Black box testing
c) Free testing
d) Closed testing
Explanation: Structure-based testing techniques use the internal structure of the software to derive test cases.
2. White box testing is ______________
Explanation: White box testing tests the dynamic components of the code including their internal structure.
3. A _____________ test is when an invalid input is put and errors are received.
Explanation: Negative testing tests that invalid inputs do not get passed by the code.
4. A ____________ test is when a valid input is put and some action to be completed in accordance with the specification is expected.
Explanation: Positive testing checks that the correct output is produced for correct inputs.
5. Which tools is involved in the automation of regression test?
a) Data tester
b) Boundary tester
d) Output comparator.
Explanation: The Output comparator is a useful feature for seeing exactly what the error is in a test failure.
6. An input field takes the year as input between 1800 and 2016, the boundary values for testing this field are ___________
Explanation: Only option (c) has the 4 boundary values for the given input range of 1800 to 2016.
7. Static analysis cannot ____________
a) Enforce coding standards
b) Help in code understanding
c) Identify anomalies or defects in the code
d) Detect memory leaks
Explanation: Memory leaks occur dynamically and hence, static analysis cannot identify them.
8. _______________ ensures the original fault has been removed.
a) Regression testing
c) Negative testing
d) Positive testing
Explanation: Regression testing looks for unexpected side effects while retesting ensures the original errors are removed.
9. _____________ test cases are when random test cases are performed and equivalence partitioning is applied to those test cases.
Explanation: It removes redundant test cases, thus giving semi-random test cases.
10. ______________ is normally used to evaluate a product to determine its suitability for intended use and to identify discrepancies.
a) Supervisor Review
b) Technical Review
c) Decision Review
d) Design Review
Explanation: Technical Review is often performed as a peer review without management participation.
Sanfoundry Global Education & Learning Series – JUnit.
To practice all areas of JUnit for tests, here is complete set of 1000+ Multiple Choice Questions and Answers.