Demo
Below is a model that depicts a demo of the www.amazon.com site. It uses the
Extended Finite-State machine notation. Which means, that in this model, mbt
keeps track of how many books the user has put in the shopping cart during the test.
The demo model is built using this rudimentary Use Case specification UC01.
To download and test the demo, see How to run the demo.

Now, what fun is a model, if you can't do interesting things with
it. So lets try out some right away. First of all, right-click on the
image above and select Save Link As..., and save the file as UC01.graphml in the same folder as mbt.jar.
Now try out:
$> java -jar mbt.jar offline -f UC01.graphml -g SHORTEST -s EDGE_COVERAGE:100
e_init
v_BrowserStopped
e_StartBrowser
v_BrowserStarted
e_EnterBaseURL
v_BaseURL
e_SearchBook
:
:
Short resume of what happened above. First of all, the test was run
offline. This means that the complete test sequence was written to the
terminal. We told mbt to use a generator called SHORTEST. This generator will try to calculate the shortest 'walk' possible through the model. Also, we told mbt to use a stop-condition called EDGE_COVERAGE at 100%. This means that the generator has to walk every edge in the model.
Let's try it again, but this time we pipe it to wc -l, which will count the number of lines that is written from mbt.
$> java -jar mbt.jar offline -f UC01.graphml -g SHORTEST -s EDGE_COVERAGE:100 | wc -l
34
Every time we run these commands, it will always return 34. Not
surprising, because mbt will calculate the same path through the model
every time.
But what if we try a different generator?
$> java -jar mbt.jar offline -f UC01.graphml -g RANDOM -s EDGE_COVERAGE:100 | wc -l
150
150! That was a different result. Every time we rune these commands,
we will have different results. Again, not surprising, since we asked
mbt to use the RANDOM generator
We'll now try something else. Since the model is using the Extended
Finite-state machine notation, we'll run mbt with EFSM enabled.
$> java -jar mbt.jar offline -f UC01.graphml -g SHORTEST -s EDGE_COVERAGE:100 -x
e_init
v_BrowserStopped/num_of_books=0;MAX_BOOKS=5;
e_StartBrowser
v_BrowserStarted/num_of_books=0;MAX_BOOKS=5;
e_EnterBaseURL
v_BaseURL/num_of_books=0;MAX_BOOKS=5;
e_SearchBook
v_SearchResult/num_of_books=0;MAX_BOOKS=5;
e_ShoppingCart
v_ShoppingCart/num_of_books=0;MAX_BOOKS=5;
e_SearchBook
v_SearchResult/num_of_books=0;MAX_BOOKS=5;
e_ClickBook
v_BookInformation/num_of_books=0;MAX_BOOKS=5;
e_SearchBook
v_SearchResult/num_of_books=0;MAX_BOOKS=5;
e_ClickBook
v_BookInformation/num_of_books=0;MAX_BOOKS=5;
e_AddBookToCart
v_OtherBoughtBooks/num_of_books=1;MAX_BOOKS=5;
:
:
Notice the flag -x at the end of the command line, and notice the
different output. The content of the data in the model is written to
the terminal. Look at the last line above. Can you see that the
variable num_of_books has been increased?