We describe an approach for building and testing software for ubiquitous computing. The approach provides application-level emulators of ubiquitous devices. Since each emulator is implemented as a mobile agent, it can dynamically deploy its target software at each of the subnetworks that its device may be connected to and permits the software to interact with other devices and servers in its current sub-network. Therefore, the approach can test software designed to run a ubiquitous device in the same way as if the software was moved with and executed on the device when attached to the sub-network. This paper also presents some experiences with the development of ubiquitous computing software by using the framework. KEY WORDS mobile computing, ubiuquitous computing, mobile agent