Introduction in State Model-Based Testing workshop at Autumn Testing Camp
Last year our testing team had the opportunity to participate at the Autumn Testing Camp, an event organised by the Testing Camp software testing community in Romania.
We had 2 full days with awesome workshops on various topics such as “Serenity and Cucumber”, “RPA”, “Useful testing strategies” and “Introduction to state Model based testing”. As always it surpassed our expectations. It was very hard to choose from all the amazing workshops we participated in, but I want to take some time to talk more about the “Introduction in State Model Based Testing” workshop held by Alex Rotaru and Dorin Oltean from Altom.
I think it had a good impact on a lot of testers present at the workshop, especially due to the fact that it busted the preconception among them that State Model Based testing works only for small features/apps. And this is one of the objectives of Autumn Testing Camp.
Let’s start with the definition of Model-Based testing which can come in many forms but an interesting one is the following:
“Model-based testing or MBT is a general term that signifies an approach that bases common testing tasks such as test case generation and test result evaluation (see [Jorgensen 1995] for some of these basic terms and concepts) on a model of the application under test. MBT has as its roots applications in hardware testing, most notably telephone switches, and recently has spread to a wide variety of software domains.”
According to the definition, this was what we did. We took an e-commerce site and we first built the model which helped us in creating automated tests and also running them randomly through the model.
Alex and Dorin used statecharts in the workshop which are:
“an extension of finite state machines that specifically address modeling of complex or real-time systems. They provide a framework for specifying state machines in a hierarchy, where a single state can be “expanded” into another “lower-level” state machine. They also provide for concurrent state machines, a feature that has only a cumbersome equivalent in automata theory. In addition, the structure of statecharts involves external conditions that affect whether a transition takes place from a particular state, which in many situations can reduce the size of the model being created”
Amongst the tools that were presented and used, the main one was AltWalker. It is “a model-based testing framework for automating test execution. You design your tests as a directed graph and AltWalker creates the test flow and executes them. It uses GraphWalker to generate paths through a graph.”
And all of this is open source☺. Its main features are:
- Web-based graph model editor and visualizer
- Test flow generation from a graph using graphwalker
- Command line tool to verify model and code correctness
- Online and offline test execution in Python or C#
- Integration with your own executor
We divided into multiple teams in which we did the graph model with the AltWalker model editor and then we used Python for the automated tests. An interesting approach was to use Mob programming in order to write the automated tests which was really helpful for people who never wrote an automated test and even for the ones that never wrote Python scripts.
“Mob programming is a software development approach where the whole team works on the same thing, at the same time, in the same space, and at the same computer.”
Besides all the technical fun that we had, on which I am not going to insist – you need to attend the workshop – the main gain from it was breaking the preconception of not being able to use state model based testing on bigger applications or platforms (applications consisting of multiple modules).
The room was very engaged in these conversations. Alex and Dorin offered multiple approaches to using state model based testing – one of them consisting of breaking down the feature or app into more granular pieces. The examples and answers given were very convincing and I think the workshop reached its ultimate goal through this open talk about possible problems and solutions when using this testing technique.
All we can say is that we can’t wait for the Autumn Testing Camp event in 2020.
If you’re looking to develop an e-learning platform or update your existing one, drop us an email.