The systematic identification of infected individuals is critical for the containment of the COVID-19 pandemic. Currently, the spread of the disease is mostly quantified by the reported numbers of infections, hospitalisations, recoveries and deaths; these quantities inform epidemiology models that provide forecasts for the spread of the epidemic and guide policy making. The veracity of these forecasts depends on the discrepancy between the numbers of reported, and unreported yet infectious, individuals. We combine Bayesian experimental design with an epidemiology model and propose a methodology for the optimal allocation of limited testing resources in space and time, which maximises the information gain for such unreported infections. The proposed approach is applicable at the onset and spread of the epidemic and can forewarn of a possible recurrence of the disease after relaxation of interventions. We examine its application in Switzerland; the open source software is, however, readily adaptable to countries around the world. We find that following the proposed methodology can lead to vastly less uncertain predictions for the spread of the disease, thus improving estimates of the effective reproduction number and the future number of unreported infections. This information can provide timely and systematic guidance for the effective identification of infectious individuals and for decision-making regarding lockdown measures and the distribution of vaccines.