ExamGecko
Home Home / Scrum / PSD
Question list
Search
Search

Question 31 - PSD discussion

Report
Export

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
Answers
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
Answers
B.
They are machine-generated and eliminate the need to write code by hand
C.
To increase tight coupling
Answers
C.
To increase tight coupling
D.
TDD is impossible without them
Answers
D.
TDD is impossible without them
E.
Isolating a particular system component for controlled testing
Answers
E.
Isolating a particular system component for controlled testing
Suggested 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.

asked 23/09/2024
Kees den Dekker
43 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first