Test Modeller Co-Pilot
    • Dark

    Test Modeller Co-Pilot

    • Dark

    Article Summary

    Co-Pilot is a feature in Test Modeller which leverages Generative AI which works alongside you to help create models, and understand them.  

    We've employed the Co-pilot feature for inputting commands to both generate and modify models. It serves as a handy tool for interrogating models with in-depth queries. Moreover, Co-pilot assists us in performing comprehensive model reviews and summarizing these complex models for simpler understanding. Lastly, an outstanding application of Co-pilot is its ability to transform these models into user stories, thus providing a more user-centric view of the model's purpose and function.

    1. Navigating Co-Pilot

    To use the Co-Pilot feature, head to the Connectors panel. Then select the Co-Pilot option.

    This will open the co-pilot side toolbar. This features a prompt window to enter the prompt. Following that there are buttons for;

    1.  Generating / Editing the model - This can be used to enhance the model by providing a prompt of the action to perform (e.g. add exception handling for an incorrect username).
    2.  Querying models - This can be used to query the model to answer questions based on the business logic in the represented model.
    3.  Reviewing models - This provides a review of the model providing advice for missing information.
    4.  Summarising models - This summarises the model into a textual based description of the business logic.
    5.  Converting the model to a user story - This converts the model into a textual based user story which has a description and acceptance criteria.

    We will now detail the available options.

    2. Generating / Editing Models

    The generate button is used to provide prompts which edit / add / delete functionality contained in the model. Here are some example prompts;

    "Add a negative scenario for providing a wrong username"

    "Remove the scenario for rejecting a applicant with poor credit history"

    "Extend the model to also include functionality for registering a new user"

    "Add descriptions to the processes"

    To use the generate functionality, type a prompt into the text area, then press the generate button. It may take a minute for a result to come back.

    We'll be editing the following model for a credit card application.

    We want to update the model to include a check that the credit score must be over 800 for the application to be approved, otherwise it will be rejected. To achieve this we add the prompt to the Co-Pilot window and press generate.

    The model will get updated to reflect the changes.

    3. Querying Models

    The query option is used to provide textual based queries which you want to be answered by the model. In this example, we'll take an model which represents the Leg before wicket cricket rule.

    We ask the following prompt which we want it to use the model to answer; "When is the batsman bowled out?".

    We receive the following response.

    This is a complex flowchart, but let's work through it to understand when a batsman is bowled out according to the flowchart logic.
    Starting from the 'Start' node, we move to the 'Legal Delivery' gateway. If the delivery is not legal ('False'), the flow ends and the 'Batsman Remains in'. If the delivery is legal ('True'), we move to the 'Ball Contact' gateway.
    The 'Ball Contact' gateway splits into two paths depending on whether the ball contacts the 'Bat' or 'Pad'. If the ball contacts the 'Bat', the flow ends with the 'Batsman Remains in'.
    If the ball contacts the 'Pad', we move to the 'Ball Pitch' gateway. This gateway splits into three paths: 'Infront', 'Legside', and 'Offside'.
    'Infront' path: If the ball pitches 'Infront', it leads to the 'Ball Pad Connection' gateway. Here, we have three options:
    a) 'Legside': If the Ball Pad Connection is on the 'Legside', the 'Batsman Remains in'.
    b) 'Infront': If the Ball Pad Connection is 'Infront', we reach the 'Ball Trajectory Hitting' gateway. If it is 'False', the 'Batsman Remains in'. If it is 'True', the 'Batsman is Bowled Out'.
    c) 'Offside': If the Ball Pad Connection is 'Offside', the 'Batsman Remains in'.
    'Legside' path: If the ball pitches on the 'Legside', the 'Batsman Remains in'.
    'Offside' path: If the ball pitches 'Offside', it leads to the 'Ball Pad Connection' gateway, and if it is 'Offside', the 'Batsman Remains in'. It leads back to 'Infront' if it's 'Infront' and to 'Legside' if it's 'Legside' and ends with 'Batsman Remains in'.
    So, to answer your question, "When is the batsman bowled out?" According to this flowchart, the batsman is bowled out if the following conditions are met: the delivery is legal, the ball contacts the pad, the ball pitches 'Infront', and the ball's trajectory is predicted to hit the wickets ('Ball Trajectory Hitting' is 'True'). All other paths lead to 'Batsman Remains in'.

    4. Review Models

    The model review option is used to review a model and provide feedback on bad practices and potentially areas which haven been overlooked from a modelling perspective (e.g. missing equivalence classes or scenarios). 

    We will take the following flowchart of a money transfer requirement.

    We click the review button.

    Co-Pilot comes back with the following response.

    This flowchart appears to be complete and applicable for model-based testing. It details the steps of a banking transaction from start to finish and shows the logic of the process. 
    The logic represented includes: validating details, entering recipient's details, entering an amount to be transferred, selecting the transfer option, confirming the transaction, and displaying an error message if the validation fails. 
    To ensure this flowchart is complete, some additional scenarios should be considered. For example, it should include a scenario to handle the case when the user cancels a transfer or when insufficient funds are available for the transfer. Additionally, the flowchart should include a route back from the ‘Transaction Failed’ endpoint to start the flowchart again in case the transfer needs to be retried.

    5. Summarise Models

    The summarise option is used to provide a summary of the logic contained in the model. For example, we take the following flowchart representing a drinks promotion.

    We click on the Summarise button in Co-Pilot.

    This comes back with the following response on summarising our model.

    This flowchart describes the process of validating a customer's eligibility for a free drink promotion. Upon starting the process, it checks for the age requirement by asking if the customer is 18 years or older. If the customer meets the age requirement, the promotion's validity is checked. If the promotion is valid, then the customer is asked if they are eligible for the free drink. The customer must have run at least 10 miles per week and have proof of this when presenting their results to the cashier. If the customer qualifies, then the promotion is granted. Otherwise, it is denied. If the drink is not eligible for the promotion, then it is not granted.

    6. Convert to User Stories

    The user story option is used to convert a model to a user story which can be embedding in a requirements management tool. We will use the following model.

    We click on the User Story option in Co-Pilot.

    This provides the following response.

    itle: Signing in with an invalid or valid email 
    Summary: Validating that users are able to sign in with an invalid or valid email address and password. 
    Description: Validate that user accounts are only accessible with a valid email address and password, by having the user enter either an invalid or valid email address and password. 
    Acceptance criteria: 
    - Users are able to enter both an invalid or valid email address
    - If user enters an invalid email an invalid email error is displayed
    - If user enters a valid email and an invalid password an invalid password error is displayed
    - If user enters a valid email and password, they are authenticated and can access their account