Laying Out State Machine Properties
Explore the structure of state machine properties in property-based testing. Understand the role of models representing system states, command generators tailored to state transitions, and validation methods that ensure system behavior aligns with expectations. This lesson helps you accurately design and test finite state machines in Elixir using PropEr.
We'll cover the following...
We'll cover the following...
The layout
State machine properties are very similar to regular stateful properties, conceptually speaking. They share the same three major components:
- A model, which represents what the system should do at a high level.
- A generator for commands, which represent the execution flow of the program.
- An actual system, which is validated against our model.
Since FSM properties are really a specialization of stateful properties, the differences are subtle.
Components of a finite state property
The model
The model for state machine properties keeps the same ...