The detection of genomic regions that have been targeted by natural selection is a fundamental objective in population genetics. For this purpose and based on the concept of coalescent theory, several statistics were derived to test the neutral model of molecular evolution under the assumption of constant population size. However, within the last decade it became evident that this assumption is not warranted in many biological model organisms. For this reason, established theoretical results on neutral non-equilibrium models are extended within this work to obtain the second-order moments of various tree size and DNA polymorphism measures. Then, the obtained results are embedded in generalized versions of statistical tests to provide the possibility for testing the neutral model under variable population size, using two datasets of Drosophila melanogaster. Finally, the feasibility of the approach is further illustrated with the aid of several examples of various demographic scenarios. In conclusion, limitations and open research questions are discussed.