Ability impairment can be assessed via behavioral and cognitive tests -- the same sort of tests that police use now when they suspect someone is driving under the influence of alcohol. The breath-test measures how much alcohol is in a person's system, but impairment is judged by functioning. If someone fails these impairment tests, biochemical analysis can determine if the assessed impairment is due to a specific substance. But, from what I can remember, "driving while ability-impaired" (DWAI) is an offense that does not require the person to have a measured amount of a substance in their body that leads to the impairment. I think a person can get a DWAI from sleep deprivation if that is causing their driving abilities to be reduced, but I'm not sure.