guimattiello / MoLeWe

Model-based testing Leverage for Web
4 stars 1 forks source link

Create README #1

Open guimattiello opened 4 years ago

guimattiello commented 4 years ago

MoLeWe

Model-based testing Leverage for Web (MoLeWe) is a tool that supports test case generation for web applications.

Table of Contents

Install

Usage

Generating a model from a test suite

Screen Shot 2020-02-20 at 14 12 24

When you click in New Web App Project, the following screen will show up.

Screen Shot 2020-02-20 at 14 32 22

Filling the inputs, the tool will list the possible Page Object classes. The user must check the classes that represent them.

molewe3-project-properties-fill

Click in the confirmation button. The model will be generated.

molewe4-inferred-model

The first test case to be created will be the search for a nonexistent user. For this, first, we need to create a node with the corresponding assert statement (assertTrue). A double click on the screen is necessary to create a new node. The Figure above shows the dialog where the user enters the description of the new node.

molewe5-create-assert

The figure above shows the new node already created, but still without the relation with the corresponding PageObject method.

molewe6-assert-created

To relate the node to the corresponding PageObject method, a right-click on the screen shows the methods available in PageObjects and some assertion options (assertEquals and assertTrue). Figure above shows the available assertion options and

molewe7-identify-assert

The figure above shows the node with the assertTrue assertion related to the node.

molewe8-assert-identified

The next step is to insert the parameter (event instance) in the statement setLastName. According to the figure above, a right-click on the desired node shows the option to access the parameter editing screen of the selected node method.

molewe9-click-parameter

The figure above shows the parameter editing screen. The Add row button at the bottom of the screen adds a new empty parameter row (event instance) to the table.

molewe10-click-add-parameter

The figure above shows the filling of this new row. The first column is the event instance id, which should not be changed by the user. The second column shows the lastName parameter, which must be changed with the desired parameter, in this case it is Davis. In the third column, a name must be inserted for this event instance, which will serve to guide the tool, allowing the generation of a single test case that contains all nodes that have an event instance with the same name. The fourth column reports that this event instance was not generated automatically, but by the user.

molewe11-fill-parameter

After setting the parameter for the setLastName method, it is necessary to configure the parameter of the assertTrue statement. To do this, you must repeat the same procedure done for the setLastName method, according to the figure above.

molewe12-click-parameter-assert

With the nodes created and the parameters configured, it remains to create the edges that connect the new nodes and form the desired test case. The figure above shows the edges created for the new inserted node.

molewe13-edges

The first test case was created, now we are going to create the node with the clearTextFields method for the second test case. The figure above shows the new node created.

molewe15-new-node-created

In this case, the clearTextFields method does not exist in the PageObjects classes. Therefore, it is necessary to create a new abstract method. The figure above illustrates the procedure for creating a new abstract method in the PageObject class called FindOwnerPage.

molewe16-new-abstract-method

To create the abstract method, it is necessary to insert the method signature, including the return type and the function parameters, according to the figure above.

molewe17-set-signature-abstract

After creating the abstract method, just relate it to the created node, as shown in the figure above.

molewe18-identify-abstract-method

Finally, insert the edges connecting the new node to form the new test case, as shown in the figure above.

molewe19-create-edges

With the test cases modeled, click Extract CESs (as shown in the figure above) to open the screen with the CES created.

molewe20-click-gen-ces

On the Extract CES screen, click on Generate testing code snippets (as shown in the figure above) to display the code of the new modeled test cases.

molewe21-click-gen-test-cases

The figure above shows the screen containing the code of the new test cases generated. This code must be copied to an IDE and integrated into the existing test suite.

molewe22-new-test-cases

Experimental Package

The experimental package can be found here.

In this URL you will find all the virtual machine files, participants projects and instructions to access the applications with preconfigured users.

Download the virtual machine for the application you want to use and the package_experimental.zip file. This file contains all the 18 participants projects.

Each project in the package_experimental.zip file has the following directories and files:

Start the application's virtual machine and check which IP the machine received.

There are two scripts on the virtual machine:

Select a project and change the IP address (according to the VM's IP) using any IDE.

Run the test project.

After running the tests, access the line coverage through the browser: