Here is a calculator for estimating the number of individuals to test in a population to determine if a disease/infection is present. The premise is that, if the disease is present in the population, then a certain percentage or more of the population will have the infection. Therefore, if no animals test positive, the disease is not likely to exist (to a given level of confidence).
This calculator considers that the test may not be perfectly sensitive, but does not consider test specificity. The outcome is the number of animals to test to have a given confidence that the disease would be detected in an infected herd. Sample size to detect disease.