one embodiment of the present invention provides a method and a system for synthesizing a scalable and incrementally updatable system software infrastructure for sensor networks . during operation , the system receives a specification for an application and a specification for target devices . the system analyzes these specifications in order to identify a set of software components required to support the application , and then proceeds to synthesize a customizable software stack that accommodates the identified set of software components on a specified target device . this process generates a minimal , resource - efficient software stack for a specific application on the specified target device .