Either a sandbox or VM. Virtual machines are easier, because they are on the same machine. For the purpose of this discussion, we will stick with sandbox as not everyone is knowledgeable about VMs.
Installing to the same version on a test mashine is the best way. Of course, you have to get around all the v9 roadblocks.