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.
advertisement

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.

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.
advertisement

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.

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.

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.
advertisement

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.

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn