This article presents a technique that enables online testing of sensors through the superposition of the test stimulus onto the measurand. Perturbations due to the surrounding environment can very often introduce fluctuations in the test output creating a major concern for this type of sensor testing. In this paper, a signal processing technique is proposed where the test stimulus is encoded by a pseudo-random sequence in order to reduce the test output fluctuations. The trade-off between the level of rejection of a perturbation and the overall test time is studied. In the case of the MEMS accelerometer considered in this paper, it is theoretically demonstrated that the rejection is more than 20 dB for a test time of 2.55 s. Furthermore, excessively strong perturbations can be monitored so that the test status is updated only if the accuracy of the test signal permits so. The technique has been implemented on a demonstration board and validated on a vibration platform.