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
View Answer
Explanation: Structure-based testing techniques use the internal structure of the software to derive test cases.
2. White box testing is ______________
a) Static
b) Dynamic
c) Infeasible
d) Time-consuming
View Answer
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.
a) Positive
b) Regression
c) Negative
d) Neutral
View Answer
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.
a) Positive
b) Regression
c) Negative
d) Neutral
View Answer
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
c) Capture/Playback
d) Output comparator.
View Answer
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 ___________
a) 1899,1900,2004,2005
b) 1799,1900,2004,2005
c) 1799,1800,2016,2017
d) 1600,1700,1800,1900
View Answer
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
View Answer
Explanation: Memory leaks occur dynamically and hence, static analysis cannot identify them.
8. _______________ ensures the original fault has been removed.
a) Regression testing
b) Re-testing
c) Negative testing
d) Positive testing
View Answer
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.
a) Random
b) Static
c) Semi-random
d) Equivalent-random
View Answer
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
View Answer
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.
- Buy JUnit Books
- Practice Programming MCQs
- Buy Programming Books
- Apply for Information Technology Internship
- Apply for JUnit Internship