loading...

re: Testing legacy code, part 1: How to start VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Great article! When testing your legacy code, do you prefer using a powerful mocking framework or performing more integration tests?
 

Hi! Thank you for response. Well in general I always try to create a scenario that uses real world data. E.g. either creating end-to-end test for specific component, or integration test that would connect to development infrastructure.

But there are also times, where mocking is required, but this is mostly connected to testing specific corner cases that are hard to re-create. It is always something that must be approved within the team.

 

Thanks for your answer!
I agree - sometimes mocking is necessary, but not all frameworks give you the ability to do what you need...
Do you know any good mocking frameworks?

Well for Java we mainly use frameworks/libraries that I mentioned in my next post, e.g. Mockito /w PowerMock, WireMock, etc. and yes, there's no silver bullet to everything, so you need to find the ones for your use case.

Also, the more "advanced techniques" you are using, the more you need to be cautious about your test setup, since a lot of frameworks that have their own classloader or use bytecode manipulation will interfere with each other.

Thanks!
Have you heard about Typemock by any chance?
We started evaluating them and I'm looking for feedback...

Unfortunately I am not familiar with .NET/C/C#, so no :(

Alright, thanks for your answers!

Hi Hila,
resuming a very cold post... did you finally try Typemock?

Code of Conduct Report abuse