For us, its a case of blow in the breathalyser at the start of EVERY shift. Sequence number is recorded and you sign your name against it. Reading must me 0.000. A reading of up to 0.050 will see you stood down for an hour without pay, then re tested. If you still blow over 0.000 at that stage then its instant dismissal. If you are 0.000 BAC after the hour then you return to work with a First & Final Written Warning.
The drug testing is totally random. You might not get tested for 6 months, then you might get tested twice a week for 3 months. Pee in the cup, supervised. A Positive reading for any drug without an explanation will see you get a window seat, never to return. A positive result with a explanation will result in you being stood down pending GCMS results. If the results match your explanation then you return to work and you get paid for the rime you were off, if they don't match, its a window seat.
In terms of how they tell how much you had and when the limits are set I think by the Australian Medical Council or some other similar body. Drugs like most opiates will of disappeared from the urine within 3 - 7 days, in some cases as low as 3 days. marijuan_ will show a positive reading for up to a month, that one causes the biggest dismissals. heroi_ funnily enough has a very short half life and can be gone from the urine in as little as 12 hours.