Let Moxy generate mock object code from your C++ interface definitions.
Moxy lets you generate mock objects on the fly from C++ header files. Mock objects allow interaction-based unit testing and can improve object decoupling.
See our work on the Presenter First design pattern for decoupling GUI programming for unit testing. Mock Objects are very helpful in supporting the development and testing of Model View Presenter code triads. We presented this library for the first time at the GLSEC Conference in Grand Rapids in November of 2007.
This version of Moxy is not yet “Battle Tested”, though the concepts behind the generator have been used in a couple of large scale C++ projects.
Moxy is open source software available under the terms of the Common Public License.
» Download
[ZIP] Moxy library (includes the entire Word Sort example, some of which is shown below)
Moxy uses the following tools:
[Python 2.4] The Moxy library uses the 2.4 version of Python. It has not been tested with newer versions.
[GCCXML] Note that GCCXML version 0.6.0 (the last official release) does not work properly with Visual Studio 2005. You’ll need to get the latest source code from the CVS repository and build it.
[pygccxml] A Python class that reads in the XML from the GCCXML tool and presents the data in a nice structure
Please let us know if you have any problems or questions.
Example Moxy Usage
Here is a snippet of the example code that is included with the Moxy download.