A hypothesis test runs like a trial. The null hypothesis is the presumption of innocence: no effect, no difference, the claim is false. The alternative hypothesis is the prosecution's case. The data is the evidence, and the test asks a precise question: if the null were true, how improbable is evidence at least this strong? That improbability is the p-value. The logic is deliberately backwards, assuming the thing you doubt and watching the assumption strain, because statistics can measure surprise under an assumption far more easily than it can measure the probability that a claim about the world is true.
State the hypotheses before touching data, including which tail or tails count as evidence. Choose a significance level, conventionally 0.05, the rate of false convictions you are willing to tolerate in the long run. Collect data by a design that matches the test, compute the test statistic, a standardised distance between the data and the null's prediction, and read off the p-value. Then decide: reject the null, or fail to reject it. Note the lawyerly phrasing: tests never prove the null, they acquit it, and acquittal is not innocence established. A well-designed test also plans its power in advance, the probability of convicting when the effect is real, which is set largely by sample size.
The machinery fails in predictable ways. Choosing hypotheses or tails after seeing the data rigs the trial. Testing many outcomes and reporting only the significant one manufactures evidence, since one in twenty null tests cries wolf at the 0.05 level. Confusing statistical significance with importance convicts trivia when samples are huge. And treating a non-significant result as proof of no effect acquits on a technicality when the study was too small to see anything. None of these are flaws in the mathematics; they are flaws in the advocacy around it. A test is an argument with rules, and like any argument it is only as honest as the person presenting it. One modern reform deserves endorsement here: pre-registration. Declaring hypotheses, outcomes and analysis plans in a public registry before data collection converts the courtroom's rules from etiquette into evidence, making after-the-fact advocacy visible. Journals and funders increasingly require it for trials, and its spread into other fields is the healthiest trend in applied statistics. It costs researchers flexibility they were never entitled to and buys readers the ability to trust the verdict. When you read a striking test result, the registry is the first place to check whether the prosecution wrote its case before or after meeting the evidence.