The followng experiment is considered. n units are tested simultaneously until either the rth failure occurs or a fixed time t0 is reached. In the first part of the manuscript, the failure times are assumed to be i.i.d. exponential with an unknown scale parameter 1/λ. The second part deals with the modification where failed units are replaced. In the third part, extensions to nonexponential failure times are outlined. Given r and t0, the goal is to minimize the expected cost as a function of n. Hereby, the cost is defined through three components c1, c2, and c3, respectively, which are associated with (1) the time length of the experiment, (2) the number n of units tested, and (3) some fixed overall cost of the experiment, respectively.