jMock

I just came across jMock, which is a Java library that uses reflection to make writing mock objects easier. Most of the testing I'm doing at work at the moment is in C++, but once we get to testing the Java parts I expect that jMock may come in very handy.

Posted on May 26, 2004 09:19 AM
More testing articles

Comments

Just curious if you prefer PyUnit to CppUnit?

Posted by: at July 3, 2004 10:01 AM

I prefer PyUnit, but that's because I'm doing system testing instead of unit testing. That is, I test against the actual executables, as built, rather than linking in tests with the C++ code and testing the underlying data structures. For that kind of thing, I prefer Python due to the rapid turnaround time of not having a compile step.

On the other hand, the lack of static typing in PyUnit can make it difficult to extend the framework -- as soon as you step outside of the usage patterns they planned for, you get all kinds of unintuitive errors, like "__init__ expects 2 arguments but was given 3". And since these errors occur pretty far down in the library, it can be very difficult to figure out what you did wrong. A static typing system would have made such mistakes easier to diagnose.

My general impression is that PyUnit was organically grown, and has no real concept of "this is the interface that an object needs to support in order to be considered a TestCase".

On the other hand, CppUnit has a beast of a language to work within, so it has lots of problems of its own. A proliferation of opaque macros, for example.

Posted by: Kim at July 6, 2004 02:08 PM
Post a comment









Remember info?




Prove you're human. Type "human":