Designing Wireless Sensor Networks (WSNs) has proven to be a slow, tedious and error-prone process due to the inherent intricacies of designing a distributed, wireless, and embedded system. A systematic design approach accompanied by a test methodology supports the development of WSN software conforming to all design requirements including robustness and reliability. In this paper, we propose the fundamentals of such a test methodology. We present essential features of a framework for testing a broad range of WSN applications. We demonstrate with a case study that our test methodology is a feasible approach by integrating a number of existing design-tools for the TinyOS operating system. While we target TinyOS in the case study the proposed test methodology is general and not tailored to a specific WSN platform or operating system. Categories and Subject Descriptors C.3 [Special-purpose and application-based systems]: Real-time and embedded systems; D2.5 [Software Engineering]: Testin...