QoS-Aware Fault Detection in Wireless Sensor Networks