Basic Theory
Main testing problem¶
Since complete testing of real systems is not feasible in practice, a suitable set of test cases must be selected to achieve a specific test objective. A statistical usage model, also called a Markov Chain Usage Model (MCUM), can be used to (automatically) derive individual test cases or complete test suites by traversing the MCUM. Statistical usage models are graphical representations for defining all possible usage steps and scenarios at a given level of abstraction, as shown in the figure below.
Statistical usage models¶
- usage states to model user behavior during the interaction with the system, and
- state transitions to specify the system's response to the user's interaction.
The probability that a user interaction triggers an event
ej
is called transition probability and is given after a colon, e.g. e4:0.3
to go from usage state A
into usage state B
. By adjusting the probability values of the usage distribution, i.e. the operational usage profile, it is easy to specify different usage behavior for different user classes. This allows the test engineer to automatically create different test cases for different system users.
Example: Usage states and transitions¶
For example, entering a search term into the search field of an Internet browser is an interaction between the user and the browser, and displaying a list of web pages that match the search term is the expected response of the system. Both the
usage states search item
and web page list
as well as the state transition
between these usage states that is triggered when the
interacting user presses the input key
are described in the
usage model.
Usually, there are many
alternatives to move from a given usage state to possible
successor states. For example, instead of pressing the input key
in our example another action can be performed, such as
select another web site tab
with the mouse. This takes
the user to another usage state.
Statistical usage models and test cases¶
Start State
and ending in the final End State
, considering the probabilities of the selected usage profile. A test suite is a set of test cases to achieve a specific test objective, such as covering all usage states or traversing all transitions at least once during the test execution.
- Automatic generation of a sufficient number of test cases
- Calculation of meaningful metrics for the test suite
- Determine stopping criteria for terminating the test execution.
- Average number of test cases required to cover all states and transitions of the usage model (steady state analysis)
- Probability of occurrence of a given state/transition in each test case (feature usage)
- Average length of a test case to estimate the test duration (source entropy)