First Steps

Aus ExpeccoWiki

Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

Introduction

The First Steps are aimed at everyone who wants to use expecco for the first time and will be a support to the user in the beginning.
We want to provide you an overview of expecco, using a simple example.
It is recommended to also start the demo tutorial in parallel to the first steps in order to understand and follow everything.

Creating a new testsuite

A testsuite is the term used for a packaged test project. It manages a collection of elements like testplans, blocks and datatypes as well as resources or attachments and documentation.

To create a new testsuite, click on the menu FileNew Test Suite.

FS Picture 03 en.jpg

expecco version 1.7 and higher

The Standard Library is automatically imported after creation of the new testsuite .

expecco up to version 1.6.x

The Standard Library has to be imported manually. To import the library click on the menu FileImport/ExportImport Library....

FS Picture 26 en.jpg

A file browser opens. Click on the button Icon expecco Home.jpg to change to the library folder and select the Standard Library (StandardLibrary.ets). Press OK.

FS Picture 14.jpg

Blocks in libraries

Libraries are collections of functional blocks. Libraries are located in the project tree (Navigator) under the category "Imports". All elements within an imported library are read-only. For each block, there is a description and, where appropriate, an example that you can execute immediately.

Select the Standard Library in the project tree. This library provides basic blocks for different areas.

FS Picture 35 en.jpg

Select in the category "String Processing" the block "String [ AsUppercase ]".
Editors regarding the selected item are displayed on the right in a number of tabs. In the tab "Documentation" you will find a brief description about the functionality.

FS Picture 21 en.jpg

Select the tab "Test". The shown Testeditor allows the immediate execution of the block by pressing the button Icon Run.png.

FS Picture 17 en.jpg

The result of the execution is displayed in the lower part. In the tab "Pins" you can see the input and output values.

Creating your first (compound) block

A block is the definition of an activity. We distinguish between elementary blocks and compound blocks.
An elementary block defines a basic action, for example built-in functions, DLL-calls and JavaScript functions.
The behaviour of a compound block is represented by an activity diagram. The elements of an activity diagram are steps which are connected through data and/or control flows.

To create a new compound block click the button Icon New Compound.jpg on the toolbar Icon Toolbar Create.jpg.

FS Picture 15 en.jpg

Click the button Icon Open External Tree.jpg to open an additional project tree which allows you to drag elements into the network editor.

FS Picture 31 en.jpg

In the external tree change to the category "Arithmetic" and select the block "Arith [ Sum ]". Keep the mouse pressed and drag the selected element into the network of the new block. Release the mouse button and a new step will be created.

FS Picture 28 en.jpg

Since this step requires input values, it can not be executed (showing a red exclamation mark FS Picture 06.png). Inputs and outputs are termed as pins (connectors). In the first step we allocate the inputs with fixed values. You can do this by double clicking on the input pin FS Picture 13.png or via the corresponding entry in the context menu:

FS Picture 08 en.png

Enter any number in the box:

FS Picture 12.jpg

Allocate the second input pin. The step now has all the required input values to be executed.

FS Picture 03.jpg

Execute your newly created block in the tab Test.

FS Picture 29 en.jpg

In the tab "Pins" you see the input values and the expected output value.

To take over the changes to the block in the system, click on the button "Accept".

FS Picture 18 en.jpg

Enter a name for the block, which can be accessed via the context menu of the newly created module in the project tree.

FS Picture 22 en.jpg

Enter the name "1.Block" in the box.

FS Picture 20 en.jpg

Creating a more complex block

As starting point, we use a copy of the previous block. To do so, select the block and open the right-click context menu. Then select the Copy item and afterwards the Paste item.

FS Picture 23 en.jpg

After pasting, you will have a copy of the previous block.

FS Picture 30 en.jpg

Place the block "Arith [ Product ]" from the additional tree via drag & drop into the network. Afterwards, your network should look like the following one:

FS Picture 32 en.jpg

After the execution of the module you will get the following picture:

FS Picture 07 en.jpg

