This article analyzes the mission-based component testing problem of devices which consist of series connection of 1-out-of-n subsystems or series connection of m-out-of-n subsystems. The device is designed to perform a mission that has a random sequence of phases with random durations. It is assumed that the deterioration of the components of the system is modulated by the mission process in such a way that the component failure rates depend on the phase that is performed. The objective is to find optimal component test times that yield desired levels of system reliability. An algorithmic procedure that is based on a column generation technique and d.c. programming is presented. This procedure eventually solves a semi-infinite linear program and it is illustrated by numerical examples. The existence of optimal component test times is discussed and sufficient conditions for the feasibility of the underlying semi-infinite linear programming model are determined.