A graphical description of the behavior of the system is known as a Model. System’s behavior can be defined in terms of series of input sequences, actions, pre-conditions and post-conditions, output and flow of data starting from input to the output received. It should be practically understandable and can be reusable; shareable must have a precise description of the system under test. A model helps us to determine the system behavior under test. The Model Based testing is a lightweight formal method which is used to validate a system. Such testing method is applicable to both hardware and software testing. We use the system requirements in order to generate the efficient test cases with the help of a Model. Given below is an overview of a model based testing.
- Develop a model.
- Determine various inputs for this model.
- Determine expected output for this model.
- Execute the tests.
- Compare the returned result against the expected output.
- Make the decision on the action on the model.
Modeling language:
One of the popularly known languages for modeling is Unified Modeling Language (UML). It is a homogenous general-purpose modeling language which includes a set of graphic notation techniques that are used to create visual models. These graphics notations are capable to describe the very complicated behavior of the system in a simplified manner.
The following are UML notations.
- Activities: It defines the piece of work which can be done by the actor. E.g., if a tester is an actor then software testing is an activity.
- Actors: It defines the person or actor who performs a particular task of activity.
- Business Process: It is a graphical representation of the processes which are carrying out the actual business.
- Components: They presents the code base or the module which act as a black box to perform a particular task at the application level.
- Programming language: It represents the actual programming language used for coding, it could be building the actual software application or writing test scripts for test automation.
Types of Modeling Techniques:
The following are various modeling techniques which are frequently used for the generation of the test cases after describing different aspects of the system’s behavior.
- Data Flow: In this modeling approach, the data flow diagram is prepared where we define the input data as well as the expected data. The data flow is modeled as a diagram known as DFD (Data flow diagram).
- Control Flow: In this modeling approach, the control flow diagram is taken into the picture and the main focus of the testing is on the control flow. The control flow is modeled as a diagram known as CFD (Control flow diagram).
- Dependency Graphs: In this testing approach, the dependency graph is prepared based on the scenario under test.
- Decision Tables: Decision tables is a comparison approach where the results are compared in a tabular manner i.e. actual result against expected output. Fitness testing tool is an example of Decision table based modeling approach. Given below is a decision table where the column without question mark are field inputs and the column with a question mark is the field output with the expected output. The decision table test case when executed will match the returned result for the test case against expected value if the result matches the test will pass if not then the test fails. Such kind of modeling technique is Decision table data modeling technique.
- State transition machines: Charts represent the system state and checks the state against some inputs. It represents the Finite state machine which can be used for complex and real-time systems. We can use State charts in order to describe different behaviors of the system under test. The finite state machine has a definite number of states. The system’s behaviors after analysis are represented in the form of events and each such event is a state.
Therefore, the Model Based Testing can be defined as an evolutionary approach for the creation of the efficient test cases from the business requirements. It helps to test all possible intermittent states which GUI or an application can land at a particular scenario based on the given set of inputs.
State Transition Diagram
The above example demonstrates a simple model that explains step by step approach to create a word document for an article along with possible actions related to each step.
Types of Modelling Based Testing (MBT):
In general, there are two types of Model based testing (MBT).
- Offline MBT: In this testing, we generate the test suites before we can start executing those suites.
- Online MBT: In this testing approach, the test suites are generated on-the-fly.
Model Based Testing (MBT) Advantages:
The following are the advantages of Model-Based Testing (MBT).
- Once MBT is completed, it becomes easier to main test cases or suites.
- It reduces the reoccurring cost for test cases or suites maintained in long-term.
- Test Coverage is improved for any project under test.
- It is capable to execute different tests on multiple machines.
- It helps to determine early defect detection.
- It can increase the defects volume.
- It has proven to be time-saving and quality testing approach.
- It improves the job satisfaction for a tester taking MBT approach.
Model-Based Testing (MBT) Disadvantages
MBT (Model based testing) approach demands a high amount of investment as well as an effort for any organization which practices it. The following are the disadvantages of MBT.
- It requires a team of skilled testers.
- It increases the overall testing cost for the project.
- High learning curve.
- The model is quite complex and sometimes it becomes difficult to understand.
Over to you:
MBT testing is used by many organizations due to highest testing coverage and low maintenance for long-term regression testing. Skilled testers in these organizations who are adopting MBT approach often builds the model in their mind which can be transformed on the paper or drawn into documents for visual purpose. It is beneficial for the testers in term of re-usability as well as readability of the designed model for detailed testing.
To our QA friends could you please share your experience about MBT testing in comments below.
If you are not a regular reader of this website then highly recommends you Sign up for our free email newsletter!! Sign up just providing your email address below:
Happy Testing!!!