Random drug testing in sports?

Okay, now I do know that they perform random testing on professional athletes around the world these days, but I always thought it was before or after games and thought it only involved a needle to draw blood or a cup for a urine sample. This was definitely not what I thought they were referring to when they meant “random” testing.