The University of Queensland Homepage
School of ITEE ITEE Main Website

 BETG

Behaviour-Event Test Generator (BETG)

 

1.      Introduction

 

Behaviour-Event Test Generator (BETG) is a prototype GUI testing tool which automatically generates test cases from three inputs: a behaviour model, a GUI model, and a mapping model. The behaviour model represents highlevel behaviour of the GUI under test and can be built using external tools such as Spec Explorer. The GUI model represents widgets of the GUI and their events and attributes. These two models are connected by a mapping model which is written in a Behaviour-Event Mapping (BEFMAP) language. This language allows testers to define how behaviour is mapped to GUI event and attributes. We also introduce coverage criteria which specify how various permutations of events are covered when generating test cases. BETG aims to lead GUI testing to a behaviour-oriented approach and save testing effort.

 

2.      Architecture

We develop the Behaviour-Event Test Generator (BETG), a test automation tool, based on the framework proposed in this research project. BETG supports following features:

-          Generate test cases from given BM, GM, and MM.

-          Allow testers to control test coverage by choosing coverage criteria.

-          Automate test execution.

 

Figure 1 BETG Architecture

 

-          BEFMAP Parser: this parser syntactically analyses the MM and converts it into a syntax tree. The parser is built by ANother Tool for Language Recognition (ANTLR), a framework for constructing compilers.

-          Model Matcher: this component checks if the MM is consistent against the BM and the GM before test case generation gets started. Model Matcher helps to avoid these inconsistencies.

-          Test Case Generator (TCG): this is the core of BETG, where event-level test cases are generated based on the behaviour-to-event mapping defined in the MM and the coverage criteria being used. TCG supports 5 types of coverage criteria: First-OneLink-Coverage, Random-OneLink-Coverage, All-Link-Coverage, N-Way Coverage, and Cartesian Coverage. The generation of N-Way test cases is one of the most challenging tasks of TCG. There are several approaches to calculate N-way combinations. Unfortunately, none of them can assure that the generated test cases are the optimal ones. In most cases, the numbers of test cases generated by these approaches are approximately equal. In TCG, we used the greedy algorithm presented in the paper The AETG system: an approach to testing based on combinatorialdesign” by Cohen D. MM. et al. Due to this algorithm, test cases are generated in a step-by-step manner. TCG makes the locally optimal choice at each step and chooses the test case that covers most uncovered pairs.

-          External Compiler: the external compiler compiles the generated test cases and the test harness to build a test project. Depending on what platform was used to develop the system under test, testers would need to choose a suitable test harness and a compiler. For instance, if the system under test is a .NET application, then a .NET test harness and a .NET complier are needed to build the test project. Similarly, testing a Java application would require a Java test harness and a Java compiler.

3.      Download BETG

Download link: BETG.zip

This download package includes:

-          The tool (BETG).

-          A sample system under test.(To Do Manager)

-          A .NET test harness.

 

1.      How to run the example?

-          Unzip the download package.

-          Run the BETG_GUI.exe application.

-          Specify the location of your behaviour model (BM.xml), GUI model (GM.xml), and mapping model (ToDoManager.txt). These models are included in the download package.

-          Generate the test case file testcase.cs into the TestHarness directory.

-          Open the TestHarness project in MS Visual Studio .NET 2005.

-          Run the TestHarness project to execute the test cases and observe test results. Note: you need .NET Framework 3.0 or higher to perform this step.

 

2.      BETG screenshots

 

Figure 2 BETG screenshots