A classical problem in mastery testing is the choice of passing score and test length so that the mastery decisions are optimal. Thsi problem has been addressed several times from a variety of view-points. In this paper the usual indifference zone approach is adopted with a new criterion for optimizing the passing score. It appears that, under the assumption of the binomial error model, this yields a linear relationship between optimal passing score and test length, which subsequently can be used in a simple procedure for optimizing the test length. It is indicated how different losses for both decision errors and a known base rate can be incorporated in the procedure, and how a correction for guessing can be applied. Finally, the results in this paper are related to results obtained in sequential testing and in the latent class approach to mastery testing.