Canines need to be well trained, if it goes to court the need to prove the dogs won't point if there are no drugs (or whatever the dog looks for) so if there isn't good reason to suspect you they won't bother (depending on how far away a dog is) they are just threatening as if you are guilty you may give up.
There are also rules about how long they can detain you while waiting. See a lawyer (the rules may not be good but you can get off in court if they are 'too long')
They do need to prove it. It's just that they treat it like a radar gun - they take the last certification testing as the proof. It's very rare to get to re-examine them.
It's impossible for a test to prove that a canine ONLY alerts to contraband. It doesn't matter how many controlled tests it has passed, dogs could nevertheless be responding to conscious or unconscious signals from an officer who is already expecting to find drugs.
There are also rules about how long they can detain you while waiting. See a lawyer (the rules may not be good but you can get off in court if they are 'too long')