How to generate Test Suite Implementation - ALL4TEC



Automated Generation Algorithms How To

Overview

To generate some test cases, the user must go to the Generation perspective.

You can access to this perspective by the button in the right top corner of the application.

 

A window occurs as below:

 

Test Strategy

 

The test generation is managed by a strategy. You can create and manage several strategies. A test strategy includes:

  • The chain / sub-state selection

To select the chains used in a strategy of generation, the user must check the chains in the Chains Selection part:

 

Select a profile

To select a profile in a strategy of generation, the user must select one in the drop down list.

 

Select an algorithm and its parameters

To select an algorithm in a strategy of generation, the user must select one in the drop down list.

The available algorithms are:

Random: The most adapted way to test the software in a non-determinist manner . This strategy does not use the probabilities of the profile.

 

Parameters associated:

o   Maximum step: Define the maximum step for each test case.

o   Test Case Number: Define the number of test cases to generate.

 

User Oriented: Generate test cases according to the probabilities of the selected profile in the strategy.

Parameters associated:

o   Maximum step: Define the maximum step for each test case.

o   Test Case Number: Define the number of test cases to generate.

o   Equivalence Class Handling: Define the way to generate the stimulation according to the equivalence class. There are several possibilities:

    Random: Select randomly the value without using the selected profile.

    User Oriented: Select the value according to the probabilities of the selected profile.

§  Limit Down: Select the lower value.

§  Limit Up: Select the upper value.

   Limit Down or Up: Select the lower or the upper value randomly.

   Average: Select the average value.

   Most Probable: Select the most probable distribution range according to the selected profile.

 

Most Probable: Generate test cases according to the probabilities of the selected profile in the strategy. The most probable transition or equivalence class will be used during generation.

Parameters associated:

o   Decreasing rate: The rate used to decrease the probability of a transition selected during the generation.

o   Test Case Number: Define the number of test cases to generate.

o   Equivalence Class Handling: Define the way to generate the stimulation according to the equivalence class. There are several possibilities:

    Random: Select randomly the value without using the selected profile.

    User Oriented: Select the value according to the probabilities of the selected profile.

    Limit Down: Select the lower value.

    Limit Up: Select the upper value.

    Limit Down or Up: Select the lower or the upper value randomly.

    Average: Select the average value.

    Most Probable: Select the most probable distribution range according to the selected profile.

    Most Probable with decreasing rate: select the most probable distribution range according to the selected profile and in use the decreasing rate value.

 

Minimum (Arc Coverage): Generate the shortest path to cover all the transitions of the model. 

 

Parameters associated:

o   Improvement Cycle: Define the number of improvements to make to find the best solution.

o   Equivalence Class Handling: Define the way to generate the stimulation according to the equivalence class. There are several possibilities:

   Random: Select randomly the value without using the selected profile.

   User Oriented: Select the value according to the probabilities of the selected profile.

   Limit Down: Select the lower value.

   Limit Up: Select the upper value. 

   Limit Down or Up: Select the lower or the upper value randomly.

   Average: Select the average value. 

    Most Probable: Select the most probable distribution range according to the selected profile.

o   Use profile for transition calculation: Define if the profile will be considered for transitions. The transitions with profile probability value to “0” and their subparts in the model won’t be considered for the test cases calculation. 

User Oriented + Filter: Generate test cases according to the probabilities of the selected profile in the strategy with filters.

Parameters associated:

o   Maximum step: Define the maximum step for each test case.

o   Test Case Number: Define the number of test cases to generate.

o   Maximum Attempts: Define the number of maximum attempts required used to create a test case when another same test case (depending on filter) does exist.

o   Include existing test cases: Define if the test case generated will be filtered with the existing test cases in the project (in addition to the test cases already generated).

o   Filter: Define the way to filter the generated test cases. There are several possibilities:

   None: No filter will be used (several test cases will be the same).

   Paths Only: The test cases paths must be different.

   Paths & Equivalence Classes: The test cases paths can be the same while the equivalence classes are different.

   Transitions coverage: Keep the generated test case if this one covers a non-covered transition byother test cases.

o   Equivalence Class Handling: Define the way to generate the stimulation according to the equivalence class. There are several possibilities:

   Random: Select randomly the value without using the selected profile.

   User Oriented: Select the value according to the probabilities of the selected profile.

   Limit Down: Select the lower value.

   Limit Up: Select the upper value.

   Limit Down or Up: Select the lower or the upper value randomly.

   Average: Select the average value.

   Most Probable: Select the most probable distribution range according to the selected profile.

 

 

Example of Test case generation

   Minimum (Arcs Coverage):

Here some generation examples with Minimum (Arc Coverage) algorithm:

  First example: Profile “Equiprobable” :

Generation parameters:

o   Equivalence Class Handling: User Oriented

o   Test Case Number: Best Solution

