Testing asymptomatic people for SARS-CoV-2 aims to reduce COVID-19 transmission. Screening programmes' effectiveness depends upon testing strategy, sample handling logistics, test sensitivity and individual behaviour, in addition to dynamics of viral transmission. The interaction between these factors is not fully characterized. We investigated the interaction between these factors to determine how to optimize reduction of transmission. We estimate that under idealistic assumptions 70% of transmission may be averted, but under realistic assumptions only 7% may be averted. We show that programmes that overwhelm laboratory capacity or reduce isolation of those with minor symptoms have increased transmission compared with those that do not: programmes need to be designed to avoid these issues, or they will be ineffective or even counter-productive. Our model allows optimal selection of whom to test, quantifies the balance between accuracy and timeliness, and quantifies potential impacts of behavioural interventions. We anticipate our model can be used to understand optimal screening strategies for other infectious diseases with substantially different dynamics.