Let $X_1, X_2, \cdots$ be a sequence of independent identically distributed random variables drawn according to a probability measure $\mathscr{P}$. The two-hypothesis testing problem $H_0: \mathscr{P} = \mathscr{P}_0 \operatorname{vs.} H_1: \mathscr{P} = \mathscr{P}_1$ is investigated under the constraint that the data must be summarized after each observation by an $m$-valued statistic $T_n\varepsilon \{1, 2, \cdots, m\}$, where $T_n$ is updated according to the rule $T_{n+1} = f_n(T_n, X_{n+1})$. An algorithm with a four-valued statistic is described which achieves a limiting probability of error zero under either hypothesis. It is also demonstrated that a four-valued statistic is sufficient to resolve composite hypothesis testing problems which may be reduced to the form $H_0:p > p_0 \operatorname{vs.} H_1:p < p_0$ where $X_1, X_2, \cdots$ is a Bernoulli sequence with bias $p$.