I like to create a finite-state machine for the given text below. While solving this, I came accross with several problems I listed at the bottom. (This example is in terms of testing (where you later derive tests of a specification which is in form of a state machine).)
Following specification of an elevator is given: The elevator is inside an house with access to the top/roof and can be requested from every storey (e.g. from outside). The top/roof of the house can only be approached if there is a key inside.
If the elevator is requested to any storey, then the elevator goes right there after having closed its doors. When elevator arrived, the doors open. The doors close, if the event timeout is triggered. If the elevator reaches the desired storey, then the event storeyReached (or topReached for reaching the top/roof) is triggered, as well as the event openElevatorDoors.
I'm not sure how to choose the initial state. It's all about an elevator roughly said and starts there (my second option would be roof AND storey but then we would have two initial states which seems wrong, we only can have one). But then the elevator itself is inside a house, so I need to use house as a state too...?
At some states, for example elevator, I used two events/edges to illustrate a decision, so only one of both events can be chosen, not both at once. This is fine like that?
- At the states storey and elevator, I made multiple events at one edge separated by a comma, is this possible too? Also I'm not sure about these self-edges :(