I'm self-studying about hypothesis test in the context of RNGs. I'm building a hypothesis test from scratch. I'm taking the simplest statistical test I can think of: how many $1$s are there in the sequence sample? My null hypothesis is that the RNG is uniform, so I expect the average number of $1$s to be close to $n/2$, where $n$ is the size of the sample.
I believe (or I guess) the sample averages should follow a normal distribution. To implement the hypothesis test, I will have to know the variance, though.
What should I do here? Should I look at a good RNG and come up with a variance relative to my simple statistical test? This makes sense to me. A good RNG will likely present averages close to $n/2$, specially if $n$ is large. I could then empirically determine the variance this way.
Is there anything wrong with this construction? Can you advise? My main interest is not in testing real world RNGs. My main interest is in knowing how to do hypothesis test, but I'm looking for an example in this precise context.