TestOptimal offers 5 sequence modes. They are:
- Optimal - uses the proven optimization algorithms to generate the optimal test sequence to achieve 100% coverage of your application. Because only the minimum number of test steps have to be repeated, the test execution completes in least amount of time.
- Random - generates the test sequence by randomly selecting a transition from the current state. You can set conditions when to stop the test execution
- Greedy - works the same way as Random except that it prefers un-traversed (un-tested) transitions over already traversed transitions. This helps to achieve the desired coverage with less number of test steps.
- mCase Optimal - generates the optimal test sequences to cover all states and transitions contained in mCases. Use mCaseSequencer if you just want to test certain scenarios or parts of your application. You may also use mCaseOptimal with virtual users to simulate concurrent users running certain test scenarios.
- mCase Serial - is a variation from mCaseOptimal. It differs from mCaseOptimal by preserving the order of transitions/states in mCase(s) in the test sequences it generates.
For each sequence type I selected, I received a report on Testing Coverage from the Monitor tab:
Greedy
Random
Optimal
As you can see, the Monitor tab shows how many traversals were done for each state and transition, as well as how many states/transitions were covered or not. Since I set up the sequencer to seek 100% coverage, there were no un-covered states/transitions. I was surprised to see the Random sequence achieve a greater efficiency over the Greedy sequence. And I was very impressed to see how efficient the Optimal sequencer was.
In addition to the information above provided in the Monitor tab, TestOptimal provides several other views for each run. There's a Sequence Log, which shows the last 1000 traversals and lists each state and transition traversed:
And a Stats tab, which provides state and transition coverage information with performance times:
After trying out these sequences in "dry-run" mode, I decided to run the test sequences against the actual target - maps.google.com. It worked flawlessly. After pressing the Run button, TestOptimal launched a browser window and began running each of the several hundred test sequences. It was fun to watch and, more importantly, demonstrated the power of model-based testing. Next week we'll take a look at some of the details within TestOptimal reports and analyze our results.













1 comments. Add Comment.:
This is an excellent tutorial on MBT! Just want to add to your observation on the Random and Greedy algorithms.
Statisticlly Greedy algorithm has a little advantage over Random algorithm, but from my experience, the performance of Greedy algorithm usually is not much different from Random algorithm. The difference you are seeing is most likely the effect of randomness.
Both Random and Greedy algorithm can cover the majority of the transitions fairly quickly but then they take a very long time to cover the remaining uncovered transitions. The larger the model is, the longer it will take to cover the last few transitions (amount of time goes up exponentially). For larger models, it will be practically impossible to achieve 100% coverage with Random and Greedy algorithms. You will want to use Optimal algorihtm instead.
However Random and Greedy algorithms are useful for load testing of the application as they generate realistic simulation of production requests.
Post a Comment