SlideShare a Scribd company logo
.lusoftware verification & validation
VVS
Bridging the Gap between Requirements
Modeling and Behavior-driven Development
Mauricio Alferez*, Fabrizio Pastore*, Mehrdad Sabetzadeh*, Lionel Briand*+
Jean-Richard Riccardix
*University of Luxembourg, +University of Ottawa, xClearstream
MODELS 2019
September 20th, 2019
Context: Acceptance Testing of
Business-critical
Information Systems
2
Given there is enough money on my account
When I make a withdrawal
Then I get the expected amount of money from the ATM
Acceptance Criteria (AC)
Business-critical
Information System
Acceptance Testing
The system meets
its requirements!
Requirements Analysis
is Supported by Models
Domain Model (Class diagram)
Participant Settlement Ins
T2S Settlement Ins
State: T2S Instruction State
Participant Notification
Reason: String [0..1]
Message: String
Settlement Instruction
SettlementDate: Date
«enumeration»
T2S Instruction
State
ToValidate
Valid
Settled
Rejected
Matched
0..*Participant
Instruction
Domain Model
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State = ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State = Settled
Send
Notification
Inx: T2S
Settlement Ins
Run Matching Process
X
days
passed
Inx: T2S Settlement Ins
State = Matched
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State = Valid
Inx: T2S Settlement Ins
State = Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State == Valid]
[Yes]
Activity Diagram 3
ucActors
Participant
«actor»
Settlement Platform
isInitialised: Boolean
Use Case Diagram
Acceptance Testing follows
Behavior Driven Development (BDD)
Acceptance Criteria based on a scenario-oriented,
Given-When-Then Gherkin structure
Feature: Perform a Settlement
Given: The settlement platform has been initialized
Scenario: Send a settlement Instruction
Given a settlement instruction with ID 'p1' is not in the instructions pool
When the Participant sends a settlement instruction with ID 'p1'
Then a settlement instruction with ID 'p1' is in the instructions pool
Scenario: Receive a settlement Instruction
Given a settlement instruction with ID 'p1' is not in the settlement platform
When the settlement platform receives a settlement instruction with ID 'p1'
Then a settlement instruction with ID 'p1' is in the settlement platform
And the property State of Inx is equal to "ToValidate"
Initial Context
Event or Action
Expected Result
Feature Under
Test
4
Test Step
Gap between Requirements
Modeling and BDD
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State =ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State =Settled
Send
Notification
Inx: T2S
Settlement Ins
Run Matching Process
X
days
passed
Inx: T2S Settlement Ins
State =Matched
ProcessInstruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State =Valid
Inx: T2S Settlement Ins
State =Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State ==
Valid]
[Yes]
Domain Model (Class diagram)
Participant Settlement Ins
T2S Settlement Ins
State: T2S Instruction State
Participant Notification
Reason: String [0..1]
Message: String
Settlement Instruction
SettlementDate: Date
«enumeratio...
T2S Instruction
State
ToValidate
Valid
Settled
Rejected
Matched
0..*Participant
Instruction
uc Actors
Participant
«actor»
Settlement Platform
isInitialised: Boolean
«Pre-condition»
{SettlementPlatform.allInstances() ->forAll (t / t.isInitialised=true)}
Requirements Modeling Acceptance Testing
Test Scenarios
Models Acceptance
Criteria
Manual
Definition of AC
5
Analysts Test Engineers
Manual Definition of AC is
Tedious and Error Prone
Models lack pre- and post-conditions of activities.
Difficult to specify test oracles.
Execution flows captured by those models are complex.
Engineers may overlook the scenarios to test.
Different analysis and testing teams.
Misunderstandings.
Requirements specifications evolve.
Additional costs.
6
AGAC: Automatic Generation of
Acceptance Criteria
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State =ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State =Settled
Send
Notification
Inx: T2S
Settlement Ins
Run Matching Process
X
days
passed
Inx: T2S Settlement Ins
State =Matched
ProcessInstruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State =Valid
Inx: T2S Settlement Ins
State =Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State ==
Valid]
[Yes]
Domain Model (Class diagram)
Participant Settlement Ins
T2S Settlement Ins
State: T2S Instruction State
Participant Notification
Reason: String [0..1]
Message: String
Settlement Instruction
SettlementDate: Date
«enumeratio...
T2S Instruction
State
ToValidate
Valid
Settled
Rejected
Matched
0..*Participant
Instruction
uc Actors
Participant
«actor»
Settlement Platform
isInitialised: Boolean
«Pre-condition»
{SettlementPlatform.allInstances() ->forAll (t / t.isInitialised=true)}
Requirements Modeling Acceptance Testing
Test Scenarios
Models Acceptance
Criteria
7
Analysts Test Engineers
AGAC
AGAC Approach
8
UML Activity
Diagrams
UML Use Case
Diagrams
Automated
AC Generation
Domain
Models
@Intent: Create # Tag
Scenario: <action>
Given <domainEntity> (of type <class>)? # The type is optional
does not exist in <actor> (of type <class>)?, # The type is optional
# Zero or more previous guard conditions and local preconditions
(And <constraint.expression>)*
When <actor> <action>,
Then <domainEntity> exists in <actor>
(And <constraint.expression>)* # Zero or more local postconditions
# Zero or more constraints depending on the properties that are initialised
(And the property <property> of <domainEntity> is <operator> <value>) *
AGAC
Gherkin
Scenario
Templates
Gherkin
AC
Annotated with:
• High-level Intents of Actions
• Pre-/Post-conditions
Tool-supported
Requirements
Modeling
AGAC Modelling Methodology
9
UML
ADs
Specify Activity
Diagrams (ADs)
Specify
Intents
Specify
Constraints
Generate
Constraints
Identify
Intents
Create
Domain Model
Elicit Use Cases
Domain
Model
Documents, Interviews
AGAC
UML
ADs
UML Use Case
Diagrams
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
RunMatching Process
X
days
passed
Inx: T2S Settlement Ins
State=Matched
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State = Valid
Inx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State == Valid]
[Yes]
Activity Diagram 10
ucActors
Participant
«actor»
Settlement Platform
isInitialised: Boolean
Use Case Diagram
Send Settlement
Instruction
Domain Model (Class diagram)
Participant Settlement Ins
T2S Settlement Ins
State: T2S Instruction State
Participant Notification
Reason: String [0..1]
Message: String
Settlement Instruction
SettlementDate: Date
«enumeration»
T2S Instruction
State
ToValidate
Valid
Settled
Rejected
Matched
0..*Participant
Instruction
Domain Model
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
RunMatching Process
X
days
passed
Inx: T2S Settlement Ins
State=Matched
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State = Valid
Inx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State == Valid]
[Yes]
Activity Diagram 11
ucActors
Participant
«actor»
Settlement Platform
isInitialised: Boolean
Use Case Diagram
Send Settlement
Instruction
Domain Model (Class diagram)
Participant Settlement Ins
T2S Settlement Ins
State: T2S Instruction State
Participant Notification
Reason: String [0..1]
Message: String
Settlement Instruction
SettlementDate: Date
«enumeration»
T2S Instruction
State
ToValidate
Valid
Settled
Rejected
Matched
0..*Participant
Instruction
Domain Model
P: Participant
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S
Stat
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Inx: T2S Settlement Ins
Send
Notification
Inx: T2S
Settlement Ins
I
FlowFinal
Receive
notification
notif:
Participant
Notification
T2S: Settlement Platform
Merge2
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S Settlement Ins
Send
Notification
Inx: T2S
Settlement Ins
Process Instruction
Rejection
Inx: T2S Settlement Ins
State=Rejected
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
RunMatching Process
X
days
passed
Inx: T2S Settlement Ins
State=Matched
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State = Valid
Inx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State == Valid]
[Yes]
Activity Diagram
ucActors
Participant
«actor»
Settlement Platform
isInitialised: Boolean
Use Case Diagram
Send Settlement
Instruction
Domain Model (Class diagram)
Participant Settlement Ins
T2S Settlement Ins
State: T2S Instruction State
Participant Notification
Reason: String [0..1]
Message: String
Settlement Instruction
SettlementDate: Date
«enumeration»
T2S Instruction
State
ToValidate
Valid
Settled
Rejected
Matched
0..*Participant
Instruction
Domain Model
T2S: Settlement Platform
Inx: T2S Settlement Ins
State= ToValidate
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Ins
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement
State = Valid
Inx: T2S Settlement Ins
State=Rejected
[Inx.State == Valid]
12
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
RunMatching Process
X
days
passed
Inx: T2S Settlement Ins
State=Matched
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State = Valid
Inx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State == Valid]
[Yes]
Activity Diagram 13
ucActors
Participant
«actor»
Settlement Platform
isInitialised: Boolean
Use Case Diagram
Send Settlement
Instruction
Domain Model (Class diagram)
Participant Settlement Ins
T2S Settlement Ins
State: T2S Instruction State
Participant Notification
Reason: String [0..1]
Message: String
Settlement Instruction
SettlementDate: Date
«enumeration»
T2S Instruction
State
ToValidate
Valid
Settled
Rejected
Matched
0..*Participant
Instruction
Domain Model
T2S: Settlement Platform
InterruptibleActivityRegion1
ettlement Ins
= ToValidate
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Inx.SettlementDate >
T2S.CurrentDate
RunMatching Process
X
days
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State = Valid
: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
[No]
[Inx.State == Valid]
[Yes]
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
RunMatching Process
X
days
passed
Inx: T2S Settlement Ins
State=Matched
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State = Valid
Inx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State == Valid]
[Yes]
Activity Diagram 14
ucActors
Participant
«actor»
Settlement Platform
isInitialised: Boolean
Use Case Diagram
Send Settlement
Instruction
Domain Model (Class diagram)
Participant Settlement Ins
T2S Settlement Ins
State: T2S Instruction State
Participant Notification
Reason: String [0..1]
Message: String
Settlement Instruction
SettlementDate: Date
«enumeration»
T2S Instruction
State
ToValidate
Valid
Settled
Rejected
Matched
0..*Participant
Instruction
Domain Model
AGAC Modelling Methodology
16
UML
ADs
Specify Activity
Diagrams (ADs)
Specify
Intents
Identify
Intents
Create
Domain Model
Elicit Use Cases
Domain
Model
Documents, Interviews
UML ADs
with Intents
UML Use Case
Diagrams
Intent: observable behavior of an action
that should be verified during testing
11 Intent Types
Based on manual investigation of 841 AC from Clearstream
• «Create», «Read», «Update», «Send»
• concern the object associated to the outgoing edgeP:Participant
ActivityInitial
Send settlement
Instruction GpInx: Participant
Settlement Ins
Send
Notification
I
Sett
FlowFinal
Receive
notification
notif:
Participant
Notification
P:Participant
ActivityInitial
Send settlement
Instruction pInx: Partici
Settlement
Send
NotificatioFlowFinal
Receive
notification
notif:
Participant
Notification
17
«Send»
11 Intent Types
Based on manual investigation of 841 AC from Clearstream
• «Create», «Read», «Update», «Send»
• concern the object associated to the outgoing edge
• «Delete», «Receive», «Validate»
• concern the object associated to the incoming edge
18
P: Participant
ActivityInitial
Send settlement
Instruction
FlowFinal
Receive
notification
notif:
Participant
Notification«Receive»
11 Intent Types
Based on manual investigation of 841 AC from Clearstream
• «Create», «Read», «Update», «Send»
• concern the object associated to the outgoing edge
• «Delete», «Receive», «Validate»
• concern the object associated to the incoming edge
• «Display», «Not-Display», «Enable», «Disable»
• concern the user interface
19
«Display»
Automated Identification of
Intents
20
Input and output
connected to objects with
the same ID
The verb in the action name
matches the intent name
«Update»
The object on the output
edge has an ID never
observed before
«Create»
T2S: Settlement Platform
Merge2
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
X
day
passe
Process Instruction
Rejection
Inx: T2S
Settlement InsInx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
[No]
[Yes]
T2S: Settlement Platform
Merge2
Inx: T2S Settlement Ins
State= ToValidate
Receive and
erate Instruction
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
: T2S
ment Ins
Process Instruction
Inx: T2S
Settlement Ins Inx: TInx: T2S Settlement Ins
[Inx.Sta
«ANY» (e.g., «Validate»)
P: Participant T2S: Settlement P
Merge2
Send settlement
Instruction
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate
Ins
Settle Instruction
Inx.SettlementDa
starts
Merge1
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
PrInx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
Receive
notification
notif:
Participant
Notification
AGAC Modelling Methodology
21
UML
ADs
Specify Activity
Diagrams (ADs)
Specify
Intents
Specify
Constraints
Generate
Constraints
Identify
Intents
Create
Domain Model
Elicit Use Cases
Domain
Model
Documents, Interviews
AGAC
UML
ADs
UML Use Case
Diagrams
Automated Generation of Constraints
based on Object–flow Analysis
23
The action produces
an object
Postcondition: attribute values
should match the model
the property "State" of Inx is
equal to "Settled"
P:Participant T2S: Settlement Platform
Interrup
Merge2
Send settlement
Instruction
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
X
days
passed
In
Process Instruction
Rejection
Inx: T2S
Settlement Ins InInx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
Receive
notification
notif:
Participant
Notification
[No]
[Inx
[Yes]
Automated Generation of Constraints
based on Intents Analysis
25
«Read»
«Update»
«Delete»
«Send»
Precondition: the entity exists
Inx exists in T2S
T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
Inx: T2SSettlement Ins
State= ToValidate
Receive and
Generate Instruction
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2SSettlement Ins
State=Settled
Inx: T2S
Settlement Ins
RunMatching Process
X
days
passed
Inx: T2SSettlement Ins
State=Matched
ProcessInstruction
Rejection
Inx: T2S
Settlement Ins Inx: T2SSettlement Ins
State = Valid
Inx: T2SSettlement Ins
State=Rejected
«localPostcondition» Lp1: ....
[No]
[Inx.State == Valid]
[Yes]
«Update»
Extended
UML Activity
Diagrams
UML Use Case
Diagrams
Domain
Models
Tool-supported
Requirements
Modeling
Automated AC generation
28
Extended
UML Activity
Diagrams
UML Use Case
Diagrams
Automated
AC generation
Domain
Models
@Intent: Create # Tag
Scenario: <action>
Given <domainEntity> (of type <class>)? # The type is optional
does not exist in <actor> (of type <class>)?, # The type is optional
# Zero or more previous guard conditions and local preconditions
(And <constraint.expression>)*
When <actor> <action>,
Then <domainEntity> exists in <actor>
(And <constraint.expression>)* # Zero or more local postconditions
# Zero or more constraints depending on the properties that are initialised
(And the property <property> of <domainEntity> is <operator> <value>) *
AGAC
Gherkin
Scenario
Templates
Gherkin
AC
(Id: 10) Merge1 : Merge
(Id: 2) Send settlement Instruction : Input
(Id: 3) Receive Instruction : Input
(Id: 4) Val_Ins : Include
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 1) ActivityInitial : Start
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 16) Proc_Notif : Include
(Id: 17) FlowFinal : Exit
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
Next
True
Next
Next
Next
Next
Next
Next1Next
Test
Model Test
Sequences
Tool-supported
Requirements
Modeling
Test Model Generation
(Id: 10) Merge1 : Merge
(Id: 2) Send settlement Instruction : Input
(Id: 3) Receive Instruction : Input
(Id: 4) Val_Ins : Include
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 1) ActivityInitial : Start
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 16) Proc_Notif : Include
(Id: 17) FlowFinal : Exit
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
Next
True
Next
Next
Next
Next
Next
Next1Next
Activity Diagram
Test Model
29
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
RunMatching Process
X
days
passed
Inx: T2S Settlement Ins
State=Matched
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State = Valid
Inx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State == Valid]
[Yes]
• Metamodel in the paper
• One node for each element in the
Activity Diagram
• Multiple roots:
derived from interruptible nodes
Test Model Generation
(Id: 10) Merge1 : Merge
(Id: 2) Send settlement Instruction : Input
(Id: 3) Receive Instruction : Input
(Id: 4) Val_Ins : Include
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 1) ActivityInitial : Start
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 16) Proc_Notif : Include
(Id: 17) FlowFinal : Exit
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
Next
True
Next
Next
Next
Next
Next
Next1Next
Activity Diagram
Test Model
30
• Metamodel in the paper
• One node for each element in the
Activity Diagram
• Multiple roots:
derived from interruptible nodes
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
RunMatching Process
X
days
passed
Inx: T2S Settlement Ins
State=Matched
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State = Valid
Inx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State == Valid]
[Yes]
31
2S: Settlement Platform
InterruptibleActivityRegion1
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Inx.SettlementDate >
T2S.CurrentDate
nx.SettlementDate
starts
RunMatching Process
X
days
passed
Inx: T2S Settlement Ins
State=Matched
Process Instruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State = Valid
nt Ins
ed
on» Lp1: ....
[No]
[Inx.State == Valid]
[Yes]
(Id: 10) Merge1 : Merge
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input (Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
True
Next1Next
Activity Diagram
Test Model
Test Sequences Generation
(Id: 10) Merge1 : Merge
(Id: 2) Send settlement Instruction : Input
(Id: 3) Receive Instruction : Input
(Id: 4) Val_Ins : Include
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 1) ActivityInitial : Start
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 16) Proc_Notif : Include
(Id: 17) FlowFinal : Exit
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
Next
True
Next
Next
Next
Next
Next
Next1Next
Test model
9
14
13
5
1
10
6
12
17
15
2
3
4
7
11
16
33
• Test Sequence: sequence of nodes
• Each test sequence leads to an
Acceptance Criterion
• Criticality: exercise parallelism
• maximize interleavings
• breadth-first traversal
P1 = [1,2,3,4,5,6,12,7,15,8,16,9,17,10,11,12,15,16,17]
P2 = [1,2,3,4,5,6,12,7,15,8,16,10,17,11,12,15,16,17]
P3= [1,2,3,4,5,14,12,15,16,17]
P4= [13,14,15,16,17]
Generated Test Sequences
8
(Id: 10) Merge1 : Merge
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
True
Next
Next1Next
9
5
10
6
12
15
7
11
34
8
a
b
c
d
e
enhanced
breadth-first traversal
(Id: 10) Merge1 : Merge
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
True
Next
Next1Next
9
5
10
6
12
15
7
11
35
8
enhanced
breadth-first traversal
Test Sequences Generation
(Id: 10) Merge1 : Merge
(Id: 2) Send settlement Instruction : Input
(Id: 3) Receive Instruction : Input
(Id: 4) Val_Ins : Include
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 1) ActivityInitial : Start
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 16) Proc_Notif : Include
(Id: 17) FlowFinal : Exit
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
Next
True
Next
Next
Next
Next
Next
Next1Next
Test model
9
14
13
5
1
10
6
12
17
15
2
3
4
7
11
16
37
• Test Sequence: sequence of nodes
• Each test sequence leads to an
Acceptance Criterion
• Criticality: exercise parallelism
• maximize interleavings
P1 = [1,2,3,4,5,6,12,7,15,8,16,9,17,10,11,12,15,16,17]
P2 = [1,2,3,4,5,6,12,7,15,8,16,10,17,11,12,15,16,17]
P3= [1,2,3,4,5,14,12,15,16,17]
P4= [13,14,15,16,17]
Generated Test Sequences
8
Test Sequences Generation
(Id: 10) Merge1 : Merge
(Id: 2) Send settlement Instruction : Input
(Id: 3) Receive Instruction : Input
(Id: 4) Val_Ins : Include
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 1) ActivityInitial : Start
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 16) Proc_Notif : Include
(Id: 17) FlowFinal : Exit
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
Next
True
Next
Next
Next
Next
Next
Next1Next
Test model
9
14
13
5
1
10
6
12
17
15
2
3
4
7
11
16
38
• Test Sequence: sequence of nodes
• Each test sequence leads to an
Acceptance Criterion
• Criticality: exercise parallelism
• maximize interleavings
P1 = [1,2,3,4,5,6,12,7,15,8,16,9,17,10,11,12,15,16,17]
P2 = [1,2,3,4,5,6,12,7,15,8,16,10,17,11,12,15,16,17]
P3= [1,2,3,4,5,14,12,15,16,17]
P4= [13,14,15,16,17]
Generated Test Sequences
8
Test Sequences Generation
(Id: 10) Merge1 : Merge
(Id: 2) Send settlement Instruction : Input
(Id: 3) Receive Instruction : Input
(Id: 4) Val_Ins : Include
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 1) ActivityInitial : Start
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 16) Proc_Notif : Include
(Id: 17) FlowFinal : Exit
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
Next
True
Next
Next
Next
Next
Next
Next1Next
Test model
9
14
13
5
1
10
6
12
17
15
2
3
4
7
11
16
39
• Test Sequence: sequence of nodes
• Each test sequence leads to an
Acceptance Criterion
• Criticality: exercise parallelism
• maximize interleavings
P1 = [1,2,3,4,5,6,12,7,15,8,16,9,17,10,11,12,15,16,17]
P2 = [1,2,3,4,5,6,12,7,15,8,16,10,17,11,12,15,16,17]
P3= [1,2,3,4,5,14,12,15,16,17]
P4= [13,14,15,16,17]
Generated Test Sequences
8
Test Sequences Generation
(Id: 10) Merge1 : Merge
(Id: 2) Send settlement Instruction : Input
(Id: 3) Receive Instruction : Input
(Id: 4) Val_Ins : Include
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 1) ActivityInitial : Start
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 16) Proc_Notif : Include
(Id: 17) FlowFinal : Exit
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
Next
True
Next
Next
Next
Next
Next
Next1Next
Test model
9
14
13
5
1
10
6
12
17
15
2
3
4
7
11
16
40
• Test Sequence: sequence of nodes
• Each test sequence leads to an
Acceptance Criterion
• Criticality: exercise parallelism
• maximize interleavings
P1 = [1,2,3,4,5,6,12,7,15,8,16,9,17,10,11,12,15,16,17]
P2 = [1,2,3,4,5,6,12,7,15,8,16,10,17,11,12,15,16,17]
P3= [1,2,3,4,5,14,12,15,16,17]
P4= [13,14,15,16,17]
Generated Test Sequences
8
Automated AC generation
41
Extended
UML Activity
Diagrams
UML Use Case
Diagrams
Automated
AC generation
Domain
Models
@Intent: Create # Tag
Scenario: <action>
Given <domainEntity> (of type <class>)? # The type is optional
does not exist in <actor> (of type <class>)?, # The type is optional
# Zero or more previous guard conditions and local preconditions
(And <constraint.expression>)*
When <actor> <action>,
Then <domainEntity> exists in <actor>
(And <constraint.expression>)* # Zero or more local postconditions
# Zero or more constraints depending on the properties that are initialised
(And the property <property> of <domainEntity> is <operator> <value>) *
AGAC
Gherkin
Scenario
Templates
Gherkin
AC
(Id: 10) Merge1 : Merge
(Id: 2) Send settlement Instruction : Input
(Id: 3) Receive Instruction : Input
(Id: 4) Val_Ins : Include
(Id: 5) Inx.State == Valid
: BiflowCondition
(Id: 6) : ParallelStart
(Id: 7) Run Matching process : Internal
(Id: 1) ActivityInitial : Start
(Id: 9) Inx.SettlementDate : Other
(Id: 13) X days : Interrupt
(Id: 11) Settle Instruction : Input
(Id: 12) Merge2 : Merge
(Id: 15) Send Notification : Input
(Id: 16) Proc_Notif : Include
(Id: 17) FlowFinal : Exit
(Id: 14) Process Instruction
Rejection : Internal
(Id: 8) Inx.SettlementDate >
T2S.CurrentDate
: BiflowCondition
False
Next0
Next
Next
False
Next
Next
True
Next
Next
Next
True
Next
Next
Next
Next
Next
Next1Next
Test
Model Test
Sequences
Tool-supported
Requirements
Modeling
Test
Sequence
T2S: Settlement Platform
Merge2
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx
Settlem
Inx.SettlementDate >
T2S.CurrentDate
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
Process Instruction
Rejection
SettInx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
:
ant
tion
[Yes]
Scenario Generation with
Gherkin Templates
42
«Create»
@Intent: Create
Scenario: <action>
Given <domainEntity> (of type <class1>)? does not exist in <actor> (of type <class2>)?
(And PRECONDITIONS_TEXT) *
When <actor> <action>
Then <domainEntity> (of type <class1>)? exist in <actor> (of type <class2>)?
(And the property <property> of <domainEntity> is <operator> <value>)*
«Create» Template
Gherkin Scenario
@Intent: Create
Scenario: Receive and Generate Instruction
Given Inx of type "T2S Settlement Ins" does not exists in T
When T2S Receive and Generate Instruction
Then Inx exists in T2S
And the property State of Inx is equal to "ToValidate"
• 12 templates: one for each of the 11 intents + one for interrupts
Example of Generated AC
43
Template for «Create» Intent
44
@Intent: Create
Scenario: <action>
Given GENERATED_PRECONDITION_FOR_CREATE_INTENT
(And PRECONDITIONS_TEXT) *
When <actor> <action>
Then <domainEntity> (of type <class1>)? exist in <actor> (of type <class2>)?
(And GENERATED_POSTCONDITION_FOR_UPDATED_OBJECTS)*
@Intent: Create
Scenario: Receive and Generate Instruction
Given Inx of type "T2S Settlement Ins" does not exists in T2S of type "Settlement Platform"
When T2S Receive and Generate Instruction
Then Inx exists in T2S
And the property State of Inx is equal to "ToValidate"
T2S: Settlement Platform
Merge2
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Se
Inx.SettlementDate
T2S.CurrentDate
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
Process Instruction
Rejection
Inx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
notif:
rticipant
tification
[Yes]
Template for «Create» Intent
45
@Intent: Create
Scenario: <action>
Given GENERATED_PRECONDITION_FOR_CREATE_INTENT
(And PRECONDITIONS_TEXT) *
When <actor> <action>
Then <domainEntity> (of type <class1>)? exist in <actor> (of type <class2>)?
(And GENERATED_POSTCONDITION_FOR_UPDATED_OBJECTS)*
@Intent: Create
Scenario: Receive and Generate Instruction
Given Inx of type "T2S Settlement Ins" does not exists in T2S of type "Settlement Platform"
When T2S Receive and Generate Instruction
Then Inx exists in T2S
And the property State of Inx is equal to "ToValidate"
T2S: Settlement Platform
Merge2
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Se
Inx.SettlementDate
T2S.CurrentDate
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
Process Instruction
Rejection
Inx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
notif:
rticipant
tification
[Yes]
Template for «Create» Intent
46
@Intent: Create
Scenario: <action>
Given <domainEntity> (of type <class1>)? does not exist in <actor> (of type <class2>)?
(And PRECONDITIONS_TEXT) *
When <actor> <action>
Then <domainEntity> (of type <class1>)? exist in <actor> (of type <class2>)?
(And GENERATED_POSTCONDITION_FOR_UPDATED_OBJECTS)*
@Intent: Create
Scenario: Receive and Generate Instruction
Given Inx of type "T2S Settlement Ins" does not exists in T2S of type "Settlement Platform"
When T2S Receive and Generate Instruction
Then Inx exists in T2S
And the property State of Inx is equal to "ToValidate"
T2S: Settlement Platform
Merge2
Inx: T2S Settlement Ins
State= ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Se
Inx.SettlementDate
T2S.CurrentDate
Inx: T2S Settlement Ins
State=Settled
Send
Notification
Inx: T2S
Settlement Ins
Process Instruction
Rejection
Inx: T2S Settlement Ins
State=Rejected
«localPostcondition» Lp1: ....
notif:
rticipant
tification
[Yes]
Enterprise Architect Plugin
49
Empirical Evaluation
• RQ1. Can practitioners model all the requirements with AGAC?
• RQ2. Can AGAC successfully generate AC in Gherkin?
• RQ3. Is the additional effort required by AGAC justified?
50
Exchange Trade Fund
Issuance System
RQ1. Can practitioners model all
the requirements with AGAC?
• One hour training on modeling methodology
• Four analysts applied the methodology to model the
requirements of their system
• Successful
51
14 Activity Diagrams
(434 elements)
Domain Model
(176 elements)
RQ2. Can AGAC successfully
generate AC in Gherkin?
• Applied AGAC to the models of the case study
• AGAC generated 137 AC including 990 Gherkin scenarios
• Randomly selected 10% for manual validation with experts
• experts confirmed their correctness
• inferred relevant conditions
• intents correctly identified
• covered expected sequences of activities
• AC generation took negligible time
• 25 seconds on laptop with Intel i7 and 4GB RAM
52
RQ3: Is the additional effort
required by AGAC justified?
• Total number of elements in the models: 610
• 461 (76%) are shared with the existing modeling practice
• 149 (24%) are imposed by the new methodology
• Modelling effort is justified by advantages
• cost reduction; at Clearstream, the manual creation and
updating of AC is 50% of requirements analysis effort
• AGAC automatically generates the required AC
• generation is systematic
• additional automation opportunities: regression testing
53
Lessons Learned
1. Automated generation of AC is a strong motivator for
building better models
2. AC generation provides a feedback loop for detecting
incompleteness and incrementally improve the models
3. Engineers need a dedicated language or analysis for
constraints definition
54
[ICST'18]
[ICST'18] Chunhui Wang, Fabrizio Pastore, Lionel Briand. Automated Generation of Constraints from Use Case Specifications
to Support System Testing. 11th International Conference on Software Testing, Verification and Validation, 2018
55
Gap between Requirements
Modeling and BDD
?
P: Participant T2S: Settlement Platform
InterruptibleActivityRegion1
Merge2
ActivityInitial
Send settlement
Instruction
Inx: T2S Settlement Ins
State =ToValidate
Receive and
Generate InstructionpInx: Participant
Settlement Ins
Validate Ins: Validate
Instruction
Inx: T2S
Settlement Ins
Settle Instruction
Inx.SettlementDate >
T2S.CurrentDate
Inx.SettlementDate
starts
Merge1
Inx: T2S Settlement Ins
State =Settled
Send
Notification
Inx: T2S
Settlement Ins
Run Matching Process
X
days
passed
Inx: T2S Settlement Ins
State =Matched
ProcessInstruction
Rejection
Inx: T2S
Settlement Ins Inx: T2S Settlement Ins
State =Valid
Inx: T2S Settlement Ins
State =Rejected
«localPostcondition» Lp1: ....
FlowFinal
Receive
notification
notif:
Participant
Notification
[No]
[Inx.State ==
Valid]
[Yes]
Domain Model (Class diagram)
Participant Settlement Ins
T2S Settlement Ins
State: T2S Instruction State
Participant Notification
Reason: String [0..1]
Message: String
Settlement Instruction
SettlementDate: Date
«enumeratio...
T2S Instruction
State
ToValidate
Valid
Settled
Rejected
Matched
0..*Participant
Instruction
uc Actors
Participant
«actor»
Settlement Platform
isInitialised: Boolean
«Pre-condition»
{SettlementPlatform.allInstances() ->forAll (t / t.isInitialised=true)}
Requirements Modeling Acceptance Testing
Test Scenarios
Models Acceptance
Criteria
Manual
Definition of AC
5
Analysts Test Engineers
AGAC Approach
8
Extended
UML Activity
Diagrams
UML Use Case
Diagrams
Requirements Modelling
following
AGAC tool-supported
Methodology
Automated
AC generation
Domain
Models
@Intent: Create # Tag
Scenario: <action>
Given <domainEntity> (of type <class>)? # The type is optional
does not exist in <actor> (of type <class>)?, # The type is optional
# Zero or more previous guard conditions and local preconditions
(And <constraint.expression>)*
When <actor> <action>,
Then <domainEntity> exists in <actor>
(And <constraint.expression>)* # Zero or more local postconditions
# Zero or more constraints depending on the properties that are initialised
(And the property <property> of <domainEntity> is <operator> <value>) *
AGAC
Gherkin
Scenario
Templates
Gherkin
AC
Pre-/Post-conditions
High-level Intents of Activities
Empirical Evaluation
• RQ1. Can practitioners model all the requirements with AGAC?
• RQ2. Can AGAC successfully generate AC in Gherkin?
• RQ3. Is the additional effort required by AGAC justified?
24
Yes
Yes
Yes
.lusoftware verification & validation
VVS
Bridging the Gap between Requirements
Modeling and Behavior-driven Development
Mauricio Alferez*, Fabrizio Pastore*, Mehrdad Sabetzadeh*, Lionel Briand*+
Jean-Richard Riccardix
*University of Luxembourg, +University of Ottawa, xClearstream
MODELS 2019
September 20th, 2019

More Related Content

PDF
Leveraging Natural-language Requirements for Deriving Better Acceptance Crite...
PPT
C:\documents and settings\student\desktop\swaroop uml
PPT
Use Case and Activity Diagrams Modeling Notation
PDF
Servicing Your Users with Akka
PPT
Software System Engineering - Chapter 14
PDF
OBDA for Log Extraction in Process Mining
PPTX
NEW-ArnhhjjenacgdhytjstjdiIngridHui.pptx
PDF
Automatic Generation of System Test Cases from Use Case Specifications
Leveraging Natural-language Requirements for Deriving Better Acceptance Crite...
C:\documents and settings\student\desktop\swaroop uml
Use Case and Activity Diagrams Modeling Notation
Servicing Your Users with Akka
Software System Engineering - Chapter 14
OBDA for Log Extraction in Process Mining
NEW-ArnhhjjenacgdhytjstjdiIngridHui.pptx
Automatic Generation of System Test Cases from Use Case Specifications

Similar to Bridging the Gap between Requirements Modeling and Behavior-driven Development (20)

DOCX
Placement management system
PPTX
Activity_Diagrams_inClass (1).pptx Activity_Diagrams_inClass (1).pptx
PPS
Crj 3 1-c
PPT
NEW-ArnenaIngrid Hui.MBA career presentation
PPTX
BABoK V2 Requirements Analysis (RA)
PDF
Bpmn poster a4_ver_1.0.10
PDF
BPMN Poster
PPTX
Extending Workflow Foundation With Custom Activities
PPTX
Use case model
PPT
Unit 3(advanced state modeling & interaction meodelling)
PDF
Lect_4_Requirement Modeling(Use Case_and_Static).pdf
PDF
Bpmn poster a2_ver_1.0.10
PPTX
Unit three Advanced State Modelling
PPTX
1-Software Construction and Development.pptx
PDF
Back-annotation of Simulation Traces with Change-Driven Model Transformations
PPTX
PDF
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
PPTX
Adaptive Case Management as a Process of Construction of and Movement in a St...
PDF
Akka (1)
PPTX
Mspec talk
Placement management system
Activity_Diagrams_inClass (1).pptx Activity_Diagrams_inClass (1).pptx
Crj 3 1-c
NEW-ArnenaIngrid Hui.MBA career presentation
BABoK V2 Requirements Analysis (RA)
Bpmn poster a4_ver_1.0.10
BPMN Poster
Extending Workflow Foundation With Custom Activities
Use case model
Unit 3(advanced state modeling & interaction meodelling)
Lect_4_Requirement Modeling(Use Case_and_Static).pdf
Bpmn poster a2_ver_1.0.10
Unit three Advanced State Modelling
1-Software Construction and Development.pptx
Back-annotation of Simulation Traces with Change-Driven Model Transformations
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
Adaptive Case Management as a Process of Construction of and Movement in a St...
Akka (1)
Mspec talk
Ad

More from Lionel Briand (20)

PDF
LTM: Scalable and Black-box Similarity-based Test Suite Minimization based on...
PDF
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
PDF
Automated Test Case Repair Using Language Models
PDF
Automated Testing and Safety Analysis of Deep Neural Networks
PDF
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
PDF
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
PDF
Precise and Complete Requirements? An Elusive Goal
PDF
Large Language Models for Test Case Evolution and Repair
PDF
Metamorphic Testing for Web System Security
PDF
Simulator-based Explanation and Debugging of Hazard-triggering Events in DNN-...
PDF
Fuzzing for CPS Mutation Testing
PDF
Data-driven Mutation Analysis for Cyber-Physical Systems
PDF
Many-Objective Reinforcement Learning for Online Testing of DNN-Enabled Systems
PDF
ATM: Black-box Test Case Minimization based on Test Code Similarity and Evolu...
PDF
Black-box Safety Analysis and Retraining of DNNs based on Feature Extraction ...
PDF
PRINS: Scalable Model Inference for Component-based System Logs
PDF
Revisiting the Notion of Diversity in Software Testing
PDF
Applications of Search-based Software Testing to Trustworthy Artificial Intel...
PDF
Autonomous Systems: How to Address the Dilemma between Autonomy and Safety
PDF
Mathematicians, Social Scientists, or Engineers? The Split Minds of Software ...
LTM: Scalable and Black-box Similarity-based Test Suite Minimization based on...
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Automated Test Case Repair Using Language Models
Automated Testing and Safety Analysis of Deep Neural Networks
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Precise and Complete Requirements? An Elusive Goal
Large Language Models for Test Case Evolution and Repair
Metamorphic Testing for Web System Security
Simulator-based Explanation and Debugging of Hazard-triggering Events in DNN-...
Fuzzing for CPS Mutation Testing
Data-driven Mutation Analysis for Cyber-Physical Systems
Many-Objective Reinforcement Learning for Online Testing of DNN-Enabled Systems
ATM: Black-box Test Case Minimization based on Test Code Similarity and Evolu...
Black-box Safety Analysis and Retraining of DNNs based on Feature Extraction ...
PRINS: Scalable Model Inference for Component-based System Logs
Revisiting the Notion of Diversity in Software Testing
Applications of Search-based Software Testing to Trustworthy Artificial Intel...
Autonomous Systems: How to Address the Dilemma between Autonomy and Safety
Mathematicians, Social Scientists, or Engineers? The Split Minds of Software ...
Ad

Recently uploaded (20)

PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Digital Strategies for Manufacturing Companies
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Transform Your Business with a Software ERP System
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
ai tools demonstartion for schools and inter college
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
How to Migrate SBCGlobal Email to Yahoo Easily
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
2025 Textile ERP Trends: SAP, Odoo & Oracle
CHAPTER 2 - PM Management and IT Context
Digital Strategies for Manufacturing Companies
PTS Company Brochure 2025 (1).pdf.......
Reimagine Home Health with the Power of Agentic AI​
Odoo Companies in India – Driving Business Transformation.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Transform Your Business with a Software ERP System
Softaken Excel to vCard Converter Software.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Adobe Illustrator 28.6 Crack My Vision of Vector Design
How to Choose the Right IT Partner for Your Business in Malaysia
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
ai tools demonstartion for schools and inter college

Bridging the Gap between Requirements Modeling and Behavior-driven Development

  • 1. .lusoftware verification & validation VVS Bridging the Gap between Requirements Modeling and Behavior-driven Development Mauricio Alferez*, Fabrizio Pastore*, Mehrdad Sabetzadeh*, Lionel Briand*+ Jean-Richard Riccardix *University of Luxembourg, +University of Ottawa, xClearstream MODELS 2019 September 20th, 2019
  • 2. Context: Acceptance Testing of Business-critical Information Systems 2 Given there is enough money on my account When I make a withdrawal Then I get the expected amount of money from the ATM Acceptance Criteria (AC) Business-critical Information System Acceptance Testing The system meets its requirements!
  • 3. Requirements Analysis is Supported by Models Domain Model (Class diagram) Participant Settlement Ins T2S Settlement Ins State: T2S Instruction State Participant Notification Reason: String [0..1] Message: String Settlement Instruction SettlementDate: Date «enumeration» T2S Instruction State ToValidate Valid Settled Rejected Matched 0..*Participant Instruction Domain Model P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State = ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State = Settled Send Notification Inx: T2S Settlement Ins Run Matching Process X days passed Inx: T2S Settlement Ins State = Matched Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State = Valid Inx: T2S Settlement Ins State = Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes] Activity Diagram 3 ucActors Participant «actor» Settlement Platform isInitialised: Boolean Use Case Diagram
  • 4. Acceptance Testing follows Behavior Driven Development (BDD) Acceptance Criteria based on a scenario-oriented, Given-When-Then Gherkin structure Feature: Perform a Settlement Given: The settlement platform has been initialized Scenario: Send a settlement Instruction Given a settlement instruction with ID 'p1' is not in the instructions pool When the Participant sends a settlement instruction with ID 'p1' Then a settlement instruction with ID 'p1' is in the instructions pool Scenario: Receive a settlement Instruction Given a settlement instruction with ID 'p1' is not in the settlement platform When the settlement platform receives a settlement instruction with ID 'p1' Then a settlement instruction with ID 'p1' is in the settlement platform And the property State of Inx is equal to "ToValidate" Initial Context Event or Action Expected Result Feature Under Test 4 Test Step
  • 5. Gap between Requirements Modeling and BDD P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State =ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State =Settled Send Notification Inx: T2S Settlement Ins Run Matching Process X days passed Inx: T2S Settlement Ins State =Matched ProcessInstruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State =Valid Inx: T2S Settlement Ins State =Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes] Domain Model (Class diagram) Participant Settlement Ins T2S Settlement Ins State: T2S Instruction State Participant Notification Reason: String [0..1] Message: String Settlement Instruction SettlementDate: Date «enumeratio... T2S Instruction State ToValidate Valid Settled Rejected Matched 0..*Participant Instruction uc Actors Participant «actor» Settlement Platform isInitialised: Boolean «Pre-condition» {SettlementPlatform.allInstances() ->forAll (t / t.isInitialised=true)} Requirements Modeling Acceptance Testing Test Scenarios Models Acceptance Criteria Manual Definition of AC 5 Analysts Test Engineers
  • 6. Manual Definition of AC is Tedious and Error Prone Models lack pre- and post-conditions of activities. Difficult to specify test oracles. Execution flows captured by those models are complex. Engineers may overlook the scenarios to test. Different analysis and testing teams. Misunderstandings. Requirements specifications evolve. Additional costs. 6
  • 7. AGAC: Automatic Generation of Acceptance Criteria P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State =ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State =Settled Send Notification Inx: T2S Settlement Ins Run Matching Process X days passed Inx: T2S Settlement Ins State =Matched ProcessInstruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State =Valid Inx: T2S Settlement Ins State =Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes] Domain Model (Class diagram) Participant Settlement Ins T2S Settlement Ins State: T2S Instruction State Participant Notification Reason: String [0..1] Message: String Settlement Instruction SettlementDate: Date «enumeratio... T2S Instruction State ToValidate Valid Settled Rejected Matched 0..*Participant Instruction uc Actors Participant «actor» Settlement Platform isInitialised: Boolean «Pre-condition» {SettlementPlatform.allInstances() ->forAll (t / t.isInitialised=true)} Requirements Modeling Acceptance Testing Test Scenarios Models Acceptance Criteria 7 Analysts Test Engineers AGAC
  • 8. AGAC Approach 8 UML Activity Diagrams UML Use Case Diagrams Automated AC Generation Domain Models @Intent: Create # Tag Scenario: <action> Given <domainEntity> (of type <class>)? # The type is optional does not exist in <actor> (of type <class>)?, # The type is optional # Zero or more previous guard conditions and local preconditions (And <constraint.expression>)* When <actor> <action>, Then <domainEntity> exists in <actor> (And <constraint.expression>)* # Zero or more local postconditions # Zero or more constraints depending on the properties that are initialised (And the property <property> of <domainEntity> is <operator> <value>) * AGAC Gherkin Scenario Templates Gherkin AC Annotated with: • High-level Intents of Actions • Pre-/Post-conditions Tool-supported Requirements Modeling
  • 9. AGAC Modelling Methodology 9 UML ADs Specify Activity Diagrams (ADs) Specify Intents Specify Constraints Generate Constraints Identify Intents Create Domain Model Elicit Use Cases Domain Model Documents, Interviews AGAC UML ADs UML Use Case Diagrams
  • 10. P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins RunMatching Process X days passed Inx: T2S Settlement Ins State=Matched Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State = Valid Inx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes] Activity Diagram 10 ucActors Participant «actor» Settlement Platform isInitialised: Boolean Use Case Diagram Send Settlement Instruction Domain Model (Class diagram) Participant Settlement Ins T2S Settlement Ins State: T2S Instruction State Participant Notification Reason: String [0..1] Message: String Settlement Instruction SettlementDate: Date «enumeration» T2S Instruction State ToValidate Valid Settled Rejected Matched 0..*Participant Instruction Domain Model
  • 11. P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins RunMatching Process X days passed Inx: T2S Settlement Ins State=Matched Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State = Valid Inx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes] Activity Diagram 11 ucActors Participant «actor» Settlement Platform isInitialised: Boolean Use Case Diagram Send Settlement Instruction Domain Model (Class diagram) Participant Settlement Ins T2S Settlement Ins State: T2S Instruction State Participant Notification Reason: String [0..1] Message: String Settlement Instruction SettlementDate: Date «enumeration» T2S Instruction State ToValidate Valid Settled Rejected Matched 0..*Participant Instruction Domain Model P: Participant Merge2 ActivityInitial Send settlement Instruction Inx: T2S Stat Receive and Generate InstructionpInx: Participant Settlement Ins Inx: T2S Settlement Ins Send Notification Inx: T2S Settlement Ins I FlowFinal Receive notification notif: Participant Notification T2S: Settlement Platform Merge2 Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Send Notification Inx: T2S Settlement Ins Process Instruction Rejection Inx: T2S Settlement Ins State=Rejected
  • 12. P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins RunMatching Process X days passed Inx: T2S Settlement Ins State=Matched Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State = Valid Inx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes] Activity Diagram ucActors Participant «actor» Settlement Platform isInitialised: Boolean Use Case Diagram Send Settlement Instruction Domain Model (Class diagram) Participant Settlement Ins T2S Settlement Ins State: T2S Instruction State Participant Notification Reason: String [0..1] Message: String Settlement Instruction SettlementDate: Date «enumeration» T2S Instruction State ToValidate Valid Settled Rejected Matched 0..*Participant Instruction Domain Model T2S: Settlement Platform Inx: T2S Settlement Ins State= ToValidate Validate Ins: Validate Instruction Inx: T2S Settlement Ins Ins Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement State = Valid Inx: T2S Settlement Ins State=Rejected [Inx.State == Valid] 12
  • 13. P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins RunMatching Process X days passed Inx: T2S Settlement Ins State=Matched Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State = Valid Inx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes] Activity Diagram 13 ucActors Participant «actor» Settlement Platform isInitialised: Boolean Use Case Diagram Send Settlement Instruction Domain Model (Class diagram) Participant Settlement Ins T2S Settlement Ins State: T2S Instruction State Participant Notification Reason: String [0..1] Message: String Settlement Instruction SettlementDate: Date «enumeration» T2S Instruction State ToValidate Valid Settled Rejected Matched 0..*Participant Instruction Domain Model T2S: Settlement Platform InterruptibleActivityRegion1 ettlement Ins = ToValidate Validate Ins: Validate Instruction Inx: T2S Settlement Ins Inx.SettlementDate > T2S.CurrentDate RunMatching Process X days Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State = Valid : T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... [No] [Inx.State == Valid] [Yes]
  • 14. P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins RunMatching Process X days passed Inx: T2S Settlement Ins State=Matched Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State = Valid Inx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes] Activity Diagram 14 ucActors Participant «actor» Settlement Platform isInitialised: Boolean Use Case Diagram Send Settlement Instruction Domain Model (Class diagram) Participant Settlement Ins T2S Settlement Ins State: T2S Instruction State Participant Notification Reason: String [0..1] Message: String Settlement Instruction SettlementDate: Date «enumeration» T2S Instruction State ToValidate Valid Settled Rejected Matched 0..*Participant Instruction Domain Model
  • 15. AGAC Modelling Methodology 16 UML ADs Specify Activity Diagrams (ADs) Specify Intents Identify Intents Create Domain Model Elicit Use Cases Domain Model Documents, Interviews UML ADs with Intents UML Use Case Diagrams Intent: observable behavior of an action that should be verified during testing
  • 16. 11 Intent Types Based on manual investigation of 841 AC from Clearstream • «Create», «Read», «Update», «Send» • concern the object associated to the outgoing edgeP:Participant ActivityInitial Send settlement Instruction GpInx: Participant Settlement Ins Send Notification I Sett FlowFinal Receive notification notif: Participant Notification P:Participant ActivityInitial Send settlement Instruction pInx: Partici Settlement Send NotificatioFlowFinal Receive notification notif: Participant Notification 17 «Send»
  • 17. 11 Intent Types Based on manual investigation of 841 AC from Clearstream • «Create», «Read», «Update», «Send» • concern the object associated to the outgoing edge • «Delete», «Receive», «Validate» • concern the object associated to the incoming edge 18 P: Participant ActivityInitial Send settlement Instruction FlowFinal Receive notification notif: Participant Notification«Receive»
  • 18. 11 Intent Types Based on manual investigation of 841 AC from Clearstream • «Create», «Read», «Update», «Send» • concern the object associated to the outgoing edge • «Delete», «Receive», «Validate» • concern the object associated to the incoming edge • «Display», «Not-Display», «Enable», «Disable» • concern the user interface 19 «Display»
  • 19. Automated Identification of Intents 20 Input and output connected to objects with the same ID The verb in the action name matches the intent name «Update» The object on the output edge has an ID never observed before «Create» T2S: Settlement Platform Merge2 Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins X day passe Process Instruction Rejection Inx: T2S Settlement InsInx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... [No] [Yes] T2S: Settlement Platform Merge2 Inx: T2S Settlement Ins State= ToValidate Receive and erate Instruction Validate Ins: Validate Instruction Inx: T2S Settlement Ins : T2S ment Ins Process Instruction Inx: T2S Settlement Ins Inx: TInx: T2S Settlement Ins [Inx.Sta «ANY» (e.g., «Validate») P: Participant T2S: Settlement P Merge2 Send settlement Instruction Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins Settle Instruction Inx.SettlementDa starts Merge1 Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins PrInx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... Receive notification notif: Participant Notification
  • 20. AGAC Modelling Methodology 21 UML ADs Specify Activity Diagrams (ADs) Specify Intents Specify Constraints Generate Constraints Identify Intents Create Domain Model Elicit Use Cases Domain Model Documents, Interviews AGAC UML ADs UML Use Case Diagrams
  • 21. Automated Generation of Constraints based on Object–flow Analysis 23 The action produces an object Postcondition: attribute values should match the model the property "State" of Inx is equal to "Settled" P:Participant T2S: Settlement Platform Interrup Merge2 Send settlement Instruction Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins X days passed In Process Instruction Rejection Inx: T2S Settlement Ins InInx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... Receive notification notif: Participant Notification [No] [Inx [Yes]
  • 22. Automated Generation of Constraints based on Intents Analysis 25 «Read» «Update» «Delete» «Send» Precondition: the entity exists Inx exists in T2S T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 Inx: T2SSettlement Ins State= ToValidate Receive and Generate Instruction Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2SSettlement Ins State=Settled Inx: T2S Settlement Ins RunMatching Process X days passed Inx: T2SSettlement Ins State=Matched ProcessInstruction Rejection Inx: T2S Settlement Ins Inx: T2SSettlement Ins State = Valid Inx: T2SSettlement Ins State=Rejected «localPostcondition» Lp1: .... [No] [Inx.State == Valid] [Yes] «Update»
  • 23. Extended UML Activity Diagrams UML Use Case Diagrams Domain Models Tool-supported Requirements Modeling
  • 24. Automated AC generation 28 Extended UML Activity Diagrams UML Use Case Diagrams Automated AC generation Domain Models @Intent: Create # Tag Scenario: <action> Given <domainEntity> (of type <class>)? # The type is optional does not exist in <actor> (of type <class>)?, # The type is optional # Zero or more previous guard conditions and local preconditions (And <constraint.expression>)* When <actor> <action>, Then <domainEntity> exists in <actor> (And <constraint.expression>)* # Zero or more local postconditions # Zero or more constraints depending on the properties that are initialised (And the property <property> of <domainEntity> is <operator> <value>) * AGAC Gherkin Scenario Templates Gherkin AC (Id: 10) Merge1 : Merge (Id: 2) Send settlement Instruction : Input (Id: 3) Receive Instruction : Input (Id: 4) Val_Ins : Include (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 1) ActivityInitial : Start (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 16) Proc_Notif : Include (Id: 17) FlowFinal : Exit (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next Next True Next Next Next Next Next Next1Next Test Model Test Sequences Tool-supported Requirements Modeling
  • 25. Test Model Generation (Id: 10) Merge1 : Merge (Id: 2) Send settlement Instruction : Input (Id: 3) Receive Instruction : Input (Id: 4) Val_Ins : Include (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 1) ActivityInitial : Start (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 16) Proc_Notif : Include (Id: 17) FlowFinal : Exit (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next Next True Next Next Next Next Next Next1Next Activity Diagram Test Model 29 P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins RunMatching Process X days passed Inx: T2S Settlement Ins State=Matched Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State = Valid Inx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes] • Metamodel in the paper • One node for each element in the Activity Diagram • Multiple roots: derived from interruptible nodes
  • 26. Test Model Generation (Id: 10) Merge1 : Merge (Id: 2) Send settlement Instruction : Input (Id: 3) Receive Instruction : Input (Id: 4) Val_Ins : Include (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 1) ActivityInitial : Start (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 16) Proc_Notif : Include (Id: 17) FlowFinal : Exit (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next Next True Next Next Next Next Next Next1Next Activity Diagram Test Model 30 • Metamodel in the paper • One node for each element in the Activity Diagram • Multiple roots: derived from interruptible nodes P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins RunMatching Process X days passed Inx: T2S Settlement Ins State=Matched Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State = Valid Inx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes]
  • 27. 31 2S: Settlement Platform InterruptibleActivityRegion1 Validate Ins: Validate Instruction Inx: T2S Settlement Ins Inx.SettlementDate > T2S.CurrentDate nx.SettlementDate starts RunMatching Process X days passed Inx: T2S Settlement Ins State=Matched Process Instruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State = Valid nt Ins ed on» Lp1: .... [No] [Inx.State == Valid] [Yes] (Id: 10) Merge1 : Merge (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next True Next1Next Activity Diagram Test Model
  • 28. Test Sequences Generation (Id: 10) Merge1 : Merge (Id: 2) Send settlement Instruction : Input (Id: 3) Receive Instruction : Input (Id: 4) Val_Ins : Include (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 1) ActivityInitial : Start (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 16) Proc_Notif : Include (Id: 17) FlowFinal : Exit (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next Next True Next Next Next Next Next Next1Next Test model 9 14 13 5 1 10 6 12 17 15 2 3 4 7 11 16 33 • Test Sequence: sequence of nodes • Each test sequence leads to an Acceptance Criterion • Criticality: exercise parallelism • maximize interleavings • breadth-first traversal P1 = [1,2,3,4,5,6,12,7,15,8,16,9,17,10,11,12,15,16,17] P2 = [1,2,3,4,5,6,12,7,15,8,16,10,17,11,12,15,16,17] P3= [1,2,3,4,5,14,12,15,16,17] P4= [13,14,15,16,17] Generated Test Sequences 8
  • 29. (Id: 10) Merge1 : Merge (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next True Next Next1Next 9 5 10 6 12 15 7 11 34 8 a b c d e enhanced breadth-first traversal
  • 30. (Id: 10) Merge1 : Merge (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next True Next Next1Next 9 5 10 6 12 15 7 11 35 8 enhanced breadth-first traversal
  • 31. Test Sequences Generation (Id: 10) Merge1 : Merge (Id: 2) Send settlement Instruction : Input (Id: 3) Receive Instruction : Input (Id: 4) Val_Ins : Include (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 1) ActivityInitial : Start (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 16) Proc_Notif : Include (Id: 17) FlowFinal : Exit (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next Next True Next Next Next Next Next Next1Next Test model 9 14 13 5 1 10 6 12 17 15 2 3 4 7 11 16 37 • Test Sequence: sequence of nodes • Each test sequence leads to an Acceptance Criterion • Criticality: exercise parallelism • maximize interleavings P1 = [1,2,3,4,5,6,12,7,15,8,16,9,17,10,11,12,15,16,17] P2 = [1,2,3,4,5,6,12,7,15,8,16,10,17,11,12,15,16,17] P3= [1,2,3,4,5,14,12,15,16,17] P4= [13,14,15,16,17] Generated Test Sequences 8
  • 32. Test Sequences Generation (Id: 10) Merge1 : Merge (Id: 2) Send settlement Instruction : Input (Id: 3) Receive Instruction : Input (Id: 4) Val_Ins : Include (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 1) ActivityInitial : Start (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 16) Proc_Notif : Include (Id: 17) FlowFinal : Exit (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next Next True Next Next Next Next Next Next1Next Test model 9 14 13 5 1 10 6 12 17 15 2 3 4 7 11 16 38 • Test Sequence: sequence of nodes • Each test sequence leads to an Acceptance Criterion • Criticality: exercise parallelism • maximize interleavings P1 = [1,2,3,4,5,6,12,7,15,8,16,9,17,10,11,12,15,16,17] P2 = [1,2,3,4,5,6,12,7,15,8,16,10,17,11,12,15,16,17] P3= [1,2,3,4,5,14,12,15,16,17] P4= [13,14,15,16,17] Generated Test Sequences 8
  • 33. Test Sequences Generation (Id: 10) Merge1 : Merge (Id: 2) Send settlement Instruction : Input (Id: 3) Receive Instruction : Input (Id: 4) Val_Ins : Include (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 1) ActivityInitial : Start (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 16) Proc_Notif : Include (Id: 17) FlowFinal : Exit (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next Next True Next Next Next Next Next Next1Next Test model 9 14 13 5 1 10 6 12 17 15 2 3 4 7 11 16 39 • Test Sequence: sequence of nodes • Each test sequence leads to an Acceptance Criterion • Criticality: exercise parallelism • maximize interleavings P1 = [1,2,3,4,5,6,12,7,15,8,16,9,17,10,11,12,15,16,17] P2 = [1,2,3,4,5,6,12,7,15,8,16,10,17,11,12,15,16,17] P3= [1,2,3,4,5,14,12,15,16,17] P4= [13,14,15,16,17] Generated Test Sequences 8
  • 34. Test Sequences Generation (Id: 10) Merge1 : Merge (Id: 2) Send settlement Instruction : Input (Id: 3) Receive Instruction : Input (Id: 4) Val_Ins : Include (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 1) ActivityInitial : Start (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 16) Proc_Notif : Include (Id: 17) FlowFinal : Exit (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next Next True Next Next Next Next Next Next1Next Test model 9 14 13 5 1 10 6 12 17 15 2 3 4 7 11 16 40 • Test Sequence: sequence of nodes • Each test sequence leads to an Acceptance Criterion • Criticality: exercise parallelism • maximize interleavings P1 = [1,2,3,4,5,6,12,7,15,8,16,9,17,10,11,12,15,16,17] P2 = [1,2,3,4,5,6,12,7,15,8,16,10,17,11,12,15,16,17] P3= [1,2,3,4,5,14,12,15,16,17] P4= [13,14,15,16,17] Generated Test Sequences 8
  • 35. Automated AC generation 41 Extended UML Activity Diagrams UML Use Case Diagrams Automated AC generation Domain Models @Intent: Create # Tag Scenario: <action> Given <domainEntity> (of type <class>)? # The type is optional does not exist in <actor> (of type <class>)?, # The type is optional # Zero or more previous guard conditions and local preconditions (And <constraint.expression>)* When <actor> <action>, Then <domainEntity> exists in <actor> (And <constraint.expression>)* # Zero or more local postconditions # Zero or more constraints depending on the properties that are initialised (And the property <property> of <domainEntity> is <operator> <value>) * AGAC Gherkin Scenario Templates Gherkin AC (Id: 10) Merge1 : Merge (Id: 2) Send settlement Instruction : Input (Id: 3) Receive Instruction : Input (Id: 4) Val_Ins : Include (Id: 5) Inx.State == Valid : BiflowCondition (Id: 6) : ParallelStart (Id: 7) Run Matching process : Internal (Id: 1) ActivityInitial : Start (Id: 9) Inx.SettlementDate : Other (Id: 13) X days : Interrupt (Id: 11) Settle Instruction : Input (Id: 12) Merge2 : Merge (Id: 15) Send Notification : Input (Id: 16) Proc_Notif : Include (Id: 17) FlowFinal : Exit (Id: 14) Process Instruction Rejection : Internal (Id: 8) Inx.SettlementDate > T2S.CurrentDate : BiflowCondition False Next0 Next Next False Next Next True Next Next Next True Next Next Next Next Next Next1Next Test Model Test Sequences Tool-supported Requirements Modeling
  • 36. Test Sequence T2S: Settlement Platform Merge2 Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx Settlem Inx.SettlementDate > T2S.CurrentDate Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins Process Instruction Rejection SettInx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... : ant tion [Yes] Scenario Generation with Gherkin Templates 42 «Create» @Intent: Create Scenario: <action> Given <domainEntity> (of type <class1>)? does not exist in <actor> (of type <class2>)? (And PRECONDITIONS_TEXT) * When <actor> <action> Then <domainEntity> (of type <class1>)? exist in <actor> (of type <class2>)? (And the property <property> of <domainEntity> is <operator> <value>)* «Create» Template Gherkin Scenario @Intent: Create Scenario: Receive and Generate Instruction Given Inx of type "T2S Settlement Ins" does not exists in T When T2S Receive and Generate Instruction Then Inx exists in T2S And the property State of Inx is equal to "ToValidate" • 12 templates: one for each of the 11 intents + one for interrupts
  • 38. Template for «Create» Intent 44 @Intent: Create Scenario: <action> Given GENERATED_PRECONDITION_FOR_CREATE_INTENT (And PRECONDITIONS_TEXT) * When <actor> <action> Then <domainEntity> (of type <class1>)? exist in <actor> (of type <class2>)? (And GENERATED_POSTCONDITION_FOR_UPDATED_OBJECTS)* @Intent: Create Scenario: Receive and Generate Instruction Given Inx of type "T2S Settlement Ins" does not exists in T2S of type "Settlement Platform" When T2S Receive and Generate Instruction Then Inx exists in T2S And the property State of Inx is equal to "ToValidate" T2S: Settlement Platform Merge2 Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Se Inx.SettlementDate T2S.CurrentDate Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins Process Instruction Rejection Inx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... notif: rticipant tification [Yes]
  • 39. Template for «Create» Intent 45 @Intent: Create Scenario: <action> Given GENERATED_PRECONDITION_FOR_CREATE_INTENT (And PRECONDITIONS_TEXT) * When <actor> <action> Then <domainEntity> (of type <class1>)? exist in <actor> (of type <class2>)? (And GENERATED_POSTCONDITION_FOR_UPDATED_OBJECTS)* @Intent: Create Scenario: Receive and Generate Instruction Given Inx of type "T2S Settlement Ins" does not exists in T2S of type "Settlement Platform" When T2S Receive and Generate Instruction Then Inx exists in T2S And the property State of Inx is equal to "ToValidate" T2S: Settlement Platform Merge2 Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Se Inx.SettlementDate T2S.CurrentDate Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins Process Instruction Rejection Inx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... notif: rticipant tification [Yes]
  • 40. Template for «Create» Intent 46 @Intent: Create Scenario: <action> Given <domainEntity> (of type <class1>)? does not exist in <actor> (of type <class2>)? (And PRECONDITIONS_TEXT) * When <actor> <action> Then <domainEntity> (of type <class1>)? exist in <actor> (of type <class2>)? (And GENERATED_POSTCONDITION_FOR_UPDATED_OBJECTS)* @Intent: Create Scenario: Receive and Generate Instruction Given Inx of type "T2S Settlement Ins" does not exists in T2S of type "Settlement Platform" When T2S Receive and Generate Instruction Then Inx exists in T2S And the property State of Inx is equal to "ToValidate" T2S: Settlement Platform Merge2 Inx: T2S Settlement Ins State= ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Se Inx.SettlementDate T2S.CurrentDate Inx: T2S Settlement Ins State=Settled Send Notification Inx: T2S Settlement Ins Process Instruction Rejection Inx: T2S Settlement Ins State=Rejected «localPostcondition» Lp1: .... notif: rticipant tification [Yes]
  • 42. Empirical Evaluation • RQ1. Can practitioners model all the requirements with AGAC? • RQ2. Can AGAC successfully generate AC in Gherkin? • RQ3. Is the additional effort required by AGAC justified? 50 Exchange Trade Fund Issuance System
  • 43. RQ1. Can practitioners model all the requirements with AGAC? • One hour training on modeling methodology • Four analysts applied the methodology to model the requirements of their system • Successful 51 14 Activity Diagrams (434 elements) Domain Model (176 elements)
  • 44. RQ2. Can AGAC successfully generate AC in Gherkin? • Applied AGAC to the models of the case study • AGAC generated 137 AC including 990 Gherkin scenarios • Randomly selected 10% for manual validation with experts • experts confirmed their correctness • inferred relevant conditions • intents correctly identified • covered expected sequences of activities • AC generation took negligible time • 25 seconds on laptop with Intel i7 and 4GB RAM 52
  • 45. RQ3: Is the additional effort required by AGAC justified? • Total number of elements in the models: 610 • 461 (76%) are shared with the existing modeling practice • 149 (24%) are imposed by the new methodology • Modelling effort is justified by advantages • cost reduction; at Clearstream, the manual creation and updating of AC is 50% of requirements analysis effort • AGAC automatically generates the required AC • generation is systematic • additional automation opportunities: regression testing 53
  • 46. Lessons Learned 1. Automated generation of AC is a strong motivator for building better models 2. AC generation provides a feedback loop for detecting incompleteness and incrementally improve the models 3. Engineers need a dedicated language or analysis for constraints definition 54 [ICST'18] [ICST'18] Chunhui Wang, Fabrizio Pastore, Lionel Briand. Automated Generation of Constraints from Use Case Specifications to Support System Testing. 11th International Conference on Software Testing, Verification and Validation, 2018
  • 47. 55 Gap between Requirements Modeling and BDD ? P: Participant T2S: Settlement Platform InterruptibleActivityRegion1 Merge2 ActivityInitial Send settlement Instruction Inx: T2S Settlement Ins State =ToValidate Receive and Generate InstructionpInx: Participant Settlement Ins Validate Ins: Validate Instruction Inx: T2S Settlement Ins Settle Instruction Inx.SettlementDate > T2S.CurrentDate Inx.SettlementDate starts Merge1 Inx: T2S Settlement Ins State =Settled Send Notification Inx: T2S Settlement Ins Run Matching Process X days passed Inx: T2S Settlement Ins State =Matched ProcessInstruction Rejection Inx: T2S Settlement Ins Inx: T2S Settlement Ins State =Valid Inx: T2S Settlement Ins State =Rejected «localPostcondition» Lp1: .... FlowFinal Receive notification notif: Participant Notification [No] [Inx.State == Valid] [Yes] Domain Model (Class diagram) Participant Settlement Ins T2S Settlement Ins State: T2S Instruction State Participant Notification Reason: String [0..1] Message: String Settlement Instruction SettlementDate: Date «enumeratio... T2S Instruction State ToValidate Valid Settled Rejected Matched 0..*Participant Instruction uc Actors Participant «actor» Settlement Platform isInitialised: Boolean «Pre-condition» {SettlementPlatform.allInstances() ->forAll (t / t.isInitialised=true)} Requirements Modeling Acceptance Testing Test Scenarios Models Acceptance Criteria Manual Definition of AC 5 Analysts Test Engineers AGAC Approach 8 Extended UML Activity Diagrams UML Use Case Diagrams Requirements Modelling following AGAC tool-supported Methodology Automated AC generation Domain Models @Intent: Create # Tag Scenario: <action> Given <domainEntity> (of type <class>)? # The type is optional does not exist in <actor> (of type <class>)?, # The type is optional # Zero or more previous guard conditions and local preconditions (And <constraint.expression>)* When <actor> <action>, Then <domainEntity> exists in <actor> (And <constraint.expression>)* # Zero or more local postconditions # Zero or more constraints depending on the properties that are initialised (And the property <property> of <domainEntity> is <operator> <value>) * AGAC Gherkin Scenario Templates Gherkin AC Pre-/Post-conditions High-level Intents of Activities Empirical Evaluation • RQ1. Can practitioners model all the requirements with AGAC? • RQ2. Can AGAC successfully generate AC in Gherkin? • RQ3. Is the additional effort required by AGAC justified? 24 Yes Yes Yes
  • 48. .lusoftware verification & validation VVS Bridging the Gap between Requirements Modeling and Behavior-driven Development Mauricio Alferez*, Fabrizio Pastore*, Mehrdad Sabetzadeh*, Lionel Briand*+ Jean-Richard Riccardix *University of Luxembourg, +University of Ottawa, xClearstream MODELS 2019 September 20th, 2019