Wireless Sensor Networks (WSNs) consist of a large number of wireless nodes and are responsible for sensing, processing and monitoring environmental data. WSNs suffer of some problems such as limited processing capability, low storage capacity, limited time of testing and limited reliability. The Compressed sensing theory holds promising improvements to these parameters. Compressed Sensing shows that spars signals such as signals of WSNs can be exactly reconstructed from a small number of random linear measurements. With this in mind, we introduce a new mechanism of testing in wireless sensor network with compressed sensing theory in order to design a robust WSN with high reliability factor. This paper gives a background of compressed sensing theory, and then describes important concepts in wireless sensor networks, and finally our research combines the compressed sensing theory with wireless sensor network to introduce a new method for testing of wireless sensor networks with compressed sensing theory.