Event-driven programming is a popular methodology for the development of resource-constrained embedded systems. While it is a natural abstraction for applications that interface with the physical world, the disadvantage is that the control flow of a program is hidden in the maze of event handlers and call-back functions. TinyOS is a representative event-driven operating system, designed for wireless sensor networks, featuring a component-based architecture that promotes code reuse. In this paper, we present a web-based model-driven graphical design environment for TinyOS that visualizes the component hierarchy of an application, and captures its eventbased scheduling mechanism. In contrast with existing visual environments, our representation explicitly captures the control flow of the application through events and commands, which makes it easier to understand the program logic than studying the source code. The design environment supports two-way code generation: mapping the visual representation to TinyOS source code, as well as building visual models from existing sources.
展开▼