What is model based testing?
Creating test cases in any development method is at the core of testing and can be very time consuming, especially when conducted manually. Also, test-case development can be prone to interpretation errors when the test base – be it requirements, design documents or any other artifact – is ambiguous. Model based testing attacks these problems by using formal models to generate testcases.
Model Based Testing (MBT) ranges from full-blown test automation in which test cases from models are created and executed all in one go by an MBT suite via Model-Based Test Design (MBTD, often referred to as Automated Test Design), aiming at shortening test-case development lead time to Model-Based Review (MBR) which aims at reducing test base ambiguity through models without delivering actual test cases.
The definition of model is quite broad: any artifact that is unambiguous and can be interpreted by a computer program is considered ‘a model’, so a process diagram from a sophisticated modeling workbench fulfills this definition, but in some cases a simple checklist fulfills it as well.
In Model Based Review models are used as a means to assess the quality of requirements, designs, etc.. The models are prepared by the test discipline and reviewed by the owners of the original design, analysis or whatever artifact the model is representing.
In Model Based Test Design - or Automated Test Design - the origin of the models may lie with all kind of disciplines, as long as the models contain the right data in sufficient detail to derive test cases from.
Some commonly used models are:
- For process descriptions:
- flow diagram
- For business rules:
- pseudo code,
- decision table
- For data driven testing:
- classification tree
Output artifacts are:
Automated Test Design usually results in test case suites either in HTML (for manual testing), in spreadsheet format (very well suited for uploading to Test Management Tooling or in XML format (very well suited as input for automated test execution).
Reality cannot be captured in one single model, so if you need to test several aspects, make use of more than one model.
Model Based Testing is the means to an end to a larger whole: if the larger whole (e.g. a fully automated regression test set) is unclear, expectations might become vague and/or unrealistic.
Managing the models, not the resulting test cases. When the resulting test cases are enriched with additional data, one looses the advantage of re-generating test cases ‘with the push of a button’.