
Shape your testing using diagrams
Your test management tool is becoming more and more attractive with functions that offer convenience.
From experiences so far, to explain a plan or workflow, we often have used white board to draw a diagram.
TestBench CS allows you to easily draw your diagrams in Epics, User Story and Test cases.
If you are wondering how is this going to work in a test management tool, we’ll take you to a short journey of examples.
Everything you need to know about using diagrams in TestBench CS you will find it in Online Help. Available types include flow chart, sequence diagram, class diagram, state diagram, ER diagram, User journey, Gantt diagram and PIE charts.
Besides the written information, we prepared a short video for a quick introduce on how to embed a sequence diagram in a User Story. Absolute beginners are advised to view the Mermaid-Js source. Otherwise, if you are familiar with markdowns, crafting diagrams won’t be a problem.
-
How does it work
Crafting a diagram in an Epic, User Story or Test Case requires three steps; first always add quotation marks and the type of the diagram:
```mermaid Sequencediagram Then add the code and close the syntax with the same punctuation signs ```.
Here is an example:
``` mermaid stateDiagram-v2 [*] --> Login Login --> Work: passed Work--> Login: logout Login --> [*]: cancel ```
To inspire you, the following figures illustrate some of our team works and screenshots from TestBench CS environment. Each figure below has the needed code for implementation.
# Flowchart
Proposed usage: visualize control flow in a function or procedure.

``` mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryTextColor': '#ffffff'}}}%% flowchart LR classDef default fill:#008562,stroke:#ec901f,stroke-width:2px; classDef final fill:#ec901f,stroke:#008562,stroke-width:2px; Brainstorming --> Ideas Trends --> Ideas Research --> Ideas Ideas --> Prototyping Prototyping --> Eval{Evaluation} Eval --> Design Eval --> Review Review --> Requirements Requirements --> Prototyping Design --> Implement Implement --> Testing(Testing):::final ```
# Sequence Diagram
Proposed usage: show communication between actors e.g. for integration testing

``` mermaid sequenceDiagram User ->> Server: Connect Server ->> DB: Connect activate DB DB -->> Server: Success Server -->> User: OK User ->> Server: Get Data Server ->> DB: Get List Note over Server, DB: seed error here DB ->> Server: Return Item List Server ->> DB: Get Item by ID DB ->> Server: Return Item deactivate DB Server ->> User: Return Item ```
# Class Diagram
Class diagrams are meant to describe classes and their relationships.
In testing, they can also be used to visualize equivalence partitions and their representatives, including boundary values, if you like.

```mermaid classDiagram class username class valid_user valid_user: Peter valid_user: Mary class invalid_user invalid_user: Paul class admin_user admin_user: Peter class normal_user normal_user: Mary username <|-- valid_user username <|-- invalid_user valid_user <|-- admin_user valid_user <|-- normal_user class password class valid_pwd class invalid_pwd password <|-- valid_pwd password <|-- invalid_pwd ```
# State Diagram
State diagrams are traditionally used for state based testing

```mermaid stateDiagram-v2 a1: Login Dialog 1 a2: Login Dialog 2 a3: Login Dialog 3 b: Logged on [*] --> a1 a1 --> b: valid a2 --> b: valid a3 --> b: valid a1 --> a2: invalid a2 --> a3: invalid a3 --> [*]: invalid b --> b: work a1 --> [*]: cancel a2 --> [*]: cancel a3 --> [*]: cancel b --> a1: exit ```
Have fun playing around with the markdowns and diagrams in TestBench CS.
Don’t forget to share this with your team!