3 ms·
You're comparing fuzzing and property based testing. Fuzzing is a way of generating a load of random inputs for a system under test. For example if you had a f
by exdsq 5y ago
You're comparing fuzzing and property based testing.
Fuzzing is a way of generating a load of random inputs for a system under test. For example if you had a function add(a, b) -> int you'd pass in numbers, strings, bytes, whatever you want and it'll let you know if it breaks.
Property based testing is similar but you check if properties hold across these values and the tool will then shrink this to the simplest case. For example you'd say that add(a, b) takes two integers and regardless of the numbers it should always have the associative property.
So in fuzzing you put in junk an see what happens, in pbt you define properties and check they hold across sane inputs.
- Too 5y agoIsn't fuzzing more than just random though? I was under the impression fuzzing could introspect branches in the code and work its way backwards to generate inputs to reach that coverage?
- exdsq 5y agoYeah it can get that advanced! But the distinction is still generating junk until you get errors while pbt is about checking business logic (properties) hold under random generators. Saying this I’m sure the cutting edge of both overlap!