Analyst Integration Question:

Download Job Interview Questions and Answers PDF

Why would you ever want to create a mock object?

Integration Programmer Interview Question
Integration Programmer Interview Question

Answer:

Mock object are very useful to test an individual unit in your Software, in fact stud and mocks are powerful tool for creating automated unit tests. Suppose you write a program to display currency conversion rates but you don't have a URL to connect to, now if you want to test your code, you can use mock objects. In Java world, there are lot of frameworks which can create powerful mock objects for you e.g. Mockito and PowerMock.

Download Integration Programmer Interview Questions And Answers PDF

Previous QuestionNext Question
What is loose-coupling?What is difference between forking a process and spawning a thread?