Correctness Attraction: Live-Demo
Correctness attraction is the phenomenon that a system is able to recover from changes injected into its state, which is called perturbations, and yet produce a correct output. Here, you can apply our protocol to an implementation of a quicksort algorithm. For every integer (literals and expressions), a perturbation consists to add 1 with a given probability. In the other hand, it does the same for boolean literals and expressions by negating them.
Success rate: 0.0 %
Number perturbation / execution: 0.0
Run quicksort on 40 arrays of 100 integers with 0.05 (5%) of probability to perturb an integer point. It results with 100% of correctness ratio and between 170 and 180 perturbation per execution.
Run quicksort on 40 arrays of 200 integers with 0.05 (5%) of probability to perturb an integer AND boolean point. It results with a correctness ratio between 95% and 100%. The number of perturbation ranges from 1500 and 1700.
Run quicksort on 40 arrays of 100 integers with 0.5 (50%) of probability to perturb an integer point. The results correctness ranges from 25% to 40%. The number of perturbation per execution is between 10000 and 11000.
Run quicksort with the selected options, you can customize and create your own experiment using the slider of probability and advanced option.
Number of array to be sorted: 40
Number of element per array: 100
- The number of array to be sorted.
- The number of element per array.
- The type (Integer or Boolean) of the expression to perturb.
- The class of the perturbation point. (see sources for more information)