Today I wanted to let you know about a new, free, graphical tool called QM (QP-Modeler) for drawing state machines and generating production-quality embedded code. The main design objectives for QM are simplicity and minimizing the need to “fight the tool”. QM achieves this in several ways described below.
Compared to most other “high ceremony” modeling tools on the market today, QM is much simpler, code-centric, and relatively low-level. This characterization is not pejorative. It simply means that QM™ maps the design unambiguously and directly to C or C++ code, without intermediate layers of “Platform-Independent Models” (PIMs), “Platform-Specific Models” (PSMs), complex “Model-Transformations”, or “Action Languages”. All actions executed by state machines are entered into the model directly in C or C++.
No more "Fighting the Tool"
The primary design objective in QM™ was to respect your design decisions as much as possible and leave you in control, not only in the physical design of the generated code, but down to the exact details of arranging your states and routing your transitions. Noting is more frustrating as a tool that suddenly changes the arrangement of your diagrams, after you spent hours arranging the states and routing the transitions. QM™ will never to that.
A lot of thought went into drawing hierarchical state diagrams in QM™. In this respect, the tool is innovative and might work differently than other graphical state machine tools on the market. For example, QM does not use “pseudostates”, such as the initial pseudostate or choice point. Instead QM uses higher-level primitives of initial-transition and choice-segment, respectively. This simplifies state diagramming immensely, because you don’t need to separately position pseudostates and then connect them. Also, QM introduces a new notation for internal transitions, which allows actual drawing of internal transitions (in standard UML notation internal transitions are just text in the state body). This notation enables you to attach internal transitions and/or regular state transitions to a single choice point–something that comes up very often in practice and was never addressed well in the standard UML.
Capturing the Physical Design
The new, free QM tool from Quantum Leaps is different, because it was designed from the ground up around the code-centric approach. Unlike other graphical tools, QM gives you complete control over the generated code structure (a.k.a. the physical design), directory names, file names, and elements that go into every file. You can mix your own code with the synthesized code and use QM to generate as much or as little of the overall code as you see fit. At the low level, QM respects your graphical layout as much as possible and will not re-attach or re-route connectors, resize nodes, or adjust text annotations. You will find that you don’t need to fight the tool.
Digramming Hierarchical State Machines
How to Get It?
The QM tool is available now for a free download and free, unrestricted use from state-machine.com. I’d appreciate any comments about the tool, comparisons to other similar tools, code generation, UML, state machines, etc.