Skip to content
Sharp

Testing · interview question

When using Mockito, why is it important to mock dependencies at the boundaries of a system?

Multiple choiceMediumchapter-10-curatedpremiumtestingmocking-with-mockito
Choose one answer
Answer and explanation

Correct answer

C. To avoid testing implementation details

Why

Mocking at the boundaries of a system allows you to test the system's interaction with external components without getting into the details of their implementations. This helps in maintaining a clean separation between the system under test and its dependencies.

Test yourself on Testing

A free test with instant, explained results. No account needed.

Start free test
All Testing questions →