Module eqc_loadtest

This module provides generators and utility functions that can be used to combine QuickCheck with load testing.

Copyright © Quviq AB, 2014-2017

Version: 1.42.1

Description

This module provides generators and utility functions that can be used to combine QuickCheck with load testing.

Load Testing

QuickCheck is useful for finding software errors by testing functional behaviour. Load Testing aims to verify the behaviour of the system under heavy, but realistic, load under a longer period. The primary objective of load testing is to find the maximum sustainable load of the system. A secondary objective is to find software errors that have a higher possibility to occur under high load then when tested in a low load setting.

We advice to use a variety of QuickCheck techniques, such as mocking and fault-injection to validate the secondary objective of finding errors in the code. The QuickCheck library for load testing is primarily intended to be bridge between QuickCheck and a load testing tool in order to re-use models and properties one has created for functional testing in a load testing context.

Generators

QuickCheck generators have build-in shrinking behaviour. For most generators, this behaviour is optimized for finding minimal counter examples quickly. Each shrinking step corresponds to the execution of a test case. The longer a test takes, the more important it gets to execute as few tests as possible in order to get quick results. In load testing, tests should take some time and therefore the standard shrinking may result in ineffectively many shrinking steps.

Data Types

counterexample()

abstract datatype: counterexample()

A counter-example to a QuickCheck property, see eqc.

gen()

abstract datatype: gen()

A QuickCheck generator, see eqc_gen.

property()

abstract datatype: property()

A QuickCheck property, see eqc.

Function Index

counterexample/1Similar to eqc:counterexample/1 this function checks the property and returns either true or a counter example.
exponential/2Generator for exponential load.
linear/2Generator for linear load.
loadcheck/1This function checks whether a property holds by running tests until failure.

Function Details

counterexample/1

counterexample(Prop::property()) -> counterexample()

Similar to eqc:counterexample/1 this function checks the property and returns either true or a counter example.

exponential/2

exponential(Base::nat(), Margin::nat()) -> gen()

Generator for exponential load. This generator increases the load for each consecutive load test in an exponential way. With base 2 it doubles the load for each consecutive test. The margin defines when shrinking should stop: only values more than Margin away from a found failure are considered during shrinking.

linear/2

linear(Step::nat(), Margin::nat()) -> gen()

Generator for linear load. This generator increases the load for each consecutive load test linearly with Step increase. The margin defines when shrinking should stop: only values more than Margin away from a found failure are considered during shrinking.

loadcheck/1

loadcheck(Prop::property()) -> bool()

This function checks whether a property holds by running tests until failure. Note that this may result in an infinite run if the load is not increased. Provided that the property contains load generators, the load is increased in each consecutive test.


Generated by EDoc, Sep 18 2017, 16:17:38.