google-code-export / umple

Automatically exported from code.google.com/p/umple
1 stars 0 forks source link

No warning for non-reachable states #492

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Enter the code below. Substate s1 of s2 is unreachable.

In general there should a warnings about unreachable states. A variety of test 
cases should be created, and a walking capability should be added, and this 
walking capability should be used to walk the machine, and determine if there 
are any possible unreachable states.

class X {
  sm {
    s1 {
      e->s2;
      e4 -> s4;
    }
    s1 {
      e1 -> s2;
    }
    s2 {
      s3 {e6 -> s1;}
      s3 {}
      s1 {e7 -> s2;}
    }
  }
  sm {
    s8 {
       e9 -> s9;
    }
    s9 {}
  }
}

class X {
  a;
  sm {
    s4 {}
    s5 {}
  }
}

Original issue reported on code.google.com by TimothyCLethbridge on 24 Jan 2014 at 10:17

GoogleCodeExporter commented 9 years ago
See also issue 497

Original comment by TimothyCLethbridge on 4 Feb 2014 at 8:45

GoogleCodeExporter commented 9 years ago
Question: Does a state machine always have a initial state? I am considering 
that the first state defined is also the initial state. Is that true?

Original comment by PedroAug...@gmail.com on 28 May 2014 at 2:36

GoogleCodeExporter commented 9 years ago
Issue 492

Description: In general there should a warnings about unreachable states. A 
variety of test cases should be created, and a walking capability should be 
added, and this walking capability should be used to walk the machine, and 
determine if there are any possible unreachable states.

Solution:

The main idea is: creating a method that marks(in this case putting in a List) 
all the states reachable through a certain state following the assumptions 
below:

State is reachable if:
A reachable state has a transition to it; Or
It is parent of a reachable state. 

This method starts on the start state (or states in case of a concurrent SM) 
and recursively verify these conditions.

After this process the method verifies if there is any SM state that is not in 
the reachable list. In this case a warning is raised.

Obs:
-Enumerations, even being a type of SM, are not processed by the method.
-By definition a start state is the first defined state of a SM.

Original comment by PedroAug...@gmail.com on 2 Jun 2014 at 8:07

GoogleCodeExporter commented 9 years ago
Attached the patch and issue summary.

Original comment by PedroAug...@gmail.com on 3 Jun 2014 at 2:53

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by TimothyCLethbridge on 4 Jun 2014 at 4:00