The five steps, in order
Hypothesis testing is a procedure, and its conclusions only mean anything if the steps happen in the right order. Decide the hypotheses and the significance level before looking at the results; compute after. Here is the full sequence on one running example.
Step 1: state the hypotheses. A claim about a parameter, in two versions. A bakery's loaves are labelled 400 g (in units of 10 g, 40): H0: μ = 40 (the label is right), H1: μ ≠ 40 (it is wrong, either way). The null gets the benefit of the doubt; the alternative is what evidence must establish.
Step 2: set the significance level. α = 0.05, chosen now, before data: the false-alarm rate you accept.
Step 3: choose the test and check its conditions. One sample, unknown σ, roughly symmetric data: the one-sample t test. Conditions are part of the decision, not an afterthought: independent observations, no extreme outliers, sample drawn representatively.
Step 4: compute the statistic and the p-value. Eight loaves: mean 44.5, s = 4.75. t = (44.5 − 40) / (4.75 / √8) = 2.679 on 7 df, giving p = 0.0316.
Step 5: decide, and say what it means. p = 0.0316 < α = 0.05: reject H0. In context: the loaves average significantly above the labelled weight; the 95% interval (40.53 to 48.47) sizes the discrepancy. The decision is a rule applied to evidence, not a verdict on reality: at α = 0.01 the same data do not reject, and both statements belong in an honest report.
Reordering the steps: peeking at p, then choosing α, tails or hypotheses to fit it. Every such adjustment quietly raises the real false-alarm rate above the stated one. The procedure's guarantees are payment for its discipline.
One tail or two?
Two-tailed (as here) whenever either direction would matter or surprise you. One-tailed only when one direction is genuinely impossible or irrelevant and that was settled before the data: a one-tailed test at 0.05 spends all its error budget on one side, halving its p-value for effects in that direction, which is exactly why the choice cannot be made after seeing the sign of the result.
The write-up formula
Report: the hypotheses, the test, the statistic with df, the exact p, the effect size with its interval, and the decision in plain words. "Loaves averaged 44.5 (95% CI 40.5 to 48.5), significantly above the labelled 40, t(7) = 2.68, p = .032" is a complete sentence of statistics.
Frequently asked questions
Why must alpha be set before the data?
Because alpha is a promise about error rates. Choosing it after seeing p (0.04 becomes 'significant at our 0.05 level', 0.06 becomes 'we used 0.10') converts the procedure into a rubber stamp and the real error rate becomes unknown.
What if p lands just above alpha?
Report it exactly (p = 0.06), with the effect size and interval, and let the reader judge. The line is a decision convention, not a truth boundary; evidence at 0.06 and 0.04 is nearly the same evidence.
Do I always need a null hypothesis?
For a test, yes: the p-value is computed under it. For estimation questions, skip the test and report the confidence interval, which answers 'how big, how precisely' without a null at all.