Adjusting the Model: Better Statistics

Understand how the statistics of the tests could be improved using the optional weight callback.

We'll cover the following

Adding the call-back

Let’s take a look at the call-backs

The call-back is in the test/prop_break.erl file in the code below between line 64 and line 73. It has been highlighted.

The call raises the probability of any call forcing a transition from ok to tripped and also increases the probability of all error calls in the ok state; the rest of calls remain neutral in terms of probabilities. These calls include error calls while already in the tripped state, manual blocks, and more.

Let’s run the code and see what we get.

Running the code

Get hands-on with 1200+ tech skills courses.