Top Banner
Story-Based Test Automation Using Free Tools @ p a u l _ g e r r a r d Paul Gerrard [email protected] gerrardconsulting.com
35

Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard [email protected] gerrardconsulting.com.

Dec 17, 2015

Download

Documents

Kellie Stephens
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Story-Based Test Automation Using Free Tools

@paul_g

erra

rd

Paul [email protected]

gerrardconsulting.com

Page 2: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Overview

• Behaviour-Driven Development and similar approaches are still developer-focused– Don’t engage testers as they should– Don’t support higher complexity requirements– Don’t scale to a larger requirements bases

• In this session, we’ll cover:– Acceptance-driven development with free tools– How Story Platform for QA (a sub-set of

Business Story Manager) and Robot Framework can be used to implement this approach.

Intelligent Definition and Assurance Slide 2

Page 3: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Background

• We won’t go into much detail of Behaviour-Driven Development– http://

en.wikipedia.org/wiki/Behavior-driven_development for an intro

• Requirements-test hierarchies:– Go to http://businessstorymanager.com– and watch the videos.

Intelligent Definition and Assurance Slide 3

Page 4: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Behaviour-Driven Development using current tools

Intelligent Definition and Assurance Slide 4

Story (structured)

Generated Test Code

BDD Tool

Test Fixtures/Test Step Defs.

+

Write the Code + Refactor the

Code

Test Outcomes

Test Toolexecutes tests

System Under Test

Page 5: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

BDD and tool support

• A big benefit to developers is that BDD makes the Test-Driven Development approach easier

• Behaviour-Driven Development:– A collaborative approach to specification– Uses Domain–Specific Language in

specifications– Implements Ubiquitous Language

• Currently, tools only support the automated testing part of the BDD regime.

Intelligent Definition and Assurance Slide 5

Page 6: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Story Platform QA (BSM subset) Robot Framework

Intelligent Definition and Assurance Slide 6

Requirements

Story (structured) Test Cases

Test Export

Keyword Definitions

+

Write the Code+ Refactor the

Code

Test Librarye.g. Webdriverexecutes tests

Test StatusRedAmberGreen

Dictionary

System Under Test

Test Outcomes

Page 7: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Business Story Manager

Business Story Manager and Test Frameworks

Requirement

STORY: Feature Header

Business ScenarioGiven “Search page”When “I find a book” And “I add to basket”Then “basket has my book”

Just enough to clarify understanding

Test ScenarioPre-conditions “Search page”Steps “enter search text”

“click search button”“scroll down to find book”“select book”“view more information to

verify”“select add to basket”

Post Conditions/outcomes “Basket has selected book”

Generated

Story BasedTest Cases

Example: Robot FrameworkTestLog

Selenium (Web) HTTP (web) SSH DB Library Etc.

Manually maintainedKeyword

Definitions 1 per Feature

Keyword Definitions

1 per application

Technical CodePer Environment

TestConfig.

Drivers

System(s) Under Test

Page 8: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

How Does it Work?

A walkthrough of the process

using http://sp.qa

Page 9: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

The detail for the requirements selected on the left is shown

here.

Page 10: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Intelligent Definition and Assurance Slide 10

The feature identifies a capability of the system

described in the requirement

Page 11: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Intelligent Definition and Assurance Slide 11

The scenario provides an illustration of a feature in use.

Examples provide broader coverage of the feature.

Page 12: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

This test scenario has been edited to provide more detail. These are the automated test

keywords.

NB: The colour coding highlights terms defined in the

dictionary, and data items in scenarios. (The dictionary is available in the full product).

Page 13: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

The Lucky Numbers Application

Page 14: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Intelligent Definition and Assurance Slide 14

The numbers are submitted and validated and then the user is

asked to confirm the ‘play’.

Lucky numbers features:• Registration• Submit ticket• View my Game Plays• System Status• Change my profile• Reset Password• etc.

Page 15: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Intelligent Definition and Assurance Slide 15

Page 16: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Exporting Test Scenarios

Page 17: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

We’ve shown just one test scenario here for illustration.

Normally, all test scenarios are exported.

Page 18: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Intelligent Definition and Assurance Slide 18

Dropbox asks for confirmation that you want to post the test

case files to your account.

Page 19: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Intelligent Definition and Assurance Slide 19

BSM lists all the files that have been posted to your Dropbox

account.

Page 20: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Generated files and resource files

Intelligent Definition and Assurance Slide 20

The files generated by BSM have been synchronised with

your Dropbox account

These resource files correspond to your generated test case

files. You maintain your keyword definitions here.

Page 21: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Robot script and resource file

Intelligent Definition and Assurance Slide 21

The Robot Script files with test cases are generated by Business

Story Manager

The tester maintains the resource file with the keyword

definitions.

Page 22: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Tests running on a Linux VM that shares Dropbox

System Under Test

Terminal window driving the tests

Page 23: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

…and the same test on Windows 7

Intelligent Definition and Assurance Slide 23

Page 24: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Intelligent Definition and Assurance Slide 24

Page 25: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Results upload service

Intelligent Definition and Assurance Slide 25

Use a batch file or shell script to run the tests, then upload the

results to BSM/SP.QA

loadRobotOutput.py Python uploads the output file

Page 26: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Intelligent Definition and Assurance Slide 26

Page 27: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Business Story Manager Robot Framework

Intelligent Definition and Assurance Slide 27

Requirements

Story (structured) Test Cases

Test Export

Keyword Definitions

+

Write the Code+ Refactor the

Code

Test Librarye.g. Webdriverexecutes tests

Test StatusRedAmberGreen

Dictionary

System Under Test

Test Outcomes

Page 28: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Behaviour-Driven Tooling

• The essential architecture of BDD tools is that1. A tool parses stories and generates test code2. The test code can be used for TDD3. The developer (almost always) writes the step

definitions/fixture code and runs the tests4. The stories, test code and steps are all source-

controlled (in the developers’ library)

• What we have done with SP.QA and Robot is allow non-techies to own this process and align it with stakeholder needs properly.

Intelligent Definition and Assurance Slide 28

Page 29: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Summary

• SPQA and Robot Framework combined:– Support requirements of any complexity– Implement keyword-driven test automation– Manage requirements, stories and tests to any

scale

• Acceptance-driven approach:– Traceable from requirements to tests and back– Automated story acceptance and regression

testing– Build automated end-to-end acceptance tests

with reusable keywords.

Intelligent Definition and Assurance Slide 29

Page 30: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

http://sp.qa

Story Platform for QA

SP.QA provides a subset of Business Story Manager

functionality and is FREE-TO-USE.

Page 31: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Visit SP.QA to access the free Story Platform for QA web

service.

Page 32: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Go to the Image Gallery to see the requirements-test process

in pictures

Page 33: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

SP.QA Scope

• What you get– Requirements module– Business Stories and Scenarios– Test Scenarios– Robot Framework Interface

• FREE Service Limits– Limited to 100 business stories – 5 users, 1 application, 1 project

Page 34: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Intelligent Definition and Assurance

BSM Scope

• What you get– Stakeholder and Risk Management modules– Lean Task Management module– Dictionary and Library modules– Role-Based Access Control– All SP.QA Scope

• Limitations– None

• Commercials– £30 per user per month

Slide 34

Page 35: Story-Based Test Automation Using Free Tools @paul_gerrard Paul Gerrard paul@gerrardconsulting.com gerrardconsulting.com.

Story-Based Test Automation Using Free Tools

@paul_g

erra

rd

Paul [email protected]

gerrardconsulting.com