views:

32

answers:

1

I know there is TypeMock and JustMock, but both are commercial products and quite expensive. Are there free or open source mocking frameworks that can compete with the two?

I am currencly using Moq, but I'm wondering if open source can catch up? Maybe Moles is the answer (http://msdn.microsoft.com/en-us/library/ff798506.aspx), although it doesn't provide all typical features you would expect or maybe someone is already working on something like this http://www.testingreflections.com/node/view/8562

A: 

AFAIK, MS Moles can do everything you ever need. It's only that it is quite performance-demanding, and it has a quite hard-to-learn 'API' (which in sum makes it far more expensive than its commercial counterparts!).

Isolation frameworks like Typemock, JustMock, and Moles have a completely different technical background compared to free mocking frameworks like Rhino, Moq etc. So they cannot really be compared. You use a mocking framework to do TDD on a new project, if you have the necessary software design skills (basically S.O.L.I.D). You use an isolation framework if you have to write tests for legacy code, which was not written with testing in mind.

I don't think that there will ever be an open source project for an isolation framework. It's technically very demanding to get it right, and it's very unlikely that it could ever catch up with e.g. Typemock in terms of cost-effectiveness.. (And btw.: Moles is not OS and will never be...)

Thomas

Thomas Weller