2. 2
gilles.perrouin@unamur.be 2
Part I (Until 16h) : sample configurations to test
Feature modelling
Sampling techniques
Discussion on the JHipster case
Part II (16h30-18h) : select behaviours to test
A (short) introduction to behaviour modelling
Behaviour-driven test case selection
Test concretisation
Open Discussion (18h-18h30)
Tutorial Agenda
27. Variability-Intensive Behaviour
Specification
soda serveSodafree
(d) Distributing soda for free
skip
pay
soda serveSoda
open
tea serveTea
(b) Selling tea and soda
close
change
pay soda serveSoda open
(a) Basic vending machine
close
change
pay soda
serveSoda open
cancel
return
(c) With a cancel purchase function
close
change
...
Instead of 12 transition systems:
VendingMachine
v
Tea
t
Free
f
Cancel
c
Soda
s
Beverages
b
[Classen et al., TSE ’13]
[A. Classen, PhD thesis, 2011]
[M. Cordy, PhD thesis, 2014]
28. Variability-Intensive Behaviour
Specification
soda serveSodafree
(d) Distributing soda for free
skip
pay
soda serveSoda
open
tea serveTea
(b) Selling tea and soda
close
change
pay soda serveSoda open
(a) Basic vending machine
close
change
pay soda
serveSoda open
cancel
return
(c) With a cancel purchase function
close
change
...
Instead of 12 transition systems:
VendingMachine
v
Tea
t
Free
f
Cancel
c
Soda
s
Beverages
b
87
6
5
1
pay/¬f
3
open/¬f
cancel/creturn/c
close/¬f
change/¬f
free/f
soda/s serveSoda/s
tea/t
skip/f
2
4
serveTea/t
+ companion feature model:
Write 1 featured transition system:
[Classen et al., TSE ’13]
[A. Classen, PhD thesis, 2011]
[M. Cordy, PhD thesis, 2014]
29. Variability-Intensive Behaviour
Specification
soda serveSodafree
(d) Distributing soda for free
skip
pay
soda serveSoda
open
tea serveTea
(b) Selling tea and soda
close
change
pay soda serveSoda open
(a) Basic vending machine
close
change
pay soda
serveSoda open
cancel
return
(c) With a cancel purchase function
close
change
...
Instead of 12 transition systems:
VendingMachine
v
Tea
t
Free
f
Cancel
c
Soda
s
Beverages
b
feature expressions
87
6
5
1
pay/¬f
3
open/¬f
cancel/creturn/c
close/¬f
change/¬f
free/f
soda/s serveSoda/s
tea/t
skip/f
2
4
serveTea/t
+ companion feature model:
Write 1 featured transition system:
[Classen et al., TSE ’13]
[A. Classen, PhD thesis, 2011]
[M. Cordy, PhD thesis, 2014]
30. Exploring the state space of an FTS
initial state, reachable
by all products
87
6
5
1 3
cancel / creturn / c
close / v
change / v
free / f soda / s serveSoda / s
tea / t
take / f
2
4
serveTea / t
pay / ¬f open / ¬f
9
take / v
31. Exploring the state space of an FTS
initial state, reachable
by all products
Transitions:
87
6
5
1 3
cancel / creturn / c
close / v
change / v
free / f soda / s serveSoda / s
tea / t
take / f
2
4
serveTea / t
pay / ¬f open / ¬f
9
take / v
➁ reachable by prods not having f.1
pay/¬f
2
32. Exploring the state space of an FTS
initial state, reachable
by all products
2
change/v
3 ➂ reachable by prods having v and not having f.
Transitions:
87
6
5
1 3
cancel / creturn / c
close / v
change / v
free / f soda / s serveSoda / s
tea / t
take / f
2
4
serveTea / t
pay / ¬f open / ¬f
9
take / v
➁ reachable by prods not having f.1
pay/¬f
2
33. Exploring the state space of an FTS
initial state, reachable
by all products
2
change/v
3 ➂ reachable by prods having v and not having f.
3
soda/s
5 ➄ reachable by prods having v, s and not having f....
Transitions:
87
6
5
1 3
cancel / creturn / c
close / v
change / v
free / f soda / s serveSoda / s
tea / t
take / f
2
4
serveTea / t
pay / ¬f open / ¬f
9
take / v
➁ reachable by prods not having f.1
pay/¬f
2
34. Exploring the state space of an FTS
initial state, reachable
by all products
2
change/v
3 ➂ reachable by prods having v and not having f.
1
free/f
3 ➂ reachable by prods having f (or having v and not having f).
3
soda/s
5 ➄ reachable by prods having v, s and not having f....
Transitions:
87
6
5
1 3
cancel / creturn / c
close / v
change / v
free / f soda / s serveSoda / s
tea / t
take / f
2
4
serveTea / t
pay / ¬f open / ¬f
9
take / v
➁ reachable by prods not having f.1
pay/¬f
2
35. Exploring the state space of an FTS
initial state, reachable
by all products
2
change/v
3 ➂ reachable by prods having v and not having f.
1
free/f
3 ➂ reachable by prods having f (or having v and not having f).
3
soda/s
5 ➄ reachable by prods having v, s and not having f....
3
soda/s
5 ➄ reachable by prods having f, s (or having v, s and not having f).
...
Transitions:
87
6
5
1 3
cancel / creturn / c
close / v
change / v
free / f soda / s serveSoda / s
tea / t
take / f
2
4
serveTea / t
pay / ¬f open / ¬f
9
take / v
➁ reachable by prods not having f.1
pay/¬f
2
43. How much worth is it? (excerpt)
Small SPL, 4 products
0s
8s
17s
25s
33s
42s
50s
P1.1 P1.2 P1.3 P1.4 P1.5 P1.6
Medium SPL, 64
products
0s
25s
50s
75s
100s
125s
150s
P1.1 P1.2 P1.3 P1.4 P1.5 P1.6
x TS 1 FTS (lower is better)
44. Getting Featured Transition Systems
• Forward engineering:
draw your (UML, Simulink …) models and
automatically derive the FTS
• Reverse engineering:
build back the FTS from previous, logged
executions of your systems
45. Forward engineering of FTS
case study
C++ code
with IFDEFs
Informal
statecharts
+ variability
out of sync
model
checking
ProVeLines
instance Visual
statecharts
+ variability
Formal -based
DSL for statecharts
+ variability
67. How to define and select test cases for an SPL,
based on its behaviour?
68. Model-Based Testing (MBT) process
Test suite
selection
tool
Model
Test
scripts
Mapping
info.
Concretizer
Test execution
environment
System
under
test
adaptor
Abstract
test
suite
69. Model-Based Testing (MBT) process
Test suite
selection
tool
Model
Test
scripts
Mapping
info.
Concretizer
Test execution
environment
System
under
test
adaptor
Abstract
test
suite
70. Model-Based Testing (MBT) process
Test suite
selection
tool
Model
Test
scripts
Mapping
info.
Concretizer
Test execution
environment
System
under
test
adaptor
Abstract
test
suite
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
71. Model-Based Testing (MBT) process
Test suite
selection
tool
Model
Test
scripts
Mapping
info.
Concretizer
Test execution
environment
System
under
test
adaptor
Abstract
test
suite
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
72. Model-Based Testing (MBT) process
Test suite
selection
tool
Model
Test
scripts
Mapping
info.
Concretizer
Test execution
environment
System
under
test
adaptor
Abstract
test
suite
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
Test caseTest caseTest caseTest caseTest caseTest caseTest caseTest caseTest case
Test case
73. Test suite
selection
tool
Model
Test
scripts
Mapping
info.
Concretizer
Test execution
environment
System
under
test
adaptor
Abstract
test
suite
Model-Based Testing (MBT) process
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
Test caseTest caseTest caseTest caseTest caseTest caseTest caseTest caseTest case
Test case
74. Test suite
selection
tool
Model
Test
scripts
Mapping
info.
Concretizer
Test execution
environment
System
under
test
adaptor
Abstract
test
suite
Model-Based Testing (MBT) process
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
Test caseTest caseTest caseTest caseTest caseTest caseTest caseTest caseTest case
Test case
75. Test suite
selection
tool
Model
Test
scripts
Mapping
info.
Concretizer
Test execution
environment
System
under
test
adaptor
Abstract
test
suite
Model-Based Testing (MBT) process
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
Test caseTest caseTest caseTest caseTest caseTest caseTest caseTest caseTest case
Test case
insert_card
76. Test suite
selection
tool
Model
Test
scripts
Mapping
info.
Concretizer
Test execution
environment
System
under
test
adaptor
Abstract
test
suite
Model-Based Testing (MBT) process
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
Test caseTest caseTest caseTest caseTest caseTest caseTest caseTest caseTest case
Test case
insert_card
77. Test suite
selection
tool
Model
Test
scripts
Mapping
info.
Concretizer
Test execution
environment
System
under
test
adaptor
Abstract
test
suite
Model-Based Testing (MBT) process
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
TestTestTestTestTestTestTestTestTestTest case
Test caseTest caseTest caseTest caseTest caseTest caseTest caseTest caseTest case
Test case
insert_card
78. Behavioural MBT of SPLs process
FTS
model
VIBeS
Abstract
test suite selection
Products
prioritization
Mutation analysis
Test
scripts
Mapping
info.
AbsCon
Product
config. Product
adaptor
derivation
Feature
model
+
Abstract
test suite
[Devroey et al., ISoLA ‘12]
79. Behavioural MBT of SPLs process
FTS
model
VIBeS
Abstract
test suite selection
Products
prioritization
Mutation analysis
Test
scripts
Mapping
info.
AbsCon
Product
config. Product
adaptor
derivation
Feature
model
+
Abstract
test suite
Structural-driven
[Devroey et al., ISoLA ‘14]
[Devroey et al., SPLAT@SPLC ‘14]
[Devroey et al., ISoLA ‘12]
Usage-driven
[Devroey et al., VaMoS ’14]
[Devroey et al., SoSyM ’17]
Dissimilarity-driven
[Devroey et al., VaMoS ’16]
80. Behavioural MBT of SPLs process
FTS
model
VIBeS
Abstract
test suite selection
Products
prioritization
Mutation analysis
Test
scripts
Mapping
info.
AbsCon
Product
config. Product
adaptor
derivation
Feature
model
+
Abstract
test suiteFeatured Mutants Model (FMM)
[Devroey et al., FSE ‘14]
[Devroey et al., ICSE ‘16]
[Devroey et al., ISoLA ‘12]
Equivalent mutants detection
[Devroey et al., ICST ’17]
81. Behavioural MBT of SPLs process
FTS
model
VIBeS
Abstract
test suite selection
Products
prioritization
Mutation analysis
Test
scripts
Mapping
info.
AbsCon
Product
config. Product
adaptor
derivation
Feature
model
+
Abstract
test suite
[Devroey et al., ISoLA ‘12]
Jeremy
Vanhecke
84. Feature Model (FM)
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
85. Feature Model (FM)
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
86. Feature Model (FM)
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
87. Feature Model (FM)
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
108. (Positive abstract) test case
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
t = (insert_card, select_app, check_PIN_online, go_online,
update_card_info, remove_card)
109. (Positive abstract) test case
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
t = (insert_card, select_app, check_PIN_online, go_online,
update_card_info, remove_card)
110. (Positive abstract) test case
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
t = (insert_card, select_app, check_PIN_online, go_online,
update_card_info, remove_card)
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
(dd ∨ cr) ∧ (on ∧ pin) ∧ (on) ∧ CNF( )
111. (Positive abstract) test case
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
t = (insert_card, select_app, check_PIN_online, go_online,
update_card_info, remove_card)
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
(dd ∨ cr) ∧ (on ∧ pin) ∧ (on) ∧ CNF( )prod(fts, t) =
112. Test suite and structural coverage
• Test suite
• s = (t1, t2, …, tn)
• Structural coverage criterion
• Associates an FTS and a test suite to a real
value between 0 and 1
113. State/all-states
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
coverage(fts,s)
=
states visited by s / number of states in fts
114. State/all-states
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
coverage(fts,s)
=
states visited by s / number of states in fts
115. State/all-states
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
coverage(fts,s)
=
states visited by s / number of states in fts
121. Product prioritisation
• P-coverage
• Coverage reached by sp⊆s,
the test cases from s
executable by p
t1
t2
t3
t4
t5
t6
t7
t8
p = prod(fts,{t1,t2,t4,t5})
122. Product prioritisation
• P-coverage
• Coverage reached by sp⊆s,
the test cases from s
executable by p
• P-coverage upper
bound
• Product p able to execute
sp⊆s with the best coverage
t1
t2
t3
t4
t5
t6
t7
t8
p = prod(fts,{t1,t2,t4,t5})
t1
t2
t3
t4
t5
t6
t7
t8
p = prod(fts, {t3,t4,t5,t8})
with best coverage(fts, {t3,t4,t5,t8})
139. Product prioritisation
• s = (t1, …, tn)
• t1 more dissimilar than t2 (local distance)
• t1 more dissimilar than (t2, …, tn) (global distance)
• P-coverage upper bound
• Product(s) able to execute the longest prefix of s
158. AbsCon: a QTaste plugin
Jeremy
Vanhecke
https://github.com/modji-be/AbsCon
159.
160. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
<realisation id="Google testing">
…
<tests>
<test>
<action>start</action>
<action>goHomePage</action>
<assert>onHomePage</assert>
<action>inputSearchString</action>
<assert>searchResultsPrinted</assert>
<action>clickLink</action>
<assert>pageLoaded</assert>
<action>exit</action>
</test>
...
</tests>
</realisation>
161. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
from qtaste import *
from UiMappings import *
#Actions definition
def goHomePage():
googlePage.open()
def inputSearchString():
searchBar.enterValue(testData.getValue("SEARCHVALUE"))
...
#Asserts definition
def searchResultsPrinted():
googlePage.waitForPage()
if (not(navPicture.exists())):
time.sleep(3) # wait for loading and retry
return navPicture.exists()
...
<realisation id="Google testing">
…
<tests>
<test>
<action>start</action>
<action>goHomePage</action>
<assert>onHomePage</assert>
<action>inputSearchString</action>
<assert>searchResultsPrinted</assert>
<action>clickLink</action>
<assert>pageLoaded</assert>
<action>exit</action>
</test>
...
</tests>
</realisation>
162. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
from qtaste import *
from UiMappings import *
#Actions definition
def goHomePage():
googlePage.open()
def inputSearchString():
searchBar.enterValue(testData.getValue("SEARCHVALUE"))
...
#Asserts definition
def searchResultsPrinted():
googlePage.waitForPage()
if (not(navPicture.exists())):
time.sleep(3) # wait for loading and retry
return navPicture.exists()
...
<realisation id="Google testing">
…
<tests>
<test>
<action>start</action>
<action>goHomePage</action>
<assert>onHomePage</assert>
<action>inputSearchString</action>
<assert>searchResultsPrinted</assert>
<action>clickLink</action>
<assert>pageLoaded</assert>
<action>exit</action>
</test>
...
</tests>
</realisation>
163. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
from qtaste import *
from UiMappings import *
#Actions definition
def goHomePage():
googlePage.open()
def inputSearchString():
searchBar.enterValue(testData.getValue("SEARCHVALUE"))
...
#Asserts definition
def searchResultsPrinted():
googlePage.waitForPage()
if (not(navPicture.exists())):
time.sleep(3) # wait for loading and retry
return navPicture.exists()
...
<realisation id="Google testing">
…
<tests>
<test>
<action>start</action>
<action>goHomePage</action>
<assert>onHomePage</assert>
<action>inputSearchString</action>
<assert>searchResultsPrinted</assert>
<action>clickLink</action>
<assert>pageLoaded</assert>
<action>exit</action>
</test>
...
</tests>
</realisation>
164. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
from qtaste import *
from UiMappings import *
#Actions definition
def goHomePage():
googlePage.open()
def inputSearchString():
searchBar.enterValue(testData.getValue("SEARCHVALUE"))
...
#Asserts definition
def searchResultsPrinted():
googlePage.waitForPage()
if (not(navPicture.exists())):
time.sleep(3) # wait for loading and retry
return navPicture.exists()
...
165. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
from qtaste import *
from UiMappings import *
#Actions definition
def goHomePage():
googlePage.open()
def inputSearchString():
searchBar.enterValue(testData.getValue("SEARCHVALUE"))
...
#Asserts definition
def searchResultsPrinted():
googlePage.waitForPage()
if (not(navPicture.exists())):
time.sleep(3) # wait for loading and retry
return navPicture.exists()
...
166. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
from qtaste import *
from UiMappings import *
#Actions definition
def goHomePage():
googlePage.open()
def inputSearchString():
searchBar.enterValue(testData.getValue("SEARCHVALUE"))
...
#Asserts definition
def searchResultsPrinted():
googlePage.waitForPage()
if (not(navPicture.exists())):
time.sleep(3) # wait for loading and retry
return navPicture.exists()
...
SEARCHVALUE;LINKTOCLICK;BROWSER;
unamur;UNamur;*firefox;
unamur;UNamur;*chrome;
unamur;UNamur;*opera;
unamur;UNamur;*safari;
ucl;UCL;*firefox;
ucl;UCL;*chrome;
ucl;UCL;*opera;
ucl;UCL;*safari;
167. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
168. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
+
169. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
170. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
171. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
+ exists(): boolean
+ getValue(): String
+ click()
accessMethod
accessValue
WebPageElement
+ enterValue(String)
WebEditBox
WebButton WebLink
WebRadio
Button
WebPictureWebText
+ start()
+ exit()
WebBrowser
api
WebElement
+ open()
+ close()
+ getTitle(): String
+ waitForPage()
address
timeout
WebPage
*
172. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
+ exists(): boolean
+ getValue(): String
+ click()
accessMethod
accessValue
WebPageElement
+ enterValue(String)
WebEditBox
WebButton WebLink
WebRadio
Button
WebPictureWebText
+ start()
+ exit()
WebBrowser
api
WebElement
+ open()
+ close()
+ getTitle(): String
+ waitForPage()
address
timeout
WebPage
*
173. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
174. Assertions and actions
Verifications and operations (Operations.py)
maps
Interface model inst.
(UiMapping.py)
QTaste data mapping
mechanism
uses
Test API
SUT's interface
CSV (TestData.csv)
178. Dissimilarity selection
⊗
Jaccardp Hamminga × avg
Dissp Dissa
Jaccarda Dicea Antidicea Levenshteina
[1..*]
opt.
[1..1]
Product ∧ Action ⇒ ⊗
Dissimilarity Sort
(1+1) EA
Local Global
+ k: the number of test cases
+ d: the duration
FTS
model
VIBeS
Abstract
test suite selection
Products
prioritization
Mutation analysis
Test
scripts
Mapping
info.
AbsCon
Product
config. Product
adaptor
derivation
Feature
model
+
Abstract
test suite
179. Dissimilarity selection
⊗
Jaccardp Hamminga × avg
Dissp Dissa
Jaccarda Dicea Antidicea Levenshteina
[1..*]
opt.
[1..1]
Product ∧ Action ⇒ ⊗
Dissimilarity Sort
(1+1) EA
Local Global
+ k: the number of test cases
+ d: the duration
FTS
model
VIBeS
Abstract
test suite selection
Products
prioritization
Mutation analysis
Test
scripts
Mapping
info.
AbsCon
Product
config. Product
adaptor
derivation
Feature
model
+
Abstract
test suite
Init Card_in
Aborted
insert_card/ 1.0
abort/ 0.2
remove_card / 1.0
select_app
/ 0.8
App_init
CH_verified
check_PIN_online
/ 0.6
check_PIN
_offline
/ 0.3
check_
signature
/ 0.1
Go_online Go_offline
no_go / 0.1
go_offline / 0.2go_online / 0.7
Completed update_card_info / 1.0
update_card_info / 1.0
remove_card / 1.0
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Test caseTest caseTest caseTest caseTest caseTest caseTest caseTest caseTest case
Test case
Selection
180. Dissimilarity selection
⊗
Jaccardp Hamminga × avg
Dissp Dissa
Jaccarda Dicea Antidicea Levenshteina
[1..*]
opt.
[1..1]
Product ∧ Action ⇒ ⊗
Dissimilarity Sort
(1+1) EA
Local Global
+ k: the number of test cases
+ d: the duration
FTS
model
VIBeS
Abstract
test suite selection
Products
prioritization
Mutation analysis
Test
scripts
Mapping
info.
AbsCon
Product
config. Product
adaptor
derivation
Feature
model
+
Abstract
test suite
Init Card_in
Aborted
insert_card/ 1.0
abort/ 0.2
remove_card / 1.0
select_app
/ 0.8
App_init
CH_verified
check_PIN_online
/ 0.6
check_PIN
_offline
/ 0.3
check_
signature
/ 0.1
Go_online Go_offline
no_go / 0.1
go_offline / 0.2go_online / 0.7
Completed update_card_info / 1.0
update_card_info / 1.0
remove_card / 1.0
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Test caseTest caseTest caseTest caseTest caseTest caseTest caseTest caseTest case
Test case
Selection
https://github.com/xdevroey/yami
181. Dissimilarity selection
⊗
Jaccardp Hamminga × avg
Dissp Dissa
Jaccarda Dicea Antidicea Levenshteina
[1..*]
opt.
[1..1]
Product ∧ Action ⇒ ⊗
Dissimilarity Sort
(1+1) EA
Local Global
+ k: the number of test cases
+ d: the duration
FTS
model
VIBeS
Abstract
test suite selection
Products
prioritization
Mutation analysis
Test
scripts
Mapping
info.
AbsCon
Product
config. Product
adaptor
derivation
Feature
model
+
Abstract
test suite
Init Card_in
Aborted
insert_card/ 1.0
abort/ 0.2
remove_card / 1.0
select_app
/ 0.8
App_init
CH_verified
check_PIN_online
/ 0.6
check_PIN
_offline
/ 0.3
check_
signature
/ 0.1
Go_online Go_offline
no_go / 0.1
go_offline / 0.2go_online / 0.7
Completed update_card_info / 1.0
update_card_info / 1.0
remove_card / 1.0
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Test caseTest caseTest caseTest caseTest caseTest caseTest caseTest caseTest case
Test case
Selection
VIBeS
toolbox
DSL
selection
transformation
execution
mutation
core
fexpression
<<uses>>
Model definition
public class CPTerminalFts extends
FeaturedTransitionSystemDefinition {
@Override
protected void define() {
initial("i");
from("i").action("insert_card")
.to("CardIn");
from("cardIn").action("init_schema")
.fexpr("dd || cr").to("App_init");
…}}
Structural coverage selection
FeaturedTransitionSystem fts =
new CPTerminalFts().getTransitionSystem();
SolverFacade solver =
new Sat4JSolverFacade(dimacsFile);
TestSet set = allStatesSelection(fts, solver);
Dissimilarity selection
...
set = from(fts, solver)
.withLocalMaxDistance(
ftsDissimilarity(solver,levenshtein()))
.during(10000) //sec.
.generate(20); //test-cases
https://github.com/xdevroey/yami
182. Dissimilarity selection
⊗
Jaccardp Hamminga × avg
Dissp Dissa
Jaccarda Dicea Antidicea Levenshteina
[1..*]
opt.
[1..1]
Product ∧ Action ⇒ ⊗
Dissimilarity Sort
(1+1) EA
Local Global
+ k: the number of test cases
+ d: the duration
FTS
model
VIBeS
Abstract
test suite selection
Products
prioritization
Mutation analysis
Test
scripts
Mapping
info.
AbsCon
Product
config. Product
adaptor
derivation
Feature
model
+
Abstract
test suite
Init Card_in
Aborted
insert_card/ 1.0
abort/ 0.2
remove_card / 1.0
select_app
/ 0.8
App_init
CH_verified
check_PIN_online
/ 0.6
check_PIN
_offline
/ 0.3
check_
signature
/ 0.1
Go_online Go_offline
no_go / 0.1
go_offline / 0.2go_online / 0.7
Completed update_card_info / 1.0
update_card_info / 1.0
remove_card / 1.0
Init Card_in
Aborted
insert_card
abort
remove_card
select_app
/ dd ∨ cr
App_init
CH_verified
check_PIN_online
/ on ∧ pin
check_PIN
_offline
/ off ∧ pin
check_
signature
/ ¬dd ∧ sig
Go_online Go_offline
no_go
go_offline / offgo_online / on
Completed update_card_info
update_card_info
remove_card
CPTerminal t
Identification id
DirectDebit dd CreditCard cr Online on Offline off PIN pin Signature sig
requires
PaymentSchema ps Connectivity c
[1..*]
opt.
Test caseTest caseTest caseTest caseTest caseTest caseTest caseTest caseTest case
Test case
Selection
VIBeS
toolbox
DSL
selection
transformation
execution
mutation
core
fexpression
<<uses>>
Model definition
public class CPTerminalFts extends
FeaturedTransitionSystemDefinition {
@Override
protected void define() {
initial("i");
from("i").action("insert_card")
.to("CardIn");
from("cardIn").action("init_schema")
.fexpr("dd || cr").to("App_init");
…}}
Structural coverage selection
FeaturedTransitionSystem fts =
new CPTerminalFts().getTransitionSystem();
SolverFacade solver =
new Sat4JSolverFacade(dimacsFile);
TestSet set = allStatesSelection(fts, solver);
Dissimilarity selection
...
set = from(fts, solver)
.withLocalMaxDistance(
ftsDissimilarity(solver,levenshtein()))
.during(10000) //sec.
.generate(20); //test-cases
AbsCon: a QTaste plugin
Jeremy
Vanhecke
https://github.com/xdevroey/yami