 <p>One thing you can do is to use the interface (i.e. the header files) and provide an implementation of your own, at least for those functions you care about. To switch between both versions essentially amounts to linking with different libraries: yours for testing, theirs for the real implementation.</p> <p>There are a few issues with that which can be addressed e.g. by only retaining the public interface and changing the private interface (on this case compilation needs to be directed at the different declarations, e.g. using different search pathes for the headers):</p> <ul> <li>often the stubbed version wants to store different data</li> <li>some object may need to construct private subobjects in specific ways</li> <li>inline function may call other functions you don't really want to implement</li> </ul>