The activities will be displayed in different colors, depending on their execution state. As seen here in green - for successful. As you can also see, no activity has started for the new step. The step is lacking the required input values (recognizable through the red exclamation mark).

Therefore, we connect the inputs and outputs of the steps.

Most connections are data-driven, which means they have to have the same data at the beginning and at the end of the connection. For example, it is not possible to add text into an addition block.

If the input and output data types do not match, various conversion blocks are available in the standard library under the category "Type Conversion".

To create a connection, follow these steps:

  1. Select with the left mouse button, the output pin "sum" at the step "Arith [ Sum ]" and keep it pressed.
    FS Picture 07.jpg
  2. Drag the mouse button to connect to the input pin "number1" at the step "Arith [ Product ]" and release the mouse button while on the input pin Icon Input Pin.jpg.
    FS Picture 02.jpg

Repeat this step and connect the additional output "sum" with the input pin "number2".

FS Picture 08.jpg

Run the module again, as you can see all the steps were executed now.

FS Picture 12 en.jpg

Take over the block and rename it into "2.Block".

Adding output pins to a block

As starting point, we use a copy of the previous block, which you can create through the context menu (Copy then Paste).

You will get the following picture:

FS Picture 36 en.jpg

The interface of a block is described by its inputs and outputs. In the schema editor, the input pins are displayed on the left and the output pins on the right. Each pin is assigned to a data type.

In order to create new pins, there are different possibilities:

  1. Click the Icon Add Outputpin.png button inside the schema editor to create a new input or output pin. To change the default data type, click on the data type and select the desired data type from the appearing menu.
    FS Picture 06 en.jpg

  2. Drag the corresponding input or output pin to the left or right side of the editor.
    FS Picture 11.jpg
    After releasing the mouse, you see the following picture at the left border:
    FS Picture 10.jpg

Create an output pin as described in example 2.

Select the tab Schema and you will get the following picture:

FS Picture 25 en.jpg

The block has received a new output pin, the data type and name of the output pin were taken over by the internally associated output pin within the network. By clicking on the name, the pin can be renamed.

To delete an existing input or output pin, select the appropriate pin and click on the button Icon Remove Pin.png.

Execute the block again and you will get the following picture:

FS Picture 14 en.jpg

The output value is now available for further use at the output pin.
Take over the block and rename it into "3.Block".

Adding input pins to a block

As starting point, we use a copy of the previous block, which you can create through the context menu (Copy then Paste).

You will get the following picture:

FS Picture 24 en.jpg

To externally supply the step "Arith [ Sum ]", create the input pins (same approach as for the Output pins):

FS Picture 05.jpg FS Picture 04.jpg
Perform the same action for the second input pin "number2":
FS Picture 01.jpg FS Picture 09.jpg

You will get the following picture:

FS Picture 13 en.jpg

Execute the block again and you will get the following picture:

FS Picture 05 en.jpg

As you can see, the block could not be executed because the necessary input values for the input pins of our test module are missing. Allocate the input with fixed values:

FS Picture 09 en.jpg

Execute the block again and you will get the following picture:

FS Picture 19 en.jpg

Now go to the tab Schema. Here you can change the trigger conditions for the block. Click on the field "And-Connected". A submenu is displayed on the configuration:

FS Picture 02 en.jpg

Here you can specify which input pins must have values in order to be executed. Three options are supported:

  1. And-Connected
    All connected input pins must have values, open inputs are ignored.
  2. And
    all input pins must have values.
  3. Or
    at least one input pin must have a value.

In our case, all input values have to fit, so choose the "And" condition.

FS Picture 33 en.jpg

Take over the block and rename it into "4.Block".

Reuse of blocks

The way of working with blocks is the key to reusability and flexibility. Once a block is created it can be reused in any compound block.

Insert a new compound block by clicking the button Icon New Compound.jpg. Now drag & drop the previously created blocks into the network (activity diagram) of the new block.

FS Picture 34 en.jpg

Add additional blocks from the Standard Library and make the connections as shown in the following activity diagram.
You can find the blocks under the following categories:

  • Data Generators
    Random [ Integers ]
  • Compare
    Compare [ Greater 2-Way ]
  • Assertions, Exceptions & Logging
    Log [ Info ], Log [ Failure ]

