Model-based testing

from Wikipedia, the free encyclopedia

Model-based testing ( English model-based testing , MBT ) is a generic term for the use of models for the automation of test activities, and to generate test artifacts in the test process. This includes in particular the generation of test cases from models (e.g. using the UML ) that describe the target behavior of the system to be tested.

Goals and benefits

The main goal is not only to carry out tests (see test automation ) but to (partially) automate their creation. It is hoped that this will provide transparency and controllability in the creation of test cases, making the test process more economical and the test quality more person-independent.

Model categories for MBT

With MBT, the software to be tested or its environment (e.g. in the form of usage profiles) or the test itself is represented as a behavioral and / or structural model. [Roßner 2010] therefore differentiates between

  • System models
  • Environment models
  • Test models

in MBT use.

System models describe requirements for the software system and can be in the form of analysis or design models. They generally do not focus on the test and therefore in particular do not contain any test data (in the sense of a sample of all possible input data into the system). As a result, generation on such models can at most lead to abstract test cases (i.e. without specifying concrete values ​​for test data).

Test models can be created from existing system models , but offer more options for testing. They describe the test of a system and explicitly depict test decisions that a tester may only have made "in his head". In this way, not only test step sequences but also test data , test steps and, if necessary, test oracles can be modeled in them. As a result, it becomes possible to generate not only abstract, but also concrete, even complete and executable test cases from them. If a keyword-based notation is used for test steps in test models (see Keyword-Driven Testing ), test cases that can be executed automatically can even arise.

However, test models require the testers to have knowledge of creating models. This skill requirement can be decisive for the success of an MBT introduction.

MBT characteristics

Depending on which model categories are used and which role the models play in the model-based test process, one can speak of different characteristics and degrees of maturity of MBT. [Roßner 2010] defines the following:

  • In model-oriented testing , models serve as a guide and basis for the test design without the need for generators. Since models can bring significant quality advantages compared to natural language requirement specifications, the test quality already benefits here.
  • Model-driven testing refers to the use of generators to generate test artifacts, especially test cases, from models. Often, however, this is a unidirectional one-way tool street where z. B. the test results are not transferred back to the model.
  • If all relevant test information is maintained in model form and the tools are connected to a ring, one can speak of model-centric testing .

MBT tools

Depending on which models are to be the basis of the test generation and how far the generation is to extend, the use of commercial generators or the in-house development of a generator should be provided. An overview of commercial MBT tools can be found in [Götz 2009]. It also contains the following taxonomy for MBT tools:

  • Model-based test data generators are tools that, based on a model of the input and output data of the test object and certain control information, generate test data for the creation of abstract and / or concrete test cases. (Example: CTE, see classification tree method )
  • Model-based test case editors are tools that, based on an abstract model of test cases, generate concrete representations of the test case for manual execution or test scripts for automatic test execution.
  • Model-based test case generators are tools that, based on a model of the system behavior, the system environment or the test as well as certain control information, automatically generate several (logically related) test cases or test scripts according to configurable coverage criteria.

Another and more complex taxonomy can be found in [Utting 2007].

As a rule, it will be necessary to be able to control the test coverage during the generation process. The graph-based coverage measures known from the white box test methods are typically used here (see control flow-oriented test methods ), but other coverage strategies are also conceivable (e.g. based on risk information in the model).

Before generating, it is i. A. It is indispensable not only to test the generator, but also to apply suitable QA measures to the models to be processed. These include B. Reviews , tool-based tests against metamodels or model checking .

A tool that enables the description of a model, its graphic representation as flow charts up to the implementation and execution of test cases, is Spec Explorer from Microsoft , which is offered as a free add-on for Visual Studio.

In the area of ​​model-based determination of results ("test oracle") there are rule-based approaches that are intended to facilitate case processing. RapidRep

See also

Individual evidence

  1. Spec Explorer

literature

  • [Baker 2008] Baker, P .; Dai, ZR; Grabowski, J .; Haugen, Ø .; Schieferdecker, I .; Williams, C .: "Model-Driven Testing - Using the UML Testing Profile". Springer-Verlag, Berlin, 2008, ISBN 3-642-09159-8
  • [Bringmann 2008] Eckard Bringmann, Andreas Krämer. "Model-Based Testing of Automotive Systems", In: ICST, pp.485-493, 2008 International Conference on Software Testing, Verification, and Validation, 2008 (PDF file; 228 kB)
  • [Eckardt 2009] Eckardt, T .; Spijkerman, M .: "Model-based testing based on the fundamental test process". Contribution to TAV 28 in Dortmund, 2009
  • [Götz 2009] Götz, H .; Nickolaus, M .; Rossner, T .; Salomon, K .: "iX study model-based testing". Heise Zeitschriften Verlag, Hanover, 2009
  • [Güldali 2010] Güldali, B .; Jungmayr, S .; Mlynarski, M .; Neumann, S .; Winter, M .: "Starting aid for model-based testing: Decision support for project and test managers". OBJEKTspektrum 3/10, pp. 63–69, 2010
  • [Kramer 2016] Kramer, A., Legeard, B .: "Model-Based Testing Essentials - Guide to the ISTQB (R) Certified Model-Based Tester - Foundation Level". John Wiley & Sons, 2016, ISBN 978-1119130017
  • [Pretschner 2006] Pretschner, A .: "On the cost effectiveness of model-based testing". Dagstuhl Workshop MBEES: Model-based Development of Embedded Systems II, Braunschweig, 2006
  • [Roßner 2010] Roßner, T .; Brandes, C .; Götz, H .; Winter, M .: "Basic knowledge of model-based test". dpunkt-Verlag, 2010, ISBN 3-898-64589-4
  • [Schieferdecker 2007] Schieferdecker, I .: "Model-based testing". OBJEKTspektrum 3/07, pp. 39–45, 2007
  • [Utting 2006] Utting, M .; Pretschner, A .; Legeard, B .: "A Taxonomy of Model-Based Testing". Working Paper 4/2006, University of Waikato, 2006
  • [Utting 2007] Utting, M .; Legeard, B .: "Practical Model-Based Testing - A Tools Approach". Morgan Kaufmann Publ., Amsterdam, 2007, ISBN 0-123-72501-1
  • Justyna Zander, Ina Schieferdecker, Pieter J. Mosterman: Model-Based Testing for Embedded Systems (Computational Analysis, Synthesis, and Design of Dynamic Systems) , CRC Press 2011, ISBN 1439818452 .
  • Frank Böhr: Model-Based Statistical Testing of Embedded Real-Time Software with Continuous and Discrete Signals in a Concurrent Environment: The Usage Net Approach , Verlag Dr Hut 2012, ISBN 978-3-8439-0348-6 .

Web links