DEV Community

Discussion on: Better Tests with State Machines

Collapse
 
tkutz profile image
Thomas Kutz

Hey bob, nice article! But your hand-written state machine lacks a bit formality. Of course, this is just to showcase the idea, however, you could add variables and guards to make things a bit clearer. This here is a more formal specification of your queue (created with YAKINDU Statechart Tools):

Queue with YAKINDU Statechart Tools

Having things defined on that level would also allow us to automatically derive the branches to test and ultimately generate test code out of it. What do you think?

Collapse
 
rfornal profile image
bob.ts

Awesome ... thanks. Everything I put together for this article was roughed out. I didn’t have any plans to get that formal. Great information!