JUnit Questions and Answers – Functional Software Testing


This set of JUnit Multiple Choice Questions & Answers (MCQs) focuses on “Functional Software Testing”.

1. ______________ are the first type of tests any application should have.
a) Functional Tests
b) Unit Tests
c) Integration Tests
d) Stress Tests
View Answer

Answer: b
Explanation: The main goal of unit testing is to verify that your application works as expected and to catch bugs early.

2. Unit tests allow greater test _____________ than functional tests.
a) Coverage
b) Redundancy
c) Prowess
d) Accuracy
View Answer

Answer: a
Explanation: Unit tests can easily simulate error conditions, which is extremely difficult to do with functional tests.

3. Functional tests are more _____________ compared to unit tests.
a) Fine grained
b) Accurate
c) Time consuming
d) Coarse grained
View Answer

Answer: d
Explanation: Functional Tests need the full application (or a good part of it) to be ready before it can be tested.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

4. Unit Tests can detect ________________
a) Regressions
b) Quality Check
c) Database Errors
d) Enforced Error
View Answer

Answer: a
Explanation: A unit test tells that a specific method is failing for a specific reason.

5. Agile methodologists favour writing code in _____________ slices to produce a working use case.
a) Horizontal
b) Small
c) Diagonal
d) Vertical
View Answer

Answer: d
Explanation: As opposed to writing code in horizontal slices to provide services layer by layer.

6. To retain a design across features, agile methodologies encourage ______________ to adapt the code base as needed.
a) Changing
b) Adapting
c) Refactoring
d) Duplicating
View Answer

Answer: c
Explanation: Unit tests tells when and where code breaks and gives the confidence to refactor.

7. The agile methodologies try to lower project risks by providing the ability to cope with ________
a) Change
b) Refactoring
c) Inefficiency
d) Redundancy
View Answer

Answer: a
Explanation: Agile methodologies allow and embrace change by standardizing on quick iterations.

8. ___________ is a principle of extreme programming (XP) that states that a functionality should not be added until deemed necessary.
b) MoSCoW Method
c) Overengineering
View Answer

Answer: d
Explanation: The foundation on which YAGNI rests is a solid bed of unit tests.

9. YAGNI stands for _____________
a) Your agile going now inside
b) You aren’t gonna need it
c) You are gonna need it
d) You are given no information
View Answer

Answer: b
Explanation: YAGNI being dependent on supporting practices is part of the original definition of XP.

10. YAGNI is a principle behind the XP practice of _______________
b) MoSCoW
c) WIB
View Answer

Answer: d
Explanation: DTSTTCPW is the acronym for “do the simplest thing that could possibly work”.

Sanfoundry Global Education & Learning Series – JUnit.
To practice all areas of Junit, here is complete set of 1000+ Multiple Choice Questions and Answers.

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.