  The experience of Singapur and South Korea makes it clear that under certain
circumstances massive testing is an effective way for containing the advance of
the COVID-19. In this paper, we propose a modified SEIR model which takes into
account tracing and massive testing, proving theoretically that more tracing
and testing implies a reduction of the total number of infected people in the
long run. We apply this model to the spread of the first wave of the disease in
Spain, obtaining numerical results. After that, we introduce a heuristic
approach in order to minimize the COVID-19 spreading by planning effective test
distributions among the populations of a region over a period of time. As an
application, the impact of distributing tests among the counties of New York
according to this method is computed in terms of the number of saved infected
individuals.
