Model-based testing (MBT) has become more and more popular in recent years. MBT is used for validating requirements, i.e., for software defect prevention, for shared understanding, and for generating executable test cases.
Various MBT tools employ diverse models, yet they share a common feature: all these models are considered computer-readable. This means that the model should be understandable for a computer program that reads, scans, and processes the model and generates executable test cases. The consequence is that:
- The model can be made when the application is ready – too late, insprint test automation is almost impossible
- The model must include all the details the tester has to do during manual test execution such as submit buttons, fill out each field, etc.
This results in a complex model that is difficult to understand and maintain. In software testing, a test-first approach is better. The sooner you find a bug the lower will be the fixing costs. To make it concrete a requirement bug fixing when the application is ready costs 10 times more. Finding anomalies in the requirement specification makes your software quality high and bug-fixing costs low.
That’s why we introduced two-phase model-based testing. Here the modeling process is divided into two parts:
- high-level modeling,
- low-level modeling.
The high-level model is human-readable and can be done before implementation. The low-level model is computer-readable, and it’s generated from the high-level model during manual test execution. We introduced a new modeling technique called action-state testing.
An action-state model consists of steps:
The steps can be written in sequence and they are executed one after the other:
Steps can be forked and then they are executed in parallel:
You can see that the first action ‘add items to get free beverage’ is a high-level model step as the tester can execute it in several ways.
Test cases can be joined in a single step:
Requirements and models are mapped through labels:
R1. free beverage is offered when food prices reach 30
From the model the high-level, i.e., the abstract test cases are generated on-the fly. These test cases can be executed by testers, developers or business analysts but cannot be executed by a machine.
This method has several advantages:
- Good defect prevention capability
- Outputs are checked, not computed
- As a genuine no-code solution, manual testers can use it
- Big cost saving
- Can find tricky bugs
- Insprint test automation is possible