What are two reasons to use mock objects in unit tests?

What are two reasons to use mock objects in unit tests?
A . The behavior of a given object can be emulated to the system under test
B. They are machine-generated and eliminate the need to write code by hand
C. To increase tight coupling
D. TDD is impossible without them
E. Isolating a particular system component for controlled testing

Answer: A,E

Explanation:

Mock objects are simulating the behavior of dependencies such as persistance layers or APIs. By mocking these you can be sure about what you are testing, and not accidentally testing the external dependency.

Latest PSD Dumps Valid Version with 120 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments