Model based Testing is a software testing technique which checks the run time behaviour of the software under test and is checked against predictions made by the model. A Model is known as description of the system’s behavior and behavior can be described in terms of input sequences, actions, conditions, flow of data from input to output. It should be practically understandable and can be reusable, shareable, must have a precise description of the system under test.
There are many models available and also describe different aspects of the system behavior. Examples are:
- Data Flow
- Control Flow
- Dependency Graph
- Decision Tables
- State Transition Machines
Model Based testing also explains how the system behaves in response to an action. Supply chain and see if the system responds as per the expectations.
Consider an example which explains the simplified approach of writing poetry in the notepad and also possible action related to each step. For each and every action, test case which can be generated and also output is verified.
Types of Model based Testing
Basically there are two types:
- Offline/a priori: Generation of Test suites before executing it. A test suite is the collection of test cases.
- Online/On-the-Fly: Generation of test suites during Test execution.
Different models in Testing:
In order to understand the model based testing it is necessary to understand some of the models.
1. Finite State Machines
This model helps testers to assess the result depending on the input selected. There can be various combinations of the input which results in a corresponding state of the system. This system is governed by a group of inputs given from of testers. For example, system which allows employees to log into the application. In a current state, the employee is “Out” and it becomes “In” once he signs-into the system. Under the “in” state an employee can view, print, scan documents in the system.
2. State Charts
It is a continuation of Finite State Machine and can be used for complex and real time systems. State charts are used to explain various behaviours of the system. It is having the definite number of states. The behaviour of the system is analysed and represented in the form of events for each state.
Example: Defects are created in defect management tool with the status as NEW. Once it is fixed by the developers; it has to be changed to status Fixed. If a defect is not fixed, change status to re-open. State Chart should be designed in such a way that it must call for an event for each state.
3. Unified Modelling Language (UML):
It is a standardised general-purpose modelling language. UML includes a group of graphic notation techniques to create visual models of that can describe very complicated behaviour of the system.
It has activities like
- Business Process
- Programming Languages
Challenges faced by the Model based testing:
Movement in Model Based Testing in every organization obviously requires a high amount of investments and effort. The drawbacks of MBT in software engineering are:
- Required Skills in testers
- Learning time will be more
- It is difficult to understand the model itself.
- It is easy test case
- it improves test coverage
- It can Run different tests on number of machines
- Early defect detection
- Increase in defect count
- Cost is reduced.