Rule-Based Test Generation

    Rule-Based Test Generation


    Article summary

    Learn how to vary Test Case Generation from your Models and Subflows using Rule-Based Constraints.

    Rules to traverse models!

    Preamble: How to use Subflows to traverse across models with multiple end points.

    • Log-in Subflow
    • Reports Subflow

    Journey: Log in as a certain type of user, choose a particular report, then test a report.

    Part1: Drag Subflow node onto Canvas > Select from the directory the model to inhabit the Subflow node. > Connect up Subflows and select appropriate Subflow node.

    Part 2: Now put in Logic into the Subflows

    Go to Test Generation in Ribbon > Click Rules (icon) > Choose a pre-set Variables (you do this). Remember to Expose the Variable, so it can be picked up in the end-to-end Master Model. Advanced > Select Expose as Flow Parameter (this tells the optimiser what to do to resolve the Variable).

    Part 3: Make an Assignment to the Variable on a node

    Click on the required node > In the Ribbon, click Rules (icon) to show Node Logic Pane (All output decisions must be Assigned, otherwise the Rules are redundant).

    Part 4: Create a new Coverage Profile

    In the Ribbon > Click New (in-between Tests and Coverage icons) > Name it. Then > Click Coverage (icon) > Choose the Variables tab > Select a Variable and Value. (Whenever the Coverage Profile is Run).

    Part 5: Re-import the modified Subflows into the end-to-end Master Model

    Right click on Subflow node and right-click for Subflow Properties > Click Parameters to see the Variable is Exposed (no surprise). Declare a Variable and a second time in Subflow Properties link it to the Parameter in the Subflow. In the Data Painter Pane > Click Variable (in this case =[LoginModelControl]). 

    Part 6: Control how to get through the Logic

    Set-up Coverage Profiles. Click Coverage (icon) > In the Coverage Profile Pane, select Variables Tab > Add all Variables.