o   Use profile for transition calculation: Not Checked

The generated test cases are the followings:

1.       T1 – T2 – T21 – T24 – T241 – T242 – T25 – T26 – T3

2.       T1 – T2 – T21 – T22 – T23 – T26 – T3

3.       T1 – T2 – T27 – T28 – T3

4.       T1 – T6 – T5

5.       T4 – T5

Second example: Profile “Equiprobable” (transition “T6” with profile probability to “0”):

 

Generation parameters:

o   Equivalence Class Handling: User Oriented

o   Test Case Number: Best Solution

o   Use profile for transition calculation: Checked

The generated test cases are the followings:

1.       T1 – T2 – T21 – T24 – T241 – T242 – T25 – T26 – T3

2.       T1 – T2 – T21 – T22 – T23 – T26 – T3

3.       T1 – T2 – T27 – T28 – T3

4.       T4 – T5

 

Third example: Profile “Equiprobable” (transition “T21” with profile probability to “0”):

 

 

 

Generation parameters:

o   Equivalence Class Handling: User Oriented

o   Test Case Number: Best Solution

o   Use profile for transition calculation: Checked

The generated test cases are the followings:

1.       T1 – T2 – T27 – T28 – T3

2.       T1 – T6 – T5

3.       T4 – T5

 
User Oriented + Filter algorithm:

Here some generation examples with User Oriented + Filter algorithm:

Considering this following model:

On the transition named T1, considering this input association:

First generation with the following algorithm parameters:

o   Equivalence Class Handling: Limit Down

o   Test Case Number: 4

o   Maximum Steps: 5000

o   Maximum Attempts: 100

o   Include existing test cases: unchecked

o   Filter: None

With this generation strategy, you can find those test cases in the Test Suite view:

 

Second generation with this algorithm parameters:

o   Equivalence Class Handling: Limit Down

o   Test Case Number: 4

o   Maximum Steps: 5000

o   Maximum Attempts: 100

o   Include existing test cases: unchecked

o   Filter: Paths Only

With this generation strategy, you cannot find those test cases:

 

 

The Test Case3 has the same path as the Test Case2 and the Test Case4 has the same path as the Test Case1 so they cannot be kept for this generation and others test cases will be generated.

With this generation strategy and this model, the maximum number of generated test cases is 3. Indeed, the three paths are available:

  • T1 – T2 – T3 – T7
  • T1 – T2 – T5 – T6 – T7
  • T1 – T4 – T6 – T7

 

Third generation with this algorithm parameters:

o   Equivalence Class Handling: Limit Down

o   Test Case Number: 4

o   Maximum Steps: 5000

o   Maximum Attempts: 100

o   Include existing test cases: unchecked

o   Filter: Paths & Equivalence Classes

With this generation strategy, you cannot find those test cases:

 

 

The Test Case3 has the same path and the same equivalence class as the Test Case2 so it cannot be kept for this generation and another test case will be generated.

With this generation strategy and this model, the maximum number of generated test cases is 6. Indeed, the three paths are available:

  • T1 (EC0) – T2 – T3 – T7
  • T1 (EC1) – T2 – T3 – T7
  • T1 (EC0) – T2 – T5 – T6 – T7
  • T1 (EC1) – T2 – T5 – T6 – T7
  • T1 (EC0) – T4 – T6 – T7
  • T1 (EC1) – T4 – T6 – T7

   Fourth generation with this algorithm parameters:

o   Equivalence Class Handling: Limit Down

o   Test Case Number: 4

o   Maximum Steps: 5000

o   Maximum Attempts: 100

o   Include existing test cases: unchecked

o   Filter: Transition coverage

With this generation strategy, you cannot find those test cases:

 

 

 

The Test Case3 and the Test Case4 have only transitions used by previous test cases, so they cannot be kept for this generation and other test cases will be generated.

With this generation strategy and this model, the maximum number of generated test cases is 3. Indeed, the three paths are available:

  • T1 – T2 – T3 – T7
  • T1 – T2 – T5 – T6 – T7
  • T1 – T4 – T6 – T7

 

After creating the test strategy, the generation is done by clicking on the button « Generate ».The test generation result is displayed in the Test Suite view. We can rename a test case through the Properties view.

 

The details on a test case is visualized in the Test case details view. To modify the view, double click on the test case and then select the expected view available on the down.

The view selected for the example below is HTML.

 

The test cases generated can be saved in the project for further reuse.

Right click on the test case to save and then “Add to project”

 

 

The HTML generation reports can be added to the project.

Click on the button “Add report to the project”.

 

 

The test cases can be exported in several formats: pdf, html, xls and doc.

Select File -> Export -> Export full test case(s) -> Select the test case (s) to export -> choose the MaTeLo version -> choose the location on which the test case (s) will be exported.

 

Contact Us: +33 180 750 755