The EasyMock project provides a library that simplifies the use of Mock Objects in interfaces. Unit testing is the testing of software units in isolation. However, most units in real world production environments do not work alone, but rather in collaboration with other units. To test a unit in isolation, we have to simulate the collaborators in the test. A Mock Object is a test-oriented replacement for a collaborator configured to simulate the object it replaces. In contrast to a stub, a Mock Object can also verify whether it has been used as expected.

EasyMock was the first dynamic Mock Object generator, relieving the need for users to hand-write Mock Objects, or generate code for them.

EasyMock generates Mock Objects on the fly using Java's proxy mechanism. Due to EasyMock's unique style of recording expectations, most refactorings will not affect the Mock Objects. This makes EasyMock a perfect fit for Test-Driven Development.

You can download EasyMock Here!

Posted by JavaBooks on Tuesday, July 21, 2009

1 Responses to EasyMock For Test Driven Development

  1. Anna Says:
  2. Great and Useful Article.

    Online Java Training | Online Java Training


Post a Comment


Label Cloud

Blog Archive

About Me