In the early phases, random testing to estimate what proportion of the population are infected is prohibitively expensive - you'd need to test hundreds of thousands to find just a few infected.
In the later phases, you want to know who has been infected, yet the commonly available test in fact measures who is currently infected (ie. It can't detect those who are still liable to get infected, which is what you need for good modelling).
Antibody tests which are being prototyped by many groups should fill this need.