An operational profile describes, in a probabilistic way, how a software is utilized by its users. It makes the testing procedure more realistic and efficient. We consider a model where the software is tested sequentially in all of the operations that it is designed to perform. The stochastic and deterministic model parameters involving costs and failures all depend on the operations. In particular, the failure process generated by each fault is quite general and debugging is not necessarily perfect. Our aim is to find the optimal testing durations in all of the operations in order to minimize the total expected cost. This problem leads to an interesting nonlinear programming formulation that can be solved using well-known procedures in convex optimization.