The move, routine in some American schools, is designed to reassure parents worried about the increasing availability of drugs in the playgrounds, but it also raises questions over the invasion of pupils' civil liberties. Random testing has not been introduced in workplaces because to take samples without consent from an adult constitutes assault.
With about one-third of 15-year-olds having smoked cannabis, head teachers could also find themselves swamped with positive results.
Drug testing will not be compulsory for schools, but the prime minister said new guidance for heads next month will advise on how to start a programme if they wish. Heads who want to introduce it will have to gain appropriate consent from either the parents or the pupil, probably depending on the child's age. The move will not require a change in law.
A survey earlier this year suggested almost two-thirds of British parents would support random testing. Several private schools, including Eton, already use it.