Top Banner
Capture-Replay and Test Capture-Replay and Test Automation Automation Jerzy.Nawrocki@ put . poznan . pl www.cs.put.poznan.pl/ jnawrocki/models/ Models and Analysis of Software Lecture 9 Copyright, 2003 Jerzy R. Nawrocki
36

Capture-Replay and Test Automation [email protected] Models and Analysis of Software Lecture 9 Copyright,

Dec 24, 2015

Download

Documents

Miles Jones
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: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

Capture-Replay and Test AutomationCapture-Replay and Test Automation

[email protected]/jnawrocki/models/

Models and Analysis of SoftwareLecture 9

Copyright, 2003 Jerzy R. Nawrocki

Page 2: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The Scribble applicationThe Scribble application

1 Belgium2 Denmark3 Netherlands

New item added in order

1 Netherlands Initial state

1 Netherlands2 Belgium

New item added – end

1 Belgium2 Netherlands

Sorted

1 Denmark2 Netherlands

Old item deleted

Enter: Belgium

Enter: Denmark

Enter: 1

Sort

Page 3: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

Manual test for ScribbleManual test for Scribble

BelgiumNetherlandsUK

Add 2 new items to the sorted list.

Move an item (the list gets unsorted).

Add an item to the unsorted list.

Delete an item.

Try to delete an invalid item (position)

countries.dcm

countries2.dcm

Page 4: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The screen shots – Starting the ScribbleThe screen shots – Starting the Scribble ScribbleFile LList ist

Page 5: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The screen shots – Openning a fileThe screen shots – Openning a file ScribbleFile LList ist

NewCCloselosePPrintrintExit

Open

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Page 6: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The screen shots – Adding an item (Sweden)The screen shots – Adding an item (Sweden) ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End> Add ItemAdd Item

OKOK

CancelCancelSweden|Sweden|

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

New ListNew ListSort ListNew ListNew ListSort List

Del ItemMov ItemDel ItemMov Item

Add ItemAdd Item

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsSwedenUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsSwedenUK<List End>

Page 7: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The screen shots – Adding an item (USA)The screen shots – Adding an item (USA) ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsSwedenUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsSwedenUK<List End>

Add ItemAdd ItemOKOK

CancelCancelUSA|USA|

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsSwedenUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsSwedenUK<List End>

New ListNew ListSort ListNew ListNew ListSort List

Del ItemMov ItemDel ItemMov Item

Add ItemAdd Item

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsSwedenUKUSA<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsSwedenUKUSA<List End>

Page 8: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The screen shots – Moving an itemThe screen shots – Moving an item ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsSwedenUKUSA<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsSwedenUKUSA<List End>

New ListNew ListSort ListAdd ItemDel Item

New ListNew ListSort ListAdd ItemDel Item

Mov ItemMov Item

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>1 Belgium2 Netherlands3 Sweden4 UK5 USA<List End>

Countries on our mailing list are:<List>1 Belgium2 Netherlands3 Sweden4 UK5 USA<List End>

Move ItemMove Item

OKOK

CancelCancel44From

11To

ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>UKBelgiumNetherlandsSwedenUSA<List End>

Countries on our mailing list are:<List>UKBelgiumNetherlandsSwedenUSA<List End>

Page 9: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The screen shots – Adding an item (Norway)The screen shots – Adding an item (Norway) ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>UKBelgiumNetherlandsSwedenUSA<List End>

Countries on our mailing list are:<List>UKBelgiumNetherlandsSwedenUSA<List End>

Add ItemAdd ItemOKOK

CancelCancelNorway|Norway|

ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>UKBelgiumNetherlandsSwedenUSA<List End>

Countries on our mailing list are:<List>UKBelgiumNetherlandsSwedenUSA<List End>

New ListNew ListSort ListNew ListNew ListSort List

Del ItemMov ItemDel ItemMov Item

Add ItemAdd Item

ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>UKBelgiumNetherlandsSwedenUSANorway<List End>

Countries on our mailing list are:<List>UKBelgiumNetherlandsSwedenUSANorway<List End>

Page 10: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The screen shots – Deleting a valid itemThe screen shots – Deleting a valid item ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>1 UK2 Belgium3 Netherlands4 Sweden5 USA6 Norway<List End>

Countries on our mailing list are:<List>1 UK2 Belgium3 Netherlands4 Sweden5 USA6 Norway<List End>

Delete Item

From Position

Delete Item

From PositionOKOK

CancelCancel

22

ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>UKBelgiumNetherlandsSwedenUSANorway<List End>

Countries on our mailing list are:<List>UKBelgiumNetherlandsSwedenUSANorway<List End>

New ListNew ListSort ListAdd Item

New ListNew ListSort ListAdd Item

Mov ItemMov ItemDel ItemDel Item

ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>UKNetherlandsSwedenUSANorway<List End>

Countries on our mailing list are:<List>UKNetherlandsSwedenUSANorway<List End>

Page 11: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The screen shots – Deleting an invalid itemThe screen shots – Deleting an invalid item ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>1 UK2 Netherlands3 Sweden4 USA5 Norway<List End>

Countries on our mailing list are:<List>1 UK2 Netherlands3 Sweden4 USA5 Norway<List End>

Delete Item

From Position

Delete Item

From PositionOKOK

CancelCancel

77

ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>UKNetherlandsSwedenUSANorway<List End>

Countries on our mailing list are:<List>UKNetherlandsSwedenUSANorway<List End>

New ListNew ListSort ListAdd Item

New ListNew ListSort ListAdd Item

Mov ItemMov ItemDel ItemDel Item

ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>1 UK2 Netherlands3 Sweden4 USA5 Norway<List End>

Countries on our mailing list are:<List>1 UK2 Netherlands3 Sweden4 USA5 Norway<List End>

Delete Error

Position Not Valid

OK

Page 12: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The screen shots – ClosingThe screen shots – Closing ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>UKNetherlandsSwedenUSANorway<List End>

Countries on our mailing list are:<List>UKNetherlandsSwedenUSANorway<List End>

OOpenpenNNew ew OOpenpenNNew ew

PrintEExitxitPrintEExitxit

CloseClose

ScribbleFile List File Name countriescountries List UnsortedUnsorted

Countries on our mailing list are:<List>1 UK2 Netherlands3 Sweden4 USA5 Norway<List End>

Countries on our mailing list are:<List>1 UK2 Netherlands3 Sweden4 USA5 Norway<List End>

Close

Save the document?

OKOK

ii

No

Page 13: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The screen shots – ExitingThe screen shots – Exiting ScribbleFile LList ist

Scribble

File LList ist

OpenNewCCloselosePPrintrintExit

Page 14: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click

Page 15: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu

ScribbleFile LList ist

Page 16: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click

ScribbleFile LList ist

Page 17: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option

ScribbleFile LList ist

NewCCloselosePPrintrintExit

Open

Page 18: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option6 Click

ScribbleFile LList ist

NewCCloselosePPrintrintExit

Open

Page 19: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option6 Click7 Move mouse to countries.dcm

Page 20: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option6 Click7 Move mouse to countries.dcm8 Double click

Page 21: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option6 Click7 Move mouse to countries.dcm8 Double click9 Move mouse to List menu

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Page 22: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option6 Click7 Move mouse to countries.dcm8 Double click9 Move mouse to List menu10 Click

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Page 23: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option6 Click7 Move mouse to countries.dcm8 Double click9 Move mouse to List menu10 Click11 Move mouse to Add Item

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

New ListNew ListSort ListNew ListNew ListSort List

Del ItemMov ItemDel ItemMov Item

Add ItemAdd Item

Page 24: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option6 Click7 Move mouse to countries.dcm8 Double click9 Move mouse to List menu10 Click11 Move mouse to Add Item12 Click

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

New ListNew ListSort ListNew ListNew ListSort List

Del ItemMov ItemDel ItemMov Item

Add ItemAdd Item

Page 25: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option6 Click7 Move mouse to countries.dcm8 Double click9 Move mouse to List menu10 Click11 Move mouse to Add Item12 Click13 Type Sweden

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End> Add ItemAdd Item

OKOK

CancelCancelSweden|Sweden|

Page 26: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

What was the test input?What was the test input?1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option6 Click7 Move mouse to countries.dcm8 Double click9 Move mouse to List menu10 Click11 Move mouse to Add Item12 Click13 Type Sweden14 Move mouse to OK button

ScribbleFile List File Name countriescountries List SortedSorted

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End>

Countries on our mailing list are:<List>BelgiumNetherlandsUK<List End> Add ItemAdd Item

OKOK

CancelCancelSweden|Sweden|

Page 27: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The manual test processThe manual test process1 Move mouse to Scribble icon2 Double click3 Move mouse to File menu4 Click5 Move mouse to Open option6 Click7 Move mouse to countries.dcm8 Double click9 Move mouse to List menu10 Click11 Move mouse to Add Item12 Click13 Type Sweden14 Move mouse to OK button

The amount of effort to automate a test case:

2 – 10 times the effort required to run the test manually (!)

Page 28: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The manual test processThe manual test processUnscripted manual testing:

1. Identify conditions to test

2. Think up specific inputs

3. Enter the inputs

4. Checked it worked OK

Page 29: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The manual test processThe manual test processUnscripted manual testing

Vague manual scripts:

1. Read what to do

2. Think up specific inputs

3. Enter the inputs

4. Checked it worked OK

Page 30: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

Vague manual scriptVague manual script

1 Run up Scribble File menu displayed

2 Open file with sorted List File contents displayed

3 Add some items to List Items added in order

4 Move an item Item moved, List now unsorted

5 Add an item Item added at end of List

6 Delete item form list Item deleted

7 Use invalid position number Error message displayed

to delete an item

8 Save changes in new file End of test

Page 31: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

The manual test processThe manual test processUnscripted manual testing

Vague manual scripts

Detailed manual scripts:

1. Read what to do

2. Enter the inputs

3. Checked it worked OK

Page 32: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

Detailed manual scriptDetailed manual script

1 Click on Scribble icon Scribble opened, File menu enabled2 Move mouse to File menu, click Options available: Open, New, Exit3 Move mouse to Open option, Filenames displayed including click countries.dcm4 Move mouse to countries.dcm Text plus List of 3 countries:

Belgium, Netherlands, UK, File and List menus displayed

. . . . . .

Page 33: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

Automating test executionAutomating test execution

Automated scripts are not like manual scripts

Don’t automate testing by simply recording

Automated execution with manual verification?

How much shoul be compared (whole, minimum, something between)?

Dynamic comparison and post-execution comparison

Automated comparison messages have to be manually checked

While tests fail the second time?

Page 34: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

ConclusionConclusion

Automated is not automaticAutomated is not automatic

Page 35: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

BibliographyBibliography

M. Fewster, D. Graham, Software M. Fewster, D. Graham, Software Test Automation, Addison-Wesley, Test Automation, Addison-Wesley, Harlow, 1999.Harlow, 1999.

Page 36: Capture-Replay and Test Automation Jerzy.Nawrocki@put.poznan.pl  Models and Analysis of Software Lecture 9 Copyright,

QuestionsQuestions??