Reengineering C/C++ Source Code by Transforming State Machines

  • Authors:
  • Roland Knor;Georg Trausmuth;Johannes Weidl

  • Affiliations:
  • -;-;-

  • Venue:
  • Proceedings of the Second International ESPRIT ARES Workshop on Development and Evolution of Software Architectures for Product Families
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

State transition mechanisms are widely used in software engineering to implement state/event-dependent behavior. In C/C++, the implementation of state machines using 'switch/case' or 'if' statements causes problems in readability, understandability, maintainability, and modification. We have developed both a source code pattern searching tool capable of searching for state machine occurrences and a design pattern to replace state machines with C++ generic components. With 'ESPaRT' (Enhanced String Pattern Recognition Tool) we search for state machines in the source code. Examples of patterns for state machine detection are given in the paper. The state machine information is extracted and the state machine code is replaced by generic components following the 'generic Harel State Machine Engine' (HSME) design pattern.