IGSTK State Machine Validation

From IGSTK
Jump to: navigation, search

Introduction

IGSTK components / Applications implementation relies on state machines. Generally state machines are first designed using visual modeling tools/ formal languages like UML. Code for implementation of state machines is generated directly from these tools or handcoded as per the design. However, the approach followed by IGSTK is somewhat different. In IGSTK, state machines are handcoded without any prior design. The only way to work with them external to the code is either to reverse engineer or explicitly export the state machines.

IGSTK Validation tool is designed to simulate IGSTK State machine validation system. It is a tool that validates safe design, implementation and execution of IGSTK state machines (IGSTK Architecture validation). It simulates execution of state machines by passing a series of events. It also provides the visual representations of different state machines. It is a portable generators tool. IGSTK Validation Tool Design

Block diagram

File:ValidationTool2.jpg

Validation tool components and their responsibilities

Generator

  • The generator component is responsible for generating a series of events that would be passed to individual state machines.
  • In the above block diagram, component 'Generator' consolidates all the events with the help of Process Log and Coverage Tool components and generates send-events XML file for further processing.

Simulator

  • The simulator has executors for individual state machines. Events generated by the generator are passed to the executor of state machine and the state machine behavior is captured in the form of logs.
  • Each event received by the simulator has a particular state machine Id associated with it and thus the simulator can fire events on corresponding state machine.

SMVIZ

  • SMVIZ stands for state machine visualization. This component is responsible for providing GUI to visualize the state machine.
  • SMVIZ component acts as a listener to the simulator component. When the simulator opens a state machine executor, the state machine is generated. SMVIZ component provides a GUI to the generated state machine.
  • State machine transitions caused by events passed by generator to simulator are reflected by coloring the current state and transitions in red by the smviz tool in the display.

Installation and Setup

System Requirements

   * Java 1.5 (Download here)
   * Ant 1.7 (Download here)
   * Windows XP, Mac OSX, Fedora Core ( The application has been tested on these three OS but it should work on any OS)

Folder Structure

   * IGSTK Validation Tool is present as a project 'IGSTK-VT-ELO' under CVS Repository.
   * Source code for generator  - IGSTK-VT-ELO/src/org/igstk/validation/generator
   * Source code for simulator   - IGSTK-VT-ELO/src/org/igstk/validation/simulator
   * Source code for smviz tool  - IGSTK-VT-ELO/src/org/igstk/validation/tools/smviz
   * Libraries required (jar files) - IGSTK-VT-ELO/lib
   * Icons required by smviz      - IGSTK-VT-ELO/icons
   * SCXML files representing the state machines used by IGSTK  - IGSTK-VT-ELO/xmlFiles/scxmlFiles
   * Send event files generated by generator   - IGSTK-VT-ELO/xmlFiles/sendEventFiles
   * Source code for unit testing the generator, simulator and smviz tool - IGSTK-VT-ELO/junit/src/org/igstk/validation/
   * CMake, Dart config files for submitting the results to a dashboard  - IGSTK-VT-ELO/junit/

Configuration (vtconfig.xml)

vtconfig.xml is the default configuration file. vtconfig.xml has information regarding what state machines to execute and where to get the events from to pass to the executors. Users can edit this file, or create a new file and change the vtconfig.xml file properties in properties file 'IGSTKVT_HOME/properties/igstkvt.properties' to change pointer to the newly created 'vtconfig.xml' file.

Environment Setup

Without Eclipse

  1. IGSTK Validation Tool is present as a project 'IGSTK-VT-ELO' under CVS Repository.
  2. Set the value of CVSROOT using following command:
     #> export CVSROOT=/var/cvs
  3. Login to the CVS using following command:
     #> cvs login
  4. Enter your password when system asks for the one.
  5. To checkout project 'IGSTK-VT-ELO,' execute following command:
     #> cvs co IGSTK-VT-ELO
  6. Set the environment variable 'IGSTKVT_HOME' to the directory where the validation tool has been installed.

With Eclipse

Eclipse provides plugin to setup CVS repository. The Eclipse CVS repository is a standard CVS implementation.

Steps to build and execute Validation Tool

With Ant:

  1. Compile validation tool components in following order:
        1. Compile ProcessLog
        2. Compile Generator
        3. Compile Simulator
        4. Compile SMVIZ
  2. Generate distributable of validation tool components using following commands:
         #> ant dist-generator
         #> ant dist-simulator
         #> ant dist-SMVIZ
  3. Run Validation tool components in the following order:
        1. Run ProcessLog Tool
        2. Run Generator Tool
        3. Run Simulator Tool
        4. Run SMVIZ Tool

Without Ant:

  1. Rename the file IGSTVT_HOME/properties/sim.log4j.properties to log4j.properties.
  2. Make a folder named 'classes' in IGSTKVT_HOME and compile all the java files in src folder to 'classes' folder.
  3. Run ProcessLog Tool
  4. Run Generator Tool
  5. Run Simulator Tool
  6. Run SMVIZ Tool

How it works:

Generator parses vtconfig.xml file for event resources such as send event files. It looks for send event files in IGSTKVT_HOME/xmlFiles/sendEventFiles folder.

Simulator parses vtconfig.xml for state machines to execute. It looks for corresponding scxml files in IGSTKVT_HOME/xmlFiles/scxmlFiles folder.

SMVIZ component provides the front end GUI to state machine for the user. It is a listener to the simulator. It opens state machine diagrams when simulator creates executors for the state machines. When events are passed by the simulator to a state machine, SMVIZ colors transitions and states in red, marking a transition occurred by the event. This gives visual representation to state transitions in a state machine.

Unit Testing:

Junit tests have been written for individual classes in the validation tool. They can be found in the junit folder in IGSTKVT_HOME. The command "ant run-junit" in IGSTKVT_HOME folder will run all the junit tests. On the other hand CMake scripts have been written and can be found in IGSTKVT_HOME/junit folder. Following are the steps to run junit tests using CMake.

  1. Run the command "cmake ." on the command line inside IGSTKVT_HOME/junit folder.
  2. Run the commane "make" in the same folder.
  3. (Optional) Run the command "make Nightly" or "make Continuous" or "make Experimental" to submit the junit test results to the dashboard.

JUnit test results can be submitted to a different dashboard by editing the file IGSTVT_HOME/junit/CTestConfig.cmake file. By default the results are posted to the 'IGSTK' dashboard on swf2.east.asu.edu.

Below are the properties in the file that decide this:

set(CTEST_DROP_SITE "swf2.east.asu.edu")

set(CTEST_DROP_LOCATION "/CDash/submit.php?project=IGSTK")

To submit the results on to 'TestProject' dashboard on 'www.mytestdashboard.org' edit the values as below:

set(CTEST_DROP_SITE "mytestdashboard.org")

set(CTEST_DROP_LOCATION "/CDash/submit.php?project=TestProject") Future Work:

   * Ability to hook up to a live running IGSTK instance and replay the events.
   * Expand the state machine display window size.
   * Good looking button icons.