Anticipating from the start the various ways a research programme can succeed or fail can avoid problems later. Here’s how to do it.