4 ms·
My favorite part of Hypothesis (also present in similar frameworks) is stateful testing [1]. Instead of just generating inputs to functions for you, it can also
by Jtsummers 4y ago
My favorite part of Hypothesis (also present in similar frameworks) is stateful testing [1]. Instead of just generating inputs to functions for you, it can also generate a sequence of actions for a stateful system. This is useful even when dealing with "pure" functions, like transformation systems. Suppose there is a sequence of transforms that can be selected at runtime and you want to know that they either lead to a valid state or some signal that the state is invalid (an exception is thrown or something like a Result type, containing either a valid value or an error value), the RuleBasedStateMachine will work for that, too.
[1] https://hypothesis.readthedocs.io/en/latest/stateful.html https://hypothesis.readthedocs.io/en/latest/stateful.html