JUnit Questions and Answers – Test-driven Development

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

Answer: a
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

Answer: b
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

Answer: c
Explanation: Negative testing tests that invalid inputs do not get passed by the code.
advertisement
advertisement

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

Answer: a
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

Answer: d
Explanation: The Output comparator is a useful feature for seeing exactly what the error is in a test failure.
Note: Join free Sanfoundry classes at Telegram or Youtube

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

Answer: c
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

Answer: d
Explanation: Memory leaks occur dynamically and hence, static analysis cannot identify them.
advertisement

8. _______________ ensures the original fault has been removed.
a) Regression testing
b) Re-testing
c) Negative testing
d) Positive testing
View Answer

Answer: b
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

Answer: c
Explanation: It removes redundant test cases, thus giving semi-random test cases.
advertisement

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

Answer: b
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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.