Applying modern software development techniques to automating the web UI

room: Regency D — time: Thursday 11:00-11:45
Level: Practicing

In today’s Agile development environment, UI testing is still very much done the old way. We still see long scripts that are easily broken and impossible to maintain. By applying modern software development techniques like test first development, refactoring, and pair programming we can seek to make better tests that are less fragile and more likely to discover defects in code. In this session we will demonstrate the techniques listed above and discuss how they can be applied to UI testing. The demonstration will use a combination of fitnesse and SWAT (an open source web UI testing tool).

Process/Mechanics

The session will be a combination of power point slides and open coding examples. A single test scenario based on two user stories will be used to demonstrate different testing techniques.

User Stories:

-As a user I want to log in website XYZ
-As a user I want to be able to view my name on the home page
-As a user I want to be able to update my first and last name

Demonstrated Techniques:

-Pair testing \ programming
-Refactoring
-Test first development

Tools used

-Fitnesse (http://fitnesse.org/)
-SWAT(https://sourceforge.net/projects/ulti-swat/)

Method of demonstration:

We will start out the presentation by scripting the first story using normal linear scripting techniques that is the norm for UI automation. As we finish the first story and move onto the 2nd and 3rd stories we will start to look at the similarieties between the 3 tests we are creating and start examining how we can apply refactoring techniques to limit the amount of code generation needed for UI tests. Secondly we will discuss how using refactoring techniques will create a de facto Domain Specific Language by using well named functions to encompass different groups of automated tasks. We will also examine how users can apply test first principles to write the automation before the page itself is written. Lastly as we go through the exercise we will demonstrate the benefits of using pair testing to identify missing test cases, mistakes in code, and room for improvement.

Additionally a period of 10-15 minutes will be left at the end for Q/A.

Learning outcomes
  • Writing UI tests in general and how to test all levels of the application at once
  • New techniques for writing UI tests faster and more resistant to fragility
Featured participants
Primary target persona