menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Statecharts

The Statecharts community on Spectrum is (along with spectrum) MOVING TO OTHER PLATFORMS: For statecharts discussions in general go to Statecharts Discussion on GitHub (link) or Gitter (link). For XState-specific questions, go to the XState discussion forum for Q&A or the Stately discord chat to chat.

Channels
Team

Statechart Autocoding for the Mars Science Laboratory Mission

September 9, 2018 at 3:24pm

Statechart Autocoding for the Mars Science Laboratory Mission

September 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
Yes, in which they discuss how they use Magicdraw statechart diagrams (!) and generate (C, C++) code. Their statechart autocoder is now open sourced: https://github.com/JPLOpenSource/SCA
like-fill
2
nice find!
like-fill
1
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)
like-fill
3
Funny enough, timers are implemented with entry/exit actions in xstate as well. Thanks for the summary - seems like some good best practices in general.
like-fill
1
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).
like-fill
3

September 11, 2018 at 4:06pm
Great find! This is super interesting.
like-fill
1