Model-Based Testing...Model-Based Testing (DIT848 / DAT261) Spring 2017 Lecture 9 Graph Theory...

Post on 14-Oct-2020

1 views 0 download

Transcript of Model-Based Testing...Model-Based Testing (DIT848 / DAT261) Spring 2017 Lecture 9 Graph Theory...

Model-Based Testing (DIT848 / DAT261)

Spring 2017 Lecture 9

Graph Theory Techniques in MBT

Gerardo Schneider Department of Computer Science and Engineering

Chalmers | University of Gothenburg 1

Outline

�  Graph Theory Techniques in Model-Based Testing,by,HarryRobinson

�  Interac1veexercises

2

Euler Graph

f A

C

B b

a

c

d

e

g IsitanEulerGraph?Answer:No,notpossibletotraversealltheedgeswithoutrepe11on(nodesAandBhaveanoddnumberoflinks)

Groups 2-5 persons: 5 min 3

Postman Problem

f A

C

B b

a

c

d

e

g

Finda“Chinese”Postman’ssolu1onAnswer:“Eulerize”thegraph(a1gca’de)

Groups 2-5 persons: 5-7 min

a’

4

New York Street Sweeper

f A

C

B b

a

c

d

e

g

Answer:“Eulerize”theDigraphGroups 2-5 persons: 10 min

Note: Digraph

[-1]

[-1]

[+2]

FindaSweeper’ssolu1on

5

New York Street Sweeper

f A

C

B b

a

c

d

e

g

“Proposal1”:a1hcgede’

Groups 2-5 persons: 10 min

Note: Digraph

h e’

FindaSweeper’ssolu1on

6 –>NOTASOLUTION!(weassumethereisanother“street”fromC1llB)

New York Street Sweeper

f A

C

B b

a

c

d

e

g

SoluCon:a1gea’ce’de’’(weonlyuseexis1ng“streets”)Groups 2-5 persons: 10 min

Note: Digraph

a’

e’

FindaSweeper’ssolu1one’’

7

Testing Combination of Actions

f A

C

B b

a

c

d

e

g

SoluCon:TransformthegraphusingdeBrujin’salgorithm(dualdigraph) Groups 2-5 persons: 10 min

Testlinkcombina+ons(2ac1ons:allpairsofadjacentac1ons)

8

Testing Combination of Actions

a

c

b Solution

Groups 2-5 persons: 15 min

f

g

d e

Problems:-”Forgot”transi1onf->b-Needto“Eulerize”theresul1nggraph 9

Testing Combination of Actions

a

c

b (Complete)

Solution

Groups 2-5 persons: 15 min

f

g

d e

10

Testing under a Time Deadline

f A

C

B b

a

c

d

e

g

SoluCon1:5hs(notrepea1ngtests)

M1:a1e(4hs)M2:dhcge’(5hs)

Groups 2-5 persons: 7 min

AssumingtheaboveDigraph,parallelizefromini1alstate

h e’

Currentminimum1me:9hs(a1hcgede’) 11

SoluCon2:4hs(repea1ngsometests)

M1:afce(4hs)M2:acge(4hs)M3:dhbe(4hs)

References � Readthepaper:GraphTheoryTechniquesinModel-BasedTesCng,byHarryRobinson(Presentedatthe1999Interna1onalConferenceonTes1ngComputerSo[ware)

�  IfyouareinterestedyoucanvisittheChinesePostmanAlgorithmbyHaroldThimblebyhomepage.Itcontainsanimplementa1onandapaperdescribingit

12