Test function

ϕ(x1,,xn)={1if (x1,,xn)C,0if (x1,,xn)Cc

If ϕ(x1,,xn)=1, reject H0
If ϕ(x1,,xn)=0, do not reject H0

Example

ϕ(x1,,xn)Bernoulli(p), E(ϕ(x1,,xn))=p

α=P(reject H0|H0 is true)=P(ϕ(x1,,xn)C|H0 is true)=E(ϕ(x)|H0 is true)β=P(do not reject H0|H0 is false)=P(ϕ(x1,,xn)Cc|H0 is false)=1E(ϕ(x)|H0 is false)