In practice random breath tests are not allowed.
However, the Police only have to show that they reasonably suspect a moving traffic offence has occurred to stop the vehicle and then to reasonably suspect that the driver had been drinking to require a breath test. Consequently, if there is anything that the Police do not like about the manner in which a vehicle is being driven this gives the Police grounds to stop the driver and carry out a breath test. The important issue is the Officer does not have to prove or even "believe" that an offence has occurred, merely that he "suspects" an offence has occurred.
If the vehicle is not moving the officer has to suspect that the driver had been drinking and that he had either driven or was about to attempt to drive. So seeing a driver get into a car in a pub car park would usually provide those suspicions.
In reality it would be very difficult to provide a defence against the offence on the lines that the stop or requirement for a breath test was unjustified. The very fact that the driver provided a positive test result would usually be sufficient to support the officer’s suspicions.