Unit testing
-
Hi I am not sure what is the right forum to publish this in (here or in the C++ forum) But I coudln't find any information about it too, which is odd. Anyway, Unit testing in C++: Since it is not as popular as unit testing in other high level languages, I need your recommendations and insights. I have a lot of legacy code- I was just given a project to which I have to have covered by at least 70% unit tests. I need to do a lot of refactoring. Different tools (mocking tools) offer different things and has different limitations. So it might be smarter to ask the people who have already done this and know better than I do - what do you use? Is there a mocking tool (along with a supported testing framework) that can mock concrete classes, virtual, static and non static method, private methods, etc? Thanks a lot for your help:)
-
Hi I am not sure what is the right forum to publish this in (here or in the C++ forum) But I coudln't find any information about it too, which is odd. Anyway, Unit testing in C++: Since it is not as popular as unit testing in other high level languages, I need your recommendations and insights. I have a lot of legacy code- I was just given a project to which I have to have covered by at least 70% unit tests. I need to do a lot of refactoring. Different tools (mocking tools) offer different things and has different limitations. So it might be smarter to ask the people who have already done this and know better than I do - what do you use? Is there a mocking tool (along with a supported testing framework) that can mock concrete classes, virtual, static and non static method, private methods, etc? Thanks a lot for your help:)
Hi,
I recall being in the same situation 2 years ago.I had a lot of legacy code in my project and I had write unit tests for it.
I have spent hours on researching and trying different tools for the task I was given, and it was not easy to find mocking tools
that could satisfy my needs when it comes to different limitations I had which are similar to the ones you mentioned.
I have tried different ones but then found GMock and later on FakeIT, both did quite a good job but couldn't help me with
concret&static classes, private/static/virtual methods and I had to do a lot of refactoring in my code.
Researching a little more and I found Isolator ++ (which is actually free now, I had to pay back then), which amazingly took care of such cases
and saved me a lot of time...so you know where my recommendation goes to :slightly_smiling_face: -
Hi I am not sure what is the right forum to publish this in (here or in the C++ forum) But I coudln't find any information about it too, which is odd. Anyway, Unit testing in C++: Since it is not as popular as unit testing in other high level languages, I need your recommendations and insights. I have a lot of legacy code- I was just given a project to which I have to have covered by at least 70% unit tests. I need to do a lot of refactoring. Different tools (mocking tools) offer different things and has different limitations. So it might be smarter to ask the people who have already done this and know better than I do - what do you use? Is there a mocking tool (along with a supported testing framework) that can mock concrete classes, virtual, static and non static method, private methods, etc? Thanks a lot for your help:)
I guess I'm a bit late for the party. But I still think it's a useful reminder that if you want to check your application for correctness you may employ other tests as well. I.e. end-to-end tests. Might be easier to get a legacy system under test with them