Version control - stubs and mocks

Posted by Tesserex on Stack Overflow See other posts from Stack Overflow or by Tesserex
Published on 2010-04-30T16:34:44Z Indexed on 2010/04/30 16:37 UTC
Read the original article Hit count: 371

Filed under:
|
|

For the sake of this question, I don't care about the difference between stubs, mocks, dummies, fakes, etc.

Let's say I'm working on a project with one other person. I'm working on component A and he is working on component B. They work together, so I stub out B for testing, and he stubs out A. We're working in a DVCS, let's say Git, because that's actually the case here.

When it comes time to merge our components together, we need to get the "real" files from my A and his B, but throw away all the fake stuff. During development, it's likely (unless I need to learn how to properly stub things) that the fakes have the same file names and class names as the real thing.

So my question is: what is the proper procedure for doing version control on the fakes, and how are the components correctly merged, making sure to grab the real thing and not the fake? I would guess that one way is just do the merge, expect it to say CONFLICT, and then manually delete all the fake code out of the half-merged files. But this sounds tedious and inefficient.

Should the fake things not go under VC at all? Should they be ripped out just before merging? Sorry if the answer to this should be obvious or trivial, I'm just looking for a "suggested practice" here.

© Stack Overflow or respective owner

Related posts about version-control

Related posts about stub