An integrated model based on a quality state-dependent reward structure is explored. The model allows the revenue stream responds to variation in the quality state. The production process is inspected according to a Markovmodulated Poisson process. Assuming a Markovian structure, we predict the quality state behavior. We determine an optimal production run length based on a stopping decision rule.