aspose file tools*
The moose likes Testing and the fly likes Why Mock Approach Testing Taken over traditional Junit Testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Why Mock Approach Testing Taken over traditional Junit Testing" Watch "Why Mock Approach Testing Taken over traditional Junit Testing" New topic
Author

Why Mock Approach Testing Taken over traditional Junit Testing

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

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.


Save India From Corruption - Anna Hazare.
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1768
    
    7

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.

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Mock objects are simply a technique used in unit testing.


Thanks for this Jelle klap , have a nice time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why Mock Approach Testing Taken over traditional Junit Testing