This paper gives the exact optimal solution to the problem of designin
g inspection schedules with fallible and time-consuming test procedure
s. The optimality criterion is designed to achieve a balance between t
he cost of inspections and the cost of undetected failure. The solutio
n is derived in continuous time, with arbitrary failure distribution,
and is based on infinite-horizon dynamic programming with time-depende
nt utilities, and with an additional optimization with respect to init
ial conditions. Results include uniqueness and monotonicity properties
of the optimal solution, as well as computational algorithms.