Statechart Autocoding for the Mars Science Laboratory MissionSeptember 9, 2018 at 3:24pm
I want to share an interesting talk I found about statecharts in production in NASA: https://www.youtube.com/watch?v=VvssxOP95s0
September 9, 2018 at 3:58pm
I summarize the key take-aways (for me) :
- 10 statecharts *intercommunicating*, 100 states (that seems to validate away the idea of one global statechart for everything)
- every transition must be started by an event (that seems to reject eventless transitions)
- no nesting orthogonal regions
- no same event on multiple transitions from the same state (that seems to reject event propagation)
- UML timers can be implemented with entry and exit actions
- avoid orthogonal regions
- cover every path through the statecharts
- what looks like a simple state machine grows larger when off-nominal behaviour is added (he probably means off-the-happy-path, so stuff like error flows and such)
Funny enough, timers are implemented with entry/exit actions in
xstate as well. Thanks for the summary @brucou - seems like some good best practices in general.
Absolutely. To nuance slightly, their context has safety-critical requirements, which obviously influence their set of practices. My feeling here is they avoid ambiguity like a plague and restrict the formalism in exchange for better safety properties. That might not translate as is to the UI domain (for instance, testing every path through the statecharts is a endless nightmare for any reasonably sized UI).
September 11, 2018 at 4:06pm