When writing a master/slave pair, it is good practice for the
master to support a command-line switch or environment variable that
allows callers to set their own slave command. Among other things,
this is useful for debugging; you will often find it handy during
development to invoke the real slave process from within a harness
that monitors and logs transactions between slave and master.
If you find that master/slave interactions in your program are
becoming nontrivial, it may be time to think about going the rest of
the way to a more peer-to-peer organization, using techniques like
sockets or shared memory.