34
Version 2.3 © 2010 Bredex GmbH Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH

Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

Version 2.3© 2010 Bredex GmbH

Handling failures in automated acceptance testsAlexandra Imrie, BREDEX GmbH

Page 2: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 2

Introductions

BREDEX GmbH, Braunschweig (Germany)

Software development

and consulting

since

1987

Java�focus

since

1995

Quality

assurance

Agile processes

Alex Imrie

Linguistics

graduate

(York, UK)

Customer

support, demonstrations, training, perspective

Test coach and tester

Page 3: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 3

The

story

What

tests

should

be

telling

us

And what

stops

them

doing

this

Where

events

come from

And how

to avoid

them

where

possible

Catching

events

before

they

happen

Dealing

with

events

Test design

Event handling

strategies

Within

the

project

Page 4: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 4

Aims

of acceptance

testing

Page 5: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 5

Whatever

tests

are

telling

us…

Has to be

constant!

Only

with

knowledge

can

we

Monitor & improve

quality

Automation for

continuous feedback

Page 6: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 6

Dealing

with

errors

is

important

Page 7: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 7

Dealing

with

errors

is

important

Page 8: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 8

Let‘s

talk

about

errors: definitions

EVENT

Causes test to deviate

from

expectedexecution: a discrepancy

between

expected

state/behaviour

and actual

state/behaviour

Page 9: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 9

Definitions

EXCEPTION

A failed

assertion

(expected

& actual

value

/ status

not

same)

An event

handler

can intervene

& test can

continue

if

status

can

be

changed

check finish button

active

Page 10: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 10

Definitions

ERROR

An event

that

can‘t

be

dealt with

in the

test execution.

State or

value

cannot

be

changed, or

unknown

state

of application

Page 11: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 11

Where

do errors

come from?

Page 12: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 12

Exterminating

events?

Errors in test can

be

minimized

Better

communication

reduces

misunderstandings

Tester presence

in meetings

Errors in environment

Dedicated, well�defined

test environment

Data preparation

strategy

Deterministic

tests

Page 13: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 13

Exterminating

development

errors?

Dev

errors

can‘t

be

totally

avoided

must

be

dealt with

in the

test

But

test design

can

help

Robust synchronisation

Manual tester

intelligence

built

in

Explicit

understanding

of how

app

works

Logic, behaviour, interface

information

display

Page 14: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 14

Be prepared! (and slightly

paranoid…)

Different states

Execution

Verification

Different behaviours

Execution

Verification

Synchronization

Page 15: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 15

Different states

Execution

Invalid data:

General / Test Project

Verification

Data

Check label: 0 items

Enablement

Check save button

disabled

Page 16: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 16

Different behaviours

Execution

Menu entry

can‘t

be

selected

Component

not

found

Verification

Project not

created

Synchronisation

Progress dialog

still open

after

10 seconds

Page 17: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 17

Using

verification

to avoid

/ catch errors

Easiest

to react

to failed

state

verifications

React

to real issue, not

inherited

problem

Easier

to analyse

and deal with

If

state

can

be

corrected, test can

continue

(with

success

or

not)

Page 18: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 18

Using

verification

to avoid

/ catch errors

Easiest

to react

to failed

state

verifications

Wherever

possible, include

state

verification

Before

action:

Check existence

/ enablement

of component

Check existence

of data

before

selection

After action:

Check all results

(enablement)

Also include

behaviour

verification

(effects

in application)

Page 19: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 19

Structuring

tests

for

verification

Verify

and click

any

button

<BUTTON> Verify

existence true

<BUTTON> Verify

enablement true

<BUTTON> Click

Page 20: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 20

Structuring

tests

for

verification

Select

any

path

from

any

tree

<TREE> Verify

existence true

<TREE> Verify

enabled true

<TREE> Verify

<PATH> existence true

<TREE> Select

<PATH>

<TREE> Verify

<PATH> selected true

Page 21: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 21

Checking

challenges

and advantages

Good structure

reusable, flexible

Discipline

“Unhelpful“

GUI

Design for testability

Failed

checks

can

often be

handled

as exceptions

React

to actual

error, not

inherited

Easier

to analyse

Easier

to handle

If

state

can

be

corrected, test can

continue

Either

+ve

or �ve

Page 22: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 22

Test design

to support

event

handling

Especially

for

errors

Can‘t

be

handled

Test can‘t

continue

Independent use

cases

Specific

structure

Page 23: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 23

Some

thoughts

on set

up / tear

down

Managing

data

and preconditions

Startup

test case

Data made

available

Minimizing

dependencies

Or

at least be

aware

of them!

Page 24: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 24

Handshake

Page 25: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 25

Two

event

handling

strageties

Local

handling

Exceptions

Expected

or

known

states

Small problems

/ inconsistencies

Can

be

resolved

in test

test successful

Or

can

be

ignored

test unsuccessful, but

complete

Page 26: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 26

Two

event

handling

strategies

Global handling

Errors

Unexpected

Unknown

state

of app

results

inherited

errors

Strategy

Document

Leave

use

case

Prepare

app

for

next

use

case

Page 27: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 27

Test continues

after

exception

or

error

Page 28: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 28

Seeing

bugs

under

the

bed?

The

Essential Calvin and Hobbes, Bill Watterson

Page 29: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 29

Bugs under

the

bed…

Start with

global event

handling

Add

local

as required

Page 30: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 30

Dealing

with

errors

process

Fix it

instantly

Close to development

time / money

saved

Dev

probably

still working

on code

Affected

test up and running

quickly

Watch out for

error

driven

development!

Page 31: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 31

Dealing

with

errors

process

Write

a ticket

Better

resolution

planning

(complex

errors, higher

risk)

Follow

progress

Remove

use

case

(independent!) from

productive

tests

“Broken“

tests

Watch out for

accumulation

of tickets!

And more

tests

in broken

than

in productive

Whole

areas

of test not

running

at all

Page 32: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 32

Don‘t

test around

/ ignore

the

error!

Pressure

from

dev

team

More

errors

= more

stress

Pressure

from

management

All tests

green

Page 33: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 33

Conclusion

Always

know

your

quality!

Global event

handling

& independent use

cases

For maximum

use

case

completion

Local

event

handling

For maximum

test coverage

within

use

case

Page 34: Handling failures in automated acceptance tests Handling failures in automated acceptance tests Alexandra Imrie, BREDEX GmbH. ... Test design Event handling strategies Within the project

16.07.2010Event Handling � Starwest 2010 34

Thank

you!

Any

questions?