FS Picture 16 en.jpg

Due to the upstreamed "Random [Integers ]" step, the created "4.Block" is supplied by different values, leading to different results. This can be seen best, when you execute the block in the Test tab a few times.

FS Picture 11 en.jpg

Take over the block and rename it into "5.Block".

Sequential execution of steps

For a graph with no data flows (i.e., with exclusive control flows), trigger inputs will be connected with trigger outputs, creating a pure flow chart.
To prepare, create a new compound block by clicking the button Icon New Compound.jpg. Drag and drop the blocks 1 and 2 in the network and you will get the following picture:

FS Picture 37 en.jpg

Select the "1.Block". By holding the shift key you can add the "2.Block". Both steps are now selected in the order, in which they should be executed sequentially. By clicking the button Icon Execute Sequential.png, a control flow connection from step 1 to step 2 is set. FS Picture 38 en.jpg
After executing the block in theTest tab, you will get the following picture. As you can see "1.Block" was executed before "2.Block". FS Picture 39 en.jpg
You can delete a connection by clicking it and afterwards select remove or press the button Icon Remove Connection.png.

Now, delete the existing control flow connection and set up the control flow in the reverse direction. Proceed as described above, only selecting "2.Block" before "1.Block" this time.

FS Picture 40 en.jpg

After executing the block, you will now get the following error screen:

FS Picture 41 en.jpg

As you can see the in the network editor, the "2.Block" is marked with a red exclamation mark, which means it is not ready to be executed. FS Picture 42 en.jpg

The step has an open trigger input pin. By connecting the trigger input with any other output pin, the action of the step can also be triggered.
In our case, delete the trigger input by selecting it and then press the Delete key.

To execute a step, it has to have at least one connected not-parameter pin or the auto-start attribute. Therefore, mark step 2 as an auto-start. To do so, select it and click on the button Icon Toggle Autostart.png. FS Picture 43 en.jpg
After executing the block in theTest tab, you will see the following picture. As you can recognize the "2.Block" was executed before the "1.Block". FS Picture 44 en.jpg



Creating a testplan

In expecco, a collection of several testcases is described as a testplan. During execution of a testplan, all individual testcases are executed sequentially.

To generate a new testplan, click the button Icon New Testplan.jpg on the toolbar Icon Toolbar Create.jpg.

Drag & drop the newly created blocks into the test plan editor. You will determine quickly that the "4.Block" is not addable to the testplan. Blocks with open entries can not be used within testplans.
You will get the following picture:

FS Picture 27 en.jpg

Take over the testplan and execute it by pressing the button Icon Run.png.
You will get the following picture:

FS Picture 04 en.jpg

Since the "5.Block" works internally with randomly generated input values, you will get different results with multiple executions for the testplan.

Generating a report

For preparation, execute the testplan. To create and view a detailed report about the test execution, click on the button Icon Print Report.png.

The dialog box "Report Generation / Print" will open. Prior to the report generation, you will have to determine further settings:

FS Picture 45 en.jpg

  • Output Format(s):
    The reports can be created in different output formats. A multiple selection is possible.
  • Report Language:
    Set the language for the report.
  • Paper Size:
    Only for the PDF output format the paper size is specified. For all other formats this setting will be ignored.
  • Report Template:
    Here, the content and appearance of the report can be determined.
    For more information, go to Report Generation.

Click on the button "Generate Report" to start the report generation. After generating the file is open within a browser.

Saving the testsuite

To save the testsuite, click into the menu "File""Save As...". The Save dialog will appear.


FS Picture 01 en.jpg

Summary

In our example, we have intentionally used simple blocks from the Standard Library to help you work with expecco.

On specific blocks(TCP / IP, DLL calls, FTP, ...) and various libraries and plugins, the system under test tied to expecco.


For the testing of web applications, we recommend you the document:
http://wiki.expecco.de/index.php5/Expecco_web (First steps).

Other examples can be found at:
http://wiki.expecco.de/index.php5/Examples.

Meine Werkzeuge