Modeling On-line tests in Safety-Critical Systems