Wireless Sensor Networks (WSNs) have the ability to sense their surrounding environmental conditions using battery operated sensor nodes. To ensure the nodes to work in a low power consumption mode for the long life of network, it is important that these networks are configured properly and are optimized for their usage scenario. Moreover, configuring the network should not be a difficult task since network administrator may not be familiar with WSNs specific platform. So, configuration techniques need to be studied for optimized performance of WSNs. In this book, we study two approaches by which WSNs can be configured easily - Macroprogramming and Query driven configuration of MAC protocols. The book presents simulation results which should be helpul while configuring WSNs. KeyWords: Wireless Sensor Networks, Energy-efficiency, Task-mapping, Macro-programming, Medium Access Control protocols, Query Driven Data Extraction, TinyDB, TOSSIM, TinyOS