Re: [Boost-users] Boost Statechart: general questionss about whatthelibrary can do

Hi Andreas Hmmm, at first that sounds more like a BGL problem than one for the statechart library. What you describe above is easy to do with an appropriately designed state machine but I'm not sure it would be the right abstraction. For what real-world problem do you plan to use Statechart? Actually, after I sent the mail I thought some more and yes, I realised that this can be more of a graph problem (shortest path or such...) so it would be easy to with the BGL. But I'd like to do it with Boost Statechart since my real-world problem is at heart a state problem (statechart). What I am trying to do is: * I have an embedded software to *test*. I am trying to develop a framework for somewhat automatically testing the software. If I look at the specification of the software, I have lots of possible states (specs mention a lot of UML like diagrams). I need to test if the software correctly respects the specification, that is, if it correctly changes from one state to another according to a given event. Since the diagrams are complex, and thus the state space is huge (sometimes more than 100 states), I'd like for my framework to be able to automatically go to a given state, to be able to test the software in that particular state. Eg, if you just start by powering up the device, I'd like to compute the paths (and thus, events, that have to be translated to commands sent to the embedded device) to go to a particular state. Do you think Boost Statechart would be a good abstraction? If yes, how can I implement some of the Boost algorithms for graphs (such as shortest path) to achieve what I need? Is it even possible from a technical point of view to convert a fsm to a graph and run BGL algorithms on it ? I am already quite familiar with the BGL as I used it extensively one year ago. Thanks.
When a transition is executed (automatically, or explicitely), can I call a function? That is, when an event is processed, can I implement some code that will be executed each time an event is processed ?
Yes, that is probably the feature every FSM library supports. Ok. Regards Jean-Noël

RIVASSEAU Jean Noel wrote:
What I am trying to do is:
* I have an embedded software to *test*. I am trying to develop a framework for somewhat automatically testing the software. If I look at the specification of the software, I have lots of possible states (specs mention a lot of UML like diagrams). I need to test if the software correctly respects the specification, that is, if it correctly changes from one state to another according to a given event.
Since the diagrams are complex, and thus the state space is huge (sometimes more than 100 states), I'd like for my framework to be able to automatically go to a given state, to be able to test the software in that particular state. Eg, if you just start by powering up the device, I'd like to compute the paths (and thus, events, that have to be translated to commands sent to the embedded device) to go to a particular state.
In general the library cannot know how many or what states a machine consists of (which is a side-effect of the scalability requirements), so there's no way how it could compute shortest paths. I still think this is more of a BGL problem than anything else. If you model the FSM in BGL with appropriate objects attached to edges, it should be fairly straight-forward to systematically test the behavior in each state. HTH & Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.
participants (2)
-
Andreas Huber
-
RIVASSEAU Jean Noel