Model-Based Testing

Model-Based Testing (MBT) is a term to describe a software testing methodology. The basic idea of MBT is that you create a model of the system under test (SUT), and then MBT tools can automatically generate and execute test cases. If you are not a software engineer, you can think of a model as similar to a blueprint for a building, or to a schematic diagram for an electrical circuit. While model-based testing sounds great in principle, MBT is rarely successful in practice. The problem is not MBT as such; rather, the problem is with factors associated with the construction and maintenance of the model of the system under test. Broadly speaking, there are three ways to generate the model of a software system. The first approach to model-creation is to write code, and then manually create the model that corresponds to the code. This approach generally fails because the code and the model get out of synchronization, because in most scenarios the code base of the SUT changes too quickly, and the effort required is very big. The second approach to model-creation is to write code, and then use a tool to automatically generate the corresponding model. This approach fails because no tool can generate state transition information (e.g., if the user clicks button A and dropdown B currently has "foo" then textbox C should display "bar"), unless the SUT code explicitly contains such state transition information — and this requires huge effort. The third approach to model-creation is to create the model first (including state transition information), and then use a tool which will automatically generate source code from the model. This approach is sometimes called model-based architecture (MBA). The MBA approach can in fact work, but is enormously expensive, and so is limited to gigantic software systems. In such a situation — a huge software system under development with vast resources being developed using model-based architecture — model-based testing can be feasible as one component of a testing effort. That said, there are precious few actual examples of successful model-based testing.
This entry was posted in Software Test Automation. Bookmark the permalink.