Recent human effort has been directed at expanding pervasive smart environments. For this, ubiquitous computing technology is introduced to provide all users with any service, anytime, anywhere, with any device, and under any network. However, high cost, long time consumption, extensive effort, and in some cases irrevocability are the main challenges and difficulties for developing ubiquitous systems. Therefore, one solution is to initially simulate, analyze, and validate practices prior to deploying sensing and computational devices in the real world. Simulation, as a performance evaluation technique, has attracted attentions due to its speed, cost-effectiveness, repeatability, scalability, flexibility, and ease of implementation. Moreover, emulation, as a hybrid method, not only offers most simulation advantages but also benefits from tight control of implementation, as well as a certain degree of realistic results. Both simulators and emulators are significant tools for enhancing the understanding of ubiquitous sensor networks (USNs) through testing and analyzing several scenarios prior to actual sensor placements. In this regard, this paper surveys 130 simulation and emulation environments and frameworks, which were originally designed and adapted for USN. Of these 130, the 22 that have been widely used, regularly updated, and well supported by their developers are compared based on multifarious criteria. Finally, several studies that had favorably compared the performance of simulators and/or emulators are examined. We believe the present research findings will be helpful for students and researchers to pick an appropriate simulator/emulator, and for software developers and those who are keen on producing their own environment.