The Holy Java

Building the right thing, building it right, fast

Posts Tagged ‘random’

Brief Intro Into Random/Stochastic/Probabilistic/Simulation/Property-Based Testing

Posted by Jakub Holý on June 28, 2013

John Hughes and Stuart Halloway had very interesting talks about random testing at NDC Oslo, a topic I have been ignorant of but want to explore more now. Contrary to the typical example-based unit tests where the developer specifies inputs, interactions, and specific validations, random testing generates random input data and/or sequences of interactions and the verification is based on more general checks. Random testing can check many more cases than a developer would ever write and cases that a human would never think of. It can thus discover defects impossible to find by the traditional testing, as has been demonstrated f.ex. on Riak.

Random testing typically starts by creating (likely a very simplified) model of the system under test. The model is then used to generate the random data inputs and/or sequences of actions (method calls). Then the tests are executed and their input and output data captured. Finally the results are validated, either against predefined “system properties,” i.e. invariants that should always hold true, or manually by the developer.

Related/also known as: generative testingproperty-based testing (a paper).

Read the rest of this entry »

Advertisements

Posted in Testing | Tagged: , , | Comments Off on Brief Intro Into Random/Stochastic/Probabilistic/Simulation/Property-Based Testing