On a recent business trip, I noted two serious problems with the random searching of passengers about to board an aircraft.
The first problem was with the timing of the notification of the passenger. I was chosen for a search by a computer at the time my boarding pass was issued -- a full hour before my delayed flight was to be loaded. As the gate attendant handed me the pass, which was marked with the information, he told me I would be the subject of a search and asked me to report back early so that there would be time to complete the procedure. If I had brought forbidden articles to the gate, I could have passed them to an accomplice whose boarding pass indicated that he or she would not be searched.
The second problem, on a different airline, was with the non-random nature of the selection process. A fellow passenger informed me that the gate attendants for this particular airline always picked the first person in line. Once that person was released by security, the next person presenting a boarding pass would be picked. The passenger told me she makes it her practice to be the second or third person in line so that she may avoid a search. She and I shared a good laugh as the first person in line was sent over to security. We then sailed through the gate as the third and fourth in line.
To be of any value, these searches must be random and timed to maintain the advantages of surprise.