First of all, even if Phelps is taking performance enhancing drugs (PEDs), if they are not on the list than he is doing something, albeit morally wrong, that is not illegal. Second, swimmers at that level are tested so frequently and RANDOMLY (as are those in track and other sports) that they could not cycle on and off the PEDs.
Finally, the testing process is amazingly accurate as they use a very sophisticated chemical analyzer called a 'gas chromatograph'. Once the machine is calibrated (and it is calibrated every day before it is used), the machines are 100% accurate. To assure accuracy, two other machines are used to verify accuracy.
In pro sports there are policys regarding the use of PEDs that allow an athlete to use them without penalty. In particular, in the NFL and in MLB, athletes are taken into a room and told that if they are using PEDs that IF they come forward and secretly tell the coach or some other designated personel person, that their careers and salaries will not be impacted. The athlete will be given counseling, might lose a little playing time but, nothing negative will happen. If, however, the athlete does not "come clean" to their coach and they are found to be using PEDs, they will suffer penalties.
Ironically, many athetes egos are so big that they think they can beat the machine ... they can't and they pay for it. Regardless, these policies are subtle encouragements to use PEDs.
In swimming no such policy exists. Phelps is clean and swimming has rarely experienced a scandal regarding PEDs. Phelps' use of marjuana has nothing to do with his lack of use of anything else.
In the case of Mark McGwire ... there was no doubt that he was "juicing" as his body mass increased to abnormal proportions. I've got a Barry Bonds rookie card and the guy was so skinny that he was in danger of injury every time the wind blew. When he broke Hank Aaron's HR record, Bonds had a 54 inch chest and his neck and head looked as if he came from another planet. I had several social encounters with Jose Conseco in his early years with the Oakland A's. When he was new to MLB he had a body every guy would want to have. Now, he looks like a freak. Those were not subtle changes that those guys went through and Phelps shows no changes as those that would come with using PEDs.
Master's degree in exercise physiology and 30+ years of coaching swimming