I am searching for a mocking framework for a large C++ project. I've tentatively chosen GoogleTest as the testing framework so I first looked at GoogleMocks. However, I then discovered TypeMock's Isolator++ which has two features I very much liked:
- It can mock anything.
- It allows you to add test coverage without changing legacy code (using method call interception & maybe some other magic). No need to splice in interfaces to add tests.
The drawback is that Isolator++ is a commercial product. I worry about vendor lock-in & such. Are there other frameworks which have the same capabilities? Perhaps something open source?
Let me also preclude a common criticism I've observed in other posts: "TypeMock encourages bad design. You should improve your design rather than use a tool which supports bad habits." (my paraphrase)
My response is this: I do want to improve design. I also want to add test coverage BEFORE refactoring. To that end, the ability to add tests with zero code changes is very attractive.