www.mockcentral.org mockcentral on sourceforge.net

May 13, 2009: MockCentral version 2.0.0 released!

All MockCentral components have been substantially enhanced for release 2.0.0. New features and upgraded code make using MockCentral significantly more powerful and efficient than ever before. See the news page for details.

about mockcentral

MockCentral is an easy-to-use, fully-featured set of tools that provides a new approach to java software testing using mock objects. It enables you to create and access libraries of mock objects defined in xml files external to the testing code, allowing for cleaner test cases and easy mock object organization and reuse. What's more, building mock object definitions with the MockCentralEditor application makes setting up mocks much less time-consuming, so if you're "test-infected", adding MockCentral to your tool kit might change your attitude about just how much code coverage you can afford to build into your tests. MockCentral is an open source project freely distributed under the Gnu General Public License.

Check out the getting started and demo pages to learn more and see MockCentral in action.

why mockcentral?

MockCentral originated when its author was writing test cases for a project with many complex EJB relationships and realized that there "might just be a better way" to keep track of the proliferation of mock object definitions. The need to detail many method expectations not relevant to an individual unit test but required by other routines invoked in the domain logic was cluttering up the testing code. Writing test case variations to test different scenarios when many mock objects were in play involved lots of duplication. Selectively binding and unbinding numerous proxies in the NamingContext in the right parts of the tests also required many lines of code. MockCentral uses an external server application loading the data from xml files and managing the mock object libraries to make these processes much cleaner and easier. It also provides an editor application used to easily edit the configuration files. This editor is implemented as an Eclipse Plug-In which offers lots of point-and-click functionality for defining and organizing your mock objects quickly and with very little effort.

Not surprisingly, we're big fans of the mock object testing approach and believe that it (combined with other strategies) can be key to producing efficiently testable java applications. In fact, by programing to interface, cleanly separating logic and presentation code and using mock object testing techniques, MockCentral itself is tested with a very high degree of code coverage: over 95% for the server and editor-core libraries and over 90% for the Eclipse plug-in.

MockCentral is offered in the hope that it will be useful to developers writing software tests using mock objects. Feedback is greatly appreciated and contributions from other developers to these projects are welcomed and encouraged.

latest releases

The latest MockCentral releases are: MockCentralServer version 2.0.0, MockCentralEditor-Core version 2.0.0 and MockCentral Eclipse Plug-in version 2.0.0. See the news page or the release notes accompanying the downloadable files on sourceforge.net for details.