The problem with this is that if you are to buy illegal drugs such as exstacy, you cannot verify its purity. This is another argument for legalization - quality control. I am saddened by what your friend is going through. There is no way to know what he was actually sold. The scientists are rating the actual drug. What you get on the street is a coin toss.
this is a good idea, but it makes it attractive to buy larger amounts of a known safe pill... which makes you much more vulnerable to a dealer rap if you get caught. Just another example of the insanity of our current policy.
You cannot obviously test for the presence of adulterants, but you can easily test in your own home for the relative presence of different common drugs in pills: http://www.eztest.com/