Writing Testing Procedure in Use Case Flow of Events
You can define the steps needed to complete a use case. Furthermore, you can create test cases around the steps, to make sure the use case will be completed correctly in any situations. In this tutorial, we will create test case for a use case named Login.
- Download Webmail System.vpp. You can also find this file at the bottom of this tutorial.
- Open the downloaded .vpp file in Visual Paradigm. To open a project, select Project > Open from the application toolbar.
- Open use case diagram Webmail System Use Case Model. You should see this:
- We need to edit the test case of a use case. To do so, open the Use Case Details on use case Login by right clicking on it and selecting Use Case Details from the popup menu.
- Open the page of Flow of Events. The use case Login is formed by a number of simple steps – enter username and passowrd, and click Submit. What we need to do is write test case to make sure this three steps will work as expected in the final product.
- Move the mouse pointer to the right hand side of the flow of events, click on the drop down menu (Menu) and select Main. This drop down menu is for selection of test case. Main is the default one.
Now, the flow of events page is divided into three columns – Steps, Procedures and Expected Results. By walking through the steps, the use case is said to be completed. Procedures and expected results are made for testing purposes. Procedures are the steps needed to test a step, while expected results are the outcome expected by performing the testing procedures.
- We want to start by writing a valid test case. In step one, we shall test the entering of username by entering peter, assuming that peter is a valid and existing user, and expect to have name peter show on the username field. Enter Fill in peter as username in Procedures cell of step 1. There is no doubt that entering text in a field will have the text appear on the field, so we simply omit expected results here. If you like you can still enter Text “peter” show in username field, but just look a bit cumbersome.
- For step two Enter password, specify Fill in mypwd as password in Procedures cell. In order to make sure a proper password field is used, we need to specify the expected results by entering Five asterisk (i.e. *) characters are shown in Expected Results cell.
- For step three, specify Click [Submit] in Procedures cell. Enter Peter’s Inbox is shown in expected results.
- The naming of test case Main is not descriptive enough. Let’s change it. Click on the … button next to the drop down menu Main.
- In the Testing Procedures dialog box, right click Main and select Rename from the popup menu. Enter Login with valid username and password as name.
- Let’s add another test case for testing invalid usage. In the Testing Procedures dialog box, click on the + button, enter Login without username and password as name. Confirm the changes and go back to the page of flow of events.
- The test case is now Login without username and password. Let’s fill in the procedures and expected results as shown below:
Steps Procedures Expected Results Enter username Do not enter anything Enter password Do not enter anything Click [Submit] to open the Inbox page Click [Submit] Warning : “Please specify username and password” appear. Login aborted.
- Save the project. This ends the tutorial.