This page is a step by step introduction to the use of the Tobias On-Line web site. Alternatively, a short video (3'50") is also available here. It shows how to upload a file on the Tobias web site, and get the results.
Let us ﬁrst consider a simple java class Purse which handles an electronic purse. It features a constructor, and three operations : credit(int nb), debit(int nb) and getBalance(). The java code for class Purse can be downloaded here and is given at Fig. 5.
In order to test this program, one would like to create an object of class Purse, then to credit it with some amount of money, then to debit some other amount and ﬁnally check the resulting balance. Tobias allows to generate tests which follow this sequence and combine various predeﬁned amounts.
Fig. 1 gives the text of the Tobias input ﬁle PurseSeq1.txt (available here). It is expressed in the TSLT language (Test Schema Language for Tobias) and stored in an ordinary text ﬁle. This input ﬁle describes a group named SimpleSequence. This group is tagged as us=true which means that this group will be unfolded by Tobias into a test suite. The group is deﬁned as a sequence of four instructions: a call to the constructor of class Purse, followed by calls to methods credit, debit and getBalance. Methods credit and debit take an integer parameter as input. In group SimpleSequence, three values (10, 50, and 0) are deﬁned for the input parameter of credit, and two values (5 and 15) for the input parameter of debit.
To unfold the group, the input ﬁle should be submitted to the Tobias-on-Line web page at the following url http://tobias.liglab.fr/. Fig. 2 gives the input form for this page. The user must do the following actions:
Figure 2: The input form for Tobias-on-Line
Fig. 3 gives the resulting screen when the input ﬁle is correct. This screen tells us that 6 test cases were generated. An email is send to the user with a link to the output ﬁle. This output ﬁle is a zip ﬁle which stores the resulting source code of the JUnit ﬁles. It will remain on our web site for a limited amount of time. Use the link to access the ﬁle and save it on your computer. You can then extract its contents with your favorite unzip tool.
In this case, the unfolding produces a unique JUnit ﬁle, TS SimpleSequence.java, given at Fig. 4 (after some reformating of the actual output ﬁle). This JUnit ﬁle includes 6 test cases, corresponding to all combinations of the input parameters given for methods credit and debit.
Figure 3: The output page corresponding to PurseSeq1.txt
This ﬁrst page has shown how to unfold a simple Tobias input ﬁle using Tobias on-Line. The more detailed documentation is provided in a PDF document entitled Tobias Notes .