• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why Mock Approach Testing Taken over traditional Junit Testing

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am having a query with respect of using Mock Objects for UnitTesting .
Why the Mock Testing approach has became famous in less time ?? Is Junit Testing isn't was sufficient ??
Isn't it difficult to create Mock Objects and test them , in case of a Mock Approach ??

Please share your opinions on this topic .

Thanks for reading.
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not quite sure I follow you train of thought here. Mock objects are simply a technique used in unit testing.
The use of test doubles (mocks/stubs/fakes) in unit tests is at times unavoidable if you want to test a unit in isolation.
I guess you are referring to the use of libraries like JMock and EasyMock in addition to (rather than instead of) the JUnit framework?
Those libraries simply make creating and using mock objects a lot easier (usually). JUnit and "mocking libraries" are not competing technologies.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mock objects are simply a technique used in unit testing.


Thanks for this Jelle klap , have a nice time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic