Testcase Generator - TCGenerator

Ripper for windows apps

Ripper for Java apps

Event flow graph generator

Replay tool

 

The TCGenerator generates testcases for the AUT. It takes the event flow graph as an input and generates testcases. The TCGenerator currently implements three testcase generation methods.

 

q       Structural – Generates all possible testcases from an event flow graph.

q       Random – Generates random testcases for an event flow graph

Use the Value Map to specify text that will be substituted for editable GUI events. For example, if the AUT contains an edit box which requires an input from the tester, a value will be picked up from the Value Map for that edit box. This is done when generating a test case that contains an ‘edit’ event for that edit box.

Terminology

In this section we discuss some terminology and outline the issues in testcase generation

 

Baseline testcase - A testcase that is executable from the top-level window of the AUT. For example: File->Open->Cancel

 

Non-baseline testcase – A testcase that starts at a window that is buried deep in the integration tree. For example – Printer->Properties->Advanced, from the Page Setup dialog window. TCGenerator automatically generates the necessary sequence to reach the dialog window in question. In this case, TCGenerator will automatically prepend the sequence File->Page Setup.

 

Note: You will recall that an event flow graph corresponds to a modal dialog window and its modeless dialog windows, as explained <here>

 

Figure 1 shows an example.  An event flow graph will be generated for the three windows consisting of –

Modal        -            WordPad – Document

Modeless -             Replace

Modeless -             Find

 

 

Fig 1.Event flow graph for a group of windows in WordPad

 

Using All, testcases are generated for an event flow graphs as a whole. It is possible that an event flow graph corresponds to GUI dialog windows buried deep in the integration tree. This poses an issue. During the replay phase, the AUT needs to be brought to a state such that the deeply buried dialog window is activated. Necessary event sequences are automatically prepended to the testcase generated by this method to activate the deeply buried dialog window.

 

The Random is similar to the All. However, it is possible that an unacceptably large number of testcases be possible from an event flow graph. In such a situation, the tester can choose to randomly generate a specific number of testcases for that event flow graph.

 

As an example, Fig 2 shows TCGenerator, ready for generating All testcase for specific event flow graphs of WordPad.

 

Preview # testcases

 

Generate testcases

 

Loop free testcases are only

 

 

Fig 2. Testcase generator layout

 

We shall now see how to go about generating testcases for an application. We shall use WordPad as our example.

 

Automated Testcase Generation

This section describes how to generate testcases for the GUI structure of a windows application, henceforth called the AUT. It is possible to generate two types of testcases using GUITAR

q       Random testcases

q       Structural testcases

 

Generate Random testcases

q       From the GUITAR maininterface, select Generate -> Testcases -> Random (see Figure 3). This launches the testcase generator in Random mode (see Figure 4).

Fig 3. Launching the testcase generator from the GUITAR interface

F – Feasible # of test cases

D – Desired # of test cases

G – Actual # of generated test cases

 

Toggle Selection

 

Fig 4. Testcase generator in random mode

The matrix shows the length of the testcase on the horizontal axis and the event flow graph on the vertical axis. Select the testcases you wish to generate by clicking on the grid. To unselect a selection you need to click the grid again.

The functions available in the testcase generator are as follows

q       Feasible Preview the feasible number of testcases for each selection

q       Check All Select all the cells in the grid

q       Uncheck All Unselect all the cells in the grid

q       Generate Generate the desired number testcases for each selected cell

q       Left Click Cell Select/ Unselect a cell

q       Right Click Cell specify the desired number of random testcases to be generated for that cell

 

Generate Structural testcases

q       From the GUITAR maininterface, select Generate -> Testcases -> Structural (see Figure 5). This launches the testcase generator in Random mode (see Figure 6).

 

Fig 5. Launching the testcase generator from the GUITAR interface

F – Feasible # of test cases

G – Actual # of generated test cases

 

Loop free testcases are only

 

Generate testcases

 

Preview # testcases

 

Fig 6. Testcase generator in structural mode

The matrix shows the length of the testcase on the horizontal axis and the event flow graph on the vertical axis. Select the testcases you wish to generate by clicking on the grid. To unselect a selection you need to click the grid again.

The functions available in the testcase generator are as follows

q       Feasible Preview the feasible number of testcases for each selection

q       Check All Select all the cells in the grid

q       Uncheck All Unselect all the cells in the grid

q       Generate Generate the desired number testcases for each selected cell

q       Left Click Cell Select/ Unselect a cell

Value Map

To add another value, specify it here and click ‘+’

 
The Value Map is a repository of strings and numeric values that are automatically applied while generating test cases. The value map needs to be updated before the test cases are actually generated.

During generation, if a test case containing an ‘edit’ event is encountered; a value for the edit field is picked up from the value map. The test case generator looks up the value map for that field and uses value from the list of values that have been specified for that edit box. The tester can specify multiple values for a specific ‘edit’ event. During test case generation the next unused value is used for a specific edit event.

To update the value map, click the    icon from the toolbar or press CTRL-V. The value map editor is launched (see Figure 7).

 

Editable events for selected GUI window

 

Select GUI window

 

List of values for selected edit event, edit_29

 

 

Fig 7. The value map

 

Top of page

GUITAR – GUI Testing Framework

Perform Tests on the AUT