A Topological Criterion for Hypothesis Testing