What is model-based testing?

Model-based testing is a software testing technique that uses a model to generate tests. A model is a description of a system’s behavior. In model-based testing, the run-time software’s behavior is evaluated according to the tests generated by the model.

Some examples of a model include the following:

Examples of models

The model-based testing technique describes how a system should behave in response to an action that is determined by a model. This concept is illustrated in the diagram below:

Model-based testing

Advantages

Model-based testing is a crucial part of the software testing process due to its many benefits. Some of these benefits include:

  • Allowing exhaustive testing.
  • Both time and cost-effective.
  • Ensures early detection of defects/bugs in the software.
  • Can be done on different machines.
  • If the model is modified, the changes can easily be tested.

Disadvantages

Despite the numerous benefits of model-based testing, there are a few challenges associated with it. These include the following:

  • If the model is modified, it can result in a new set of test cases.
  • The testing team must be skilled to perform this testing and hence, a learning curve is introduced.
  • The model needs to be formally specified before testing can take place.