The state pattern provides software designers with an implementation of state machine such that states and transitions are separated from the actual actions performed by a component. Dezyne is an environment supporting formal verification and code generation for the design of complex interactions between state machines. In this paper, we show a systematic approach to introduce Dezyne generated code in a state driven component built using the State Pattern. This first step towards the new standard in software Engineering is relatively easy and brings about many benefits, including, increase in code readability, state charts visualisation, synchronisation of documentation with code, and error-free code generation.
Innovation is driven by software. To support the further development of software intensive systems, a lot of software must be written in a short amount of time and with good quality. Major issues preventing the rapid improvement of these systems include the cost of ensuring software quality and the lack of software designers. It is very difficult to recruit the required personnel. Developing good quality software requires much effort. For instance, a lot of time is spent in keeping documentation and code synchronised. Also, when the system gets complex, it becomes very difficult to still see the big picture. Migration and other re-factoring tasks become harder and harder.
Model Driven Technologies (MDT) constitute promising solutions to help software intensive companies to be more productive. From models code is automatically generated. This generation is error-free. Many artefacts can be automatically generated from models: documentation, graphical representations like state charts or sequence diagrams. For many companies, a major challenge is how to access these new model driven technologies and gain their benefit. The question is how to introduce these new technologies while staying open for usual business. This is exactly the challenge addressed by this paper.
At ICT, our objective is to guide customers in adopting and deploying this innovative software engineering solutions. We want to guide them through several steps, each step improving their software engineering process and making them capable to sustain their market position and boost their innovation capabilities.
In this paper, we describe one of these steps, namely, the replacement of handwritten code with code generated from models in the context of state machines implemented following the state pattern. Models are written using the Dezyne language developed by Verum Software Tools . After introducing the necessary background, including Dezyne, the state pattern and a running example, we show our approach to replace handwritten code for states and transitions with code generated from Dezyne models. The Visual Studio projects and the Dezyne models can be found on-line .