Stubs vs Mocks

Dear all,

As most of you already know, I’ve been studying and experimenting with unit testing concepts recently. I wasn’t clear about the differences between stubs and mocks and after some searching I came across this interesting article from Martin Fowler:

http://www.martinfowler.com/articles/mocksArentStubs.html

It would make a good read for anybody interested in the topic. The article show examples that use mock frameworks for Java so I did a search for C++ mock framework and found MockPP:

http://mockpp.sourceforge.net/

I haven’t tried it out but plan to do so soon. I’m now working on a remake of Connection and PacketSession with good unit test of course. I’ll publish a patch as soon as I have some good progress to show.

Best regards,

Peter

Would you like to post a relpy?


This post starts a thread.
Follow-ups:
Re: Stubs vs Mocks
Hi Peter, Thanks for your recommendation, it is a nice article to read! As the author says, it is hard to say which one is better. I think every technique has its (more...)