SlideShare a Scribd company logo
.lusoftware verification & validation
VVS
Automatic Generation of System Test
Cases from Use Case Specifications 
Chunhui Wang, Fabrizio Pastore, Arda Goknil, Lionel Briand, Zohaib Iqbal

University of Luxembourg,!
Luxembourg!
{chunhui.wang,fabrizio.pastore,arda.goknil,lionel.briand, muhammad.zohaib}@uni.lu
ISSTA’15, Baltimore, July 17th, 2015
Problem
• Verifying the compliance of a system with its
requirements in a cost-effective way
• Traceability between requirements and system test
cases – This cannot be manual
• E.g., automotive industry which must comply to ISO
26262
2
Objectives
• Automatically generate test cases from requirements
• Capture and create traceability information between test
cases and requirements
3
Context Matters
• Requirements are captured through use cases
• Use cases are used to communicate with customers
and the system test team
• Complete and precise behavioral models are not an
option: too expensive
4
Strategy
• Analyzable use case specifications
• Automatically extract test model from the use case
specifications
• Minimize modeling
• No behavioral modeling
5
Use Case Modeling for System Tests Generation 
(UMTG)
6
Elicit Use Cases
1
THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

RUCM
Use Cases
7
RUCM Use Case Example
8
Use Case Name: Identify Occupancy Status
Actors: AirbagControlUnit
Precondition: The system has been initialized
. . .
"Basic Flow
1. The seat SENDS occupancy status TO the system. 
2. INCLUDE USE CASE Classify occupancy status. 
3. The system VALIDATES THAT the occupant class for airbag control is valid. 
4. The system SENDS the occupant class for airbag control TO AirbagControlUnit. 
Specific Alternative Flow
RFS 3
1. IF the occupant class for airbag control is not valid THEN
Postcondition: The occupant class for airbag control has been sent. 
Postcondition: The previous occupant class for airbag control has been sent.
[Yue et al. TOSEM’13]
Elicit Use Cases
1
THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

RUCM
Use Cases
Model the Domain
2
Domain Model
9
1
System
AirbagControl
 Sensor
OccupantStatus
- OccupantClassForAirbagControl
- OccupantClassForSeatBeltReminder
1
1
1
1
1
1
1..*
Elicit Use Cases
1
Model the Domain
2
THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

RUCM
Use Cases
Generate
Scenarios
and Inputs
6
ERRORS ARE ABSENT
TEMPERATURE IS LOW
STATUS IS VALID
Identify Constraints
4
Constraint descriptions
Evaluate 
Consistency
3
Domain Model
Based on Natural
Language Processing
10
11
Basic Flow
1. The seat SENDS occupancy status TO the system. 
2. INCLUDE USE CASE Classify occupancy status. 
3. The system VALIDATES THAT 
the occupant class for airbag control is valid and 
the occupant class for seat belt reminder is valid. 
4. The system SENDS the occupant class for airbag control TO
AirbagControlUnit. 
5. The system SENDS the occupant class for seat belt reminder TO
SeatBeltControlUnit. 
6. The System Waits for next execution cycle.
Postcondition: The occupant class for airbag control and the
occupant class for seat belt reminder have been sent. 
INPUT STEP
INCLUDE STEP
CONDITIONAL STEP
OUTPUT STEP
OUTPUT STEP
INTERNAL STEP
POSTCONDITION
DOMAIN ENTITY
CONSTRAINT
CONSTRAINT
DOMAIN ENTITY
DOMAIN ENTITY
ERRORS ARE ABSENT
TEMPERATURE IS LOW
STATUS IS VALID
Identify Constraints
4
Generate
Scenarios
and Inputs
6
Elicit Use Cases
1
Constraint descriptions
THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

Model the Domain
2
12
RUCM
Use Cases
Evaluate 
Consistency
3
Domain Model
Missing Entities
Evaluate Model Consistency
Occupant Class for Airbag Control
Occupant Class for Seat Belt Reminder
Domain Entities
Airbag Control
 Classification Filter
 Sensor
Tagged Use Case
Evaluate Model Consistency
14
Occupant Class for Airbag Control
Occupant Class for Seat Belt Reminder
Domain Entities
AirbagControl
System
Sensor
OccupantStatus
- OccupantClassForAirbagControl
- OccupantClassForSeatBeltReminder
Airbag Control
 Classification Filter
 Sensor
ClassificationFilter
Tagged Use Case
1
1
1
1
1
1
1
1..*
1
 1
Generate
Scenarios
and Inputs
6
Elicit Use Cases
1
Missing Entities
THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

Model the Domain
2
Evaluate 
Consistency
3
Domain Model
15
ERRORS ARE ABSENT
TEMPERATURE IS LOW
STATUS IS VALID
Identify Constraints
4
Constraint descriptions
RUCM
Use Cases
Errors.size() == 0
Status != null
t > 0 && t < 50
Specify Constraints
5
OCL constraints
Identify Constraints
16
The occupant class for airbag control is valid
Voltage error is detected
List of Constraints 
The occupant class for seat belt reminder is valid
Tagged Use Case
Voltage error is detected
List of Constraint Descriptions
The occupant class for seat belt reminder is valid
Tagged Use Case
Engineers Specify Constraints
System.allInstances()
->forAll(b | b.occupancyStatus.classForAirbag <> Status::Error)
Software Engineers specify corresponding OCL constraints
The occupant class for airbag control is valid
17
Errors.size() == 0
Status != null
t > 0 && t < 50
Elicit Use Cases
1
Missing Entities
Specify Constraints
5
THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

Model the Domain
2
Evaluate 
Consistency
3
Domain Model
ERRORS ARE ABSENT
TEMPERATURE IS LOW
STATUS IS VALID
Identify Constraints
4
Constraint descriptions
18
RUCM
Use Cases
Generate
Scenarios
and Inputs
6
Object
Diagrams
Test
Scenarios
OCL constraints
19
Basic Flow
1. The seat SENDS occupancy status TO the system. 
2. INCLUDE USE CASE Classify occupancy status. 
3. The system VALIDATES THAT 
the occupant class for airbag control is valid and 
the occupant class for seat belt reminder is valid. 
4. The system SENDS the occupant class for airbag control TO
AirbagControlUnit. 
5. The system SENDS the occupant class for seat belt reminder TO
SeatBeltControlUnit. 
6. The System Waits for next execution cycle.
Postcondition: The occupant class for airbag control and the
occupant class for seat belt reminder have been sent. 
INPUT STEP
INCLUDE STEP
CONDITIONAL STEP
OUTPUT STEP
OUTPUT STEP
INTERNAL STEP
POSTCONDITION
DOMAIN ENTITY
CONSTRAINT
CONSTRAINT
DOMAIN ENTITY
DOMAIN ENTITY
INCLUDE STEP
CONDITIONAL STEP
OUTPUT STEP
OUTPUT STEP
INTERNAL STEP
POSTCONDITION
20
Basic Flow
1. The seat SENDS occupancy status TO the system. 
2. INCLUDE USE CASE Classify occupancy status. 
3. The system VALIDATES THAT 
the occupant class for airbag control is valid and 
the occupant class for seat belt reminder is valid. 
4. The system SENDS the occupant class for airbag control TO
AirbagControlUnit. 
5. The system SENDS the occupant class for seat belt reminder TO
SeatBeltControlUnit. 
6. The System Waits for next execution cycle.
Postcondition: The occupant class for airbag control and the
occupant class for seat belt reminder have been sent. 
UseCaseStart
INPUT STEP
DOMAIN ENTITY
CONSTRAINT
CONSTRAINT
DOMAIN ENTITY
DOMAIN ENTITY
Precondition
CONDITIONAL STEP
OUTPUT STEP
OUTPUT STEP
INTERNAL STEP
POSTCONDITION
21
Basic Flow
1. The seat SENDS occupancy status TO the system. 
2. INCLUDE USE CASE Classify occupancy status. 
3. The system VALIDATES THAT 
the occupant class for airbag control is valid and 
the occupant class for seat belt reminder is valid. 
4. The system SENDS the occupant class for airbag control TO
AirbagControlUnit. 
5. The system SENDS the occupant class for seat belt reminder TO
SeatBeltControlUnit. 
6. The System Waits for next execution cycle.
Postcondition: The occupant class for airbag control and the
occupant class for seat belt reminder have been sent. 
UseCaseStart
Input
INCLUDE STEP
DOMAIN ENTITY
CONSTRAINT
CONSTRAINT
DOMAIN ENTITY
DOMAIN ENTITY
Precondition
OccupancyStatus
DomainEntity
DOMAIN ENTITY
22
UseCaseStart
Input
Include
Condition
Output
Exit
Condition
Exit
 Output
Exit
OccupancyStatus
DomainEntity

System.initialized = true
OCL Constraint

AirbagControlUnit.AllI…
OCL Constraint

…
OCL Constraint

…
DomainEntity





OCL Constraint
OccupancyStatus.ClassForSeat <> Error
AND
OccupancyStatus.ClassForAirbag <> Error
23
UseCaseStart
Input
Include
Condition
Output
Exit
Condition
Exit
 Output
Exit
System.initialized = true
AND
OccupancyStatus.ClassForSeat <> Error
AND 
OccupancyStatus.ClassForAirbag <> Error
Path condition: 





OCL Constraint
OccupancyStatus.ClassForSeat <> Error
AND
OccupancyStatus.ClassForAirbag <> Error
 OccupancyStatus
DomainEntity

System.initialized = true
OCL Constraint

AirbagControlUnit.AllI…
OCL Constraint
OCL Path Condition:
System.allInstances() -> forAll(b | b.initialized = true ) AND
OccupancyStatus.allInstances() 

-> forAll(o| o.ClassForSeat <> Status:: Error) AND
OccupancyStatus.allInstances() 

-> forAll(o| o.ClassForAirbag <> Status::Error)
24
System.initialized = true
AND
OccupancyStatus.ClassForSeat <> Error
AND 
OccupancyStatus.ClassForAirbag <> Error
Path condition: 
OCL Solver
:System
Initialized = true
Version = 3
:OccupancyStatus
ClassForSeat = Adult
ClassForAirbag = Adult
Input Values
OccupancyStatus.ClassForAirbag = Adult
OccupancyStatus.ClassForSeat = Adult
System.initialized = true 
Object Diagram
1
System
AirbagControl
Sensor
OccupantStatus
- ClassForAirbag
- ClassForSeat
 1
1
1
1
1
1
1..*
Domain Model:
THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

ERRORS ARE ABSENT
TEMPERATURE IS LOW
STATUS IS VALID
Identify Constraints
4
Constraint descriptions
Errors.size() == 0
Status != null
t > 0 && t < 50
Generate
Scenarios
and Inputs
6
Elicit Use Cases
1
Missing Entities
Specify Constraints
5
OCL constraints
Model the Domain
2
Evaluate 
Consistency
3
Domain Model
RUCM
Use Cases
Generate 
Test Cases
7
Test Cases
Object
Diagrams
Test
Scenarios
25
26
UseCaseStart
Input
Include
Condition
Output
Exit
Test Case
occupancyStatus.ClassForAirbag = Adult
OccupancyStatus
DomainEntity
Scenario Under Test
System.initialized = true
<INPUT>
<CHECK>
<INPUT>
AirbagControlUnit.AllInstances() 
-> forAll(a|a.status = a.bodySense.occupancyStatus)

System.initialized = true
OCL Constraint
Input Values
occupancyStatus.ClassForAirbag = Adult
occupancyStatus.ClassForSeat = Adult 
System.initialized = true
occupancyStatus.ClassForSeat = Adult
 
AirbagControlUnit.AllI…
OCL Constraint
Abstract Test Case
THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

ERRORS ARE ABSENT
TEMPERATURE IS LOW
STATUS IS VALID
Identify Constraints
4
Constraint descriptions
Errors.size() == 0
Status != null
t > 0 && t < 50
Generate
Scenarios
and Inputs
6
Elicit Use Cases
1
Missing Entities
Specify Constraints
5
OCL constraints
Model the Domain
2
Evaluate 
Consistency
3
Domain Model
RUCM
Use Cases
Generate 
Test Cases
7
Test Cases
Object
Diagrams
Test
Scenarios
27
Mapping Table
Generation of Executable Test Cases
28
ResetPower (Time = INIT_TIME) 
SetBus (Chanel = RELAY_CLASS, Status = CLASS1)
ReadAndCheckBus ( D0 = OCCUPIED, D1 = OCCUPIED)
Abstract test steps
 Resulting Test Driver Functions
Matching Patterns
 Function Name
 Parameters
<INPUT>
 Classfor* = Adult
 SetBus
<INPUT>
 System.initialized = true
 ResetPower
<CHECK>
 AirBagControlUnit.allInstant…
 ReadAndCheckBus
Chanel = RELAY_CLASS
Status = CLASS1
Time = INIT_TIME
Mapping Table:
occupancyStatus.ClassForAirbag = Adult
System.initialized = true
<INPUT>
<CHECK>
<INPUT>
AirbagControlUnit.AllInstances() 
-> forAll(a|a.status = a.bodySense.occupancyStatus)
occupancyStatus.ClassForSeat = Adult
Abstract Test Case:
D0=OCCUPIED
…
Executable Test Case:
THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
THE SYSTEM VALI
THE SYSTEM DIS
THE ACTOR SEND

ERRORS ARE ABSENT
TEMPERATURE IS LOW
STATUS IS VALID
Identify Constraints
4
Constraint descriptions
Errors.size() == 0
Status != null
t > 0 && t < 50
Generate
Scenarios
and Inputs
6
Elicit Use Cases
1
Missing Entities
Specify Constraints
5
OCL constraints
Model the Domain
2
Evaluate 
Consistency
3
Domain Model
RUCM
Use Cases
Generate 
Test Cases
7
Test Cases
Object
Diagrams
Test
Scenarios
29
Mapping Table
Case Study
• BodySense, embedded system for detecting occupancy
status in a car
• Evaluation:
• Cost of additional modelling
• Effectiveness in terms of covered scenarios
compared to current practice at IEE
30
Complexity of the Case Study
31
Use Case
 Steps
 Use Case
Flows
UC1
 50
 8
UC2
 44
 13
UC3
 35
 8
UC4
 59
 11
UC5
 30
 8
UC6
 25
 6
Costs of Additional Modeling
32
Use Case
 Steps
 Use Case
Flows
OCL
Constraints
UC1
 50
 8
 9
UC2
 44
 13
 7
UC3
 35
 8
 8
UC4
 59
 11
 12
UC5
 30
 8
 5
UC6
 25
 6
 12
5 to 10 minutes to write each constraints
Effectiveness: scenarios covered
33
0
5
10
15
20
25
30
35
40
UC1
 UC2
 UC3
 UC4
 UC5
 UC6
Scenarios Covered By Engineer
 Scenarios Covered By UMTG
100%
100%
100%
100%
 100%
100%
81%
77%
100%
86%
50%
 67%
It is hard for engineers to capture 
all the possible scenarios
involving error conditions.
Problem
• Requirements-driven test automation
• Traceability between requirements and system test
cases – This cannot be manual
• E.g., automotive industry which must comply to ISO
26262
34
ERRORS ARE ABSENT
TEMPERATURE IS LOW
STATUS IS VALID
Errors.size() == 0
Status = null
> 0 && t < 50
Identify Constraints
4
Generate
Scenarios
and Inputs
6
Generate 
Test Cases
7
Evaluate 
Consistency
3
Elicit Use Cases
1
Model the Domain
2
Specify Constraints
5
Domain Model
Missing Entities
Constraint descriptions
OCL constraints
THE ACTOR SEND
HE SYSTEM VALI
HE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
HE SYSTEM VALI
HE SYSTEM DIS
THE ACTOR SEND

THE ACTOR SEND
HE SYSTEM VALI
HE SYSTEM DIS
THE ACTOR SEND

RUCM
Use Cases
Test Cases
Object
Diagrams
Test
Scenarios0
5
10
15
20
25
30
35
40
UC1
 UC2
 UC3
 UC4
 UC5
 UC6
Scenarios Covered By Engineer
 Scenarios Covered By UMTG
100%
100%
100%
100%
 100%
100%
81%
77%
100%
86%
50%
 67%
Acceptable modelling effort
Full scenario coverage
35
NLP Pipeline
Tokenizer
UMTG 
Gazetteer
Part of
Speech
Tagger
UMTG
Transducers
The seat SENDS occupancy status TO the system.
36
NLP Pipeline
Tokenizer
UMTG 
Gazetteer
Part of
Speech
Tagger
UMTG
Transducers
The seat SENDS occupancy status TO the system.
ACTOR SEND NOUN PHRASE SYSTEMTO
37
NLP Pipeline
Tokenizer
UMTG 
Gazetteer
Part of
Speech
Tagger
UMTG
Transducers
The seat SENDS occupancy status TO the system.
ACTOR SEND NOUN PHRASE SYSTEMTO
ACTOR SEND TONOUN PHRSE SYSTEM
INPUT STEP PATTERN

More Related Content

PDF
PUMConf: A Tool to Configure Product Specific Use Case and Domain Models in a...
PDF
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
PDF
Search-Based Robustness Testing of Data Processing Systems
PDF
Incremental Reconfiguration of Product Specific Use Case Models for Evolving ...
PDF
Automated Test Suite Generation for Time-Continuous Simulink Models
PDF
Effective Test Suites for ! Mixed Discrete-Continuous Stateflow Controllers
PDF
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
PDF
SBST 2019 Keynote
PUMConf: A Tool to Configure Product Specific Use Case and Domain Models in a...
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
Search-Based Robustness Testing of Data Processing Systems
Incremental Reconfiguration of Product Specific Use Case Models for Evolving ...
Automated Test Suite Generation for Time-Continuous Simulink Models
Effective Test Suites for ! Mixed Discrete-Continuous Stateflow Controllers
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
SBST 2019 Keynote

What's hot (19)

PDF
AI in SE: A 25-year Journey
PDF
A Natural Language Programming Approach for Requirements-based Security Testing
PDF
Rachid kherrazi-testing-asd-interface-compliance-with-asd spec
PPT
Software testing mtech project in jalandhar
PPT
Software testing mtech project in ludhiana
PPTX
Testware Hierarchy for Test Automation
PDF
Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...
PPT
6months industrial training in software testing, jalandhar
PPT
6 weeks summer training in software testing,jalandhar
PPT
White boxvsblackbox
PPT
New software testing-techniques
PPTX
Software testing
PDF
Design for Testability
PDF
Implementing Blackbox Testing
PPTX
Se (techniques for black box testing ppt)
PPTX
Model Driven Testing: requirements, models & test
PPTX
PPTX
An Insight into the Black Box and White Box Software Testing
AI in SE: A 25-year Journey
A Natural Language Programming Approach for Requirements-based Security Testing
Rachid kherrazi-testing-asd-interface-compliance-with-asd spec
Software testing mtech project in jalandhar
Software testing mtech project in ludhiana
Testware Hierarchy for Test Automation
Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...
6months industrial training in software testing, jalandhar
6 weeks summer training in software testing,jalandhar
White boxvsblackbox
New software testing-techniques
Software testing
Design for Testability
Implementing Blackbox Testing
Se (techniques for black box testing ppt)
Model Driven Testing: requirements, models & test
An Insight into the Black Box and White Box Software Testing
Ad

Similar to Automatic Generation of System Test Cases from Use Case Specifications (20)

PDF
Natural Language Processing to Automate System Testing based on Requirements
PDF
Automated Generation of Constraints from Use Case Specifications to Support S...
PDF
Automated and Scalable Solutions for Software Testing: The Essential Role of ...
PDF
Bridging the Gap between Requirements Modeling and Behavior-driven Development
PDF
System Testing of Timing Requirements based on Use Cases and Timed Automata
PDF
Automating System Test Case Classification and Prioritization for Use Case-Dr...
PPT
05 use-case-modeling-1mon
PPT
05 use-case-modeling-1mon
DOCX
1. Use Case DiagramThe following Use Case Diagram shows the pr.docx
PDF
Use Case diagram-UML diagram-1
PDF
Leveraging Natural-language Requirements for Deriving Better Acceptance Crite...
PPTX
System Design of Online Ticketing System
PDF
Lecture7 use case modeling
PPT
2. Use Case Analysis
PPT
chapter-4-objected-oriented analysis and design with UML.ppt
PDF
Example requirements specification
PDF
Use cases - As approach to building shared vision
PPT
Requirements analysis lecture
PDF
Lect_4_Requirement Modeling(Use Case_and_Static).pdf
PPT
Use Case Modeling
Natural Language Processing to Automate System Testing based on Requirements
Automated Generation of Constraints from Use Case Specifications to Support S...
Automated and Scalable Solutions for Software Testing: The Essential Role of ...
Bridging the Gap between Requirements Modeling and Behavior-driven Development
System Testing of Timing Requirements based on Use Cases and Timed Automata
Automating System Test Case Classification and Prioritization for Use Case-Dr...
05 use-case-modeling-1mon
05 use-case-modeling-1mon
1. Use Case DiagramThe following Use Case Diagram shows the pr.docx
Use Case diagram-UML diagram-1
Leveraging Natural-language Requirements for Deriving Better Acceptance Crite...
System Design of Online Ticketing System
Lecture7 use case modeling
2. Use Case Analysis
chapter-4-objected-oriented analysis and design with UML.ppt
Example requirements specification
Use cases - As approach to building shared vision
Requirements analysis lecture
Lect_4_Requirement Modeling(Use Case_and_Static).pdf
Use Case Modeling
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 ...

Recently uploaded (20)

PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Essential Infomation Tech presentation.pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
medical staffing services at VALiNTRY
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
System and Network Administration Chapter 2
PPTX
ai tools demonstartion for schools and inter college
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Digital Strategies for Manufacturing Companies
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Operating system designcfffgfgggggggvggggggggg
Essential Infomation Tech presentation.pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
medical staffing services at VALiNTRY
PTS Company Brochure 2025 (1).pdf.......
Odoo Companies in India – Driving Business Transformation.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
wealthsignaloriginal-com-DS-text-... (1).pdf
System and Network Administration Chapter 2
ai tools demonstartion for schools and inter college
How to Choose the Right IT Partner for Your Business in Malaysia
Softaken Excel to vCard Converter Software.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
CHAPTER 2 - PM Management and IT Context
VVF-Customer-Presentation2025-Ver1.9.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Digital Strategies for Manufacturing Companies
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus

Automatic Generation of System Test Cases from Use Case Specifications

  • 1. .lusoftware verification & validation VVS Automatic Generation of System Test Cases from Use Case Specifications Chunhui Wang, Fabrizio Pastore, Arda Goknil, Lionel Briand, Zohaib Iqbal University of Luxembourg,! Luxembourg! {chunhui.wang,fabrizio.pastore,arda.goknil,lionel.briand, muhammad.zohaib}@uni.lu ISSTA’15, Baltimore, July 17th, 2015
  • 2. Problem • Verifying the compliance of a system with its requirements in a cost-effective way • Traceability between requirements and system test cases – This cannot be manual • E.g., automotive industry which must comply to ISO 26262 2
  • 3. Objectives • Automatically generate test cases from requirements • Capture and create traceability information between test cases and requirements 3
  • 4. Context Matters • Requirements are captured through use cases • Use cases are used to communicate with customers and the system test team • Complete and precise behavioral models are not an option: too expensive 4
  • 5. Strategy • Analyzable use case specifications • Automatically extract test model from the use case specifications • Minimize modeling • No behavioral modeling 5
  • 6. Use Case Modeling for System Tests Generation (UMTG) 6
  • 7. Elicit Use Cases 1 THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND RUCM Use Cases 7
  • 8. RUCM Use Case Example 8 Use Case Name: Identify Occupancy Status Actors: AirbagControlUnit Precondition: The system has been initialized . . . "Basic Flow 1. The seat SENDS occupancy status TO the system. 2. INCLUDE USE CASE Classify occupancy status. 3. The system VALIDATES THAT the occupant class for airbag control is valid. 4. The system SENDS the occupant class for airbag control TO AirbagControlUnit. Specific Alternative Flow RFS 3 1. IF the occupant class for airbag control is not valid THEN Postcondition: The occupant class for airbag control has been sent. Postcondition: The previous occupant class for airbag control has been sent. [Yue et al. TOSEM’13]
  • 9. Elicit Use Cases 1 THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND RUCM Use Cases Model the Domain 2 Domain Model 9 1 System AirbagControl Sensor OccupantStatus - OccupantClassForAirbagControl - OccupantClassForSeatBeltReminder 1 1 1 1 1 1 1..*
  • 10. Elicit Use Cases 1 Model the Domain 2 THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND RUCM Use Cases Generate Scenarios and Inputs 6 ERRORS ARE ABSENT TEMPERATURE IS LOW STATUS IS VALID Identify Constraints 4 Constraint descriptions Evaluate Consistency 3 Domain Model Based on Natural Language Processing 10
  • 11. 11 Basic Flow 1. The seat SENDS occupancy status TO the system. 2. INCLUDE USE CASE Classify occupancy status. 3. The system VALIDATES THAT the occupant class for airbag control is valid and the occupant class for seat belt reminder is valid. 4. The system SENDS the occupant class for airbag control TO AirbagControlUnit. 5. The system SENDS the occupant class for seat belt reminder TO SeatBeltControlUnit. 6. The System Waits for next execution cycle. Postcondition: The occupant class for airbag control and the occupant class for seat belt reminder have been sent. INPUT STEP INCLUDE STEP CONDITIONAL STEP OUTPUT STEP OUTPUT STEP INTERNAL STEP POSTCONDITION DOMAIN ENTITY CONSTRAINT CONSTRAINT DOMAIN ENTITY DOMAIN ENTITY
  • 12. ERRORS ARE ABSENT TEMPERATURE IS LOW STATUS IS VALID Identify Constraints 4 Generate Scenarios and Inputs 6 Elicit Use Cases 1 Constraint descriptions THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND Model the Domain 2 12 RUCM Use Cases Evaluate Consistency 3 Domain Model Missing Entities
  • 13. Evaluate Model Consistency Occupant Class for Airbag Control Occupant Class for Seat Belt Reminder Domain Entities Airbag Control Classification Filter Sensor Tagged Use Case
  • 14. Evaluate Model Consistency 14 Occupant Class for Airbag Control Occupant Class for Seat Belt Reminder Domain Entities AirbagControl System Sensor OccupantStatus - OccupantClassForAirbagControl - OccupantClassForSeatBeltReminder Airbag Control Classification Filter Sensor ClassificationFilter Tagged Use Case 1 1 1 1 1 1 1 1..* 1 1
  • 15. Generate Scenarios and Inputs 6 Elicit Use Cases 1 Missing Entities THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND Model the Domain 2 Evaluate Consistency 3 Domain Model 15 ERRORS ARE ABSENT TEMPERATURE IS LOW STATUS IS VALID Identify Constraints 4 Constraint descriptions RUCM Use Cases Errors.size() == 0 Status != null t > 0 && t < 50 Specify Constraints 5 OCL constraints
  • 16. Identify Constraints 16 The occupant class for airbag control is valid Voltage error is detected List of Constraints The occupant class for seat belt reminder is valid Tagged Use Case
  • 17. Voltage error is detected List of Constraint Descriptions The occupant class for seat belt reminder is valid Tagged Use Case Engineers Specify Constraints System.allInstances() ->forAll(b | b.occupancyStatus.classForAirbag <> Status::Error) Software Engineers specify corresponding OCL constraints The occupant class for airbag control is valid 17
  • 18. Errors.size() == 0 Status != null t > 0 && t < 50 Elicit Use Cases 1 Missing Entities Specify Constraints 5 THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND Model the Domain 2 Evaluate Consistency 3 Domain Model ERRORS ARE ABSENT TEMPERATURE IS LOW STATUS IS VALID Identify Constraints 4 Constraint descriptions 18 RUCM Use Cases Generate Scenarios and Inputs 6 Object Diagrams Test Scenarios OCL constraints
  • 19. 19 Basic Flow 1. The seat SENDS occupancy status TO the system. 2. INCLUDE USE CASE Classify occupancy status. 3. The system VALIDATES THAT the occupant class for airbag control is valid and the occupant class for seat belt reminder is valid. 4. The system SENDS the occupant class for airbag control TO AirbagControlUnit. 5. The system SENDS the occupant class for seat belt reminder TO SeatBeltControlUnit. 6. The System Waits for next execution cycle. Postcondition: The occupant class for airbag control and the occupant class for seat belt reminder have been sent. INPUT STEP INCLUDE STEP CONDITIONAL STEP OUTPUT STEP OUTPUT STEP INTERNAL STEP POSTCONDITION DOMAIN ENTITY CONSTRAINT CONSTRAINT DOMAIN ENTITY DOMAIN ENTITY
  • 20. INCLUDE STEP CONDITIONAL STEP OUTPUT STEP OUTPUT STEP INTERNAL STEP POSTCONDITION 20 Basic Flow 1. The seat SENDS occupancy status TO the system. 2. INCLUDE USE CASE Classify occupancy status. 3. The system VALIDATES THAT the occupant class for airbag control is valid and the occupant class for seat belt reminder is valid. 4. The system SENDS the occupant class for airbag control TO AirbagControlUnit. 5. The system SENDS the occupant class for seat belt reminder TO SeatBeltControlUnit. 6. The System Waits for next execution cycle. Postcondition: The occupant class for airbag control and the occupant class for seat belt reminder have been sent. UseCaseStart INPUT STEP DOMAIN ENTITY CONSTRAINT CONSTRAINT DOMAIN ENTITY DOMAIN ENTITY Precondition
  • 21. CONDITIONAL STEP OUTPUT STEP OUTPUT STEP INTERNAL STEP POSTCONDITION 21 Basic Flow 1. The seat SENDS occupancy status TO the system. 2. INCLUDE USE CASE Classify occupancy status. 3. The system VALIDATES THAT the occupant class for airbag control is valid and the occupant class for seat belt reminder is valid. 4. The system SENDS the occupant class for airbag control TO AirbagControlUnit. 5. The system SENDS the occupant class for seat belt reminder TO SeatBeltControlUnit. 6. The System Waits for next execution cycle. Postcondition: The occupant class for airbag control and the occupant class for seat belt reminder have been sent. UseCaseStart Input INCLUDE STEP DOMAIN ENTITY CONSTRAINT CONSTRAINT DOMAIN ENTITY DOMAIN ENTITY Precondition OccupancyStatus DomainEntity DOMAIN ENTITY
  • 22. 22 UseCaseStart Input Include Condition Output Exit Condition Exit Output Exit OccupancyStatus DomainEntity System.initialized = true OCL Constraint AirbagControlUnit.AllI… OCL Constraint … OCL Constraint … DomainEntity OCL Constraint OccupancyStatus.ClassForSeat <> Error AND OccupancyStatus.ClassForAirbag <> Error
  • 23. 23 UseCaseStart Input Include Condition Output Exit Condition Exit Output Exit System.initialized = true AND OccupancyStatus.ClassForSeat <> Error AND OccupancyStatus.ClassForAirbag <> Error Path condition: OCL Constraint OccupancyStatus.ClassForSeat <> Error AND OccupancyStatus.ClassForAirbag <> Error OccupancyStatus DomainEntity System.initialized = true OCL Constraint AirbagControlUnit.AllI… OCL Constraint OCL Path Condition: System.allInstances() -> forAll(b | b.initialized = true ) AND OccupancyStatus.allInstances() -> forAll(o| o.ClassForSeat <> Status:: Error) AND OccupancyStatus.allInstances() -> forAll(o| o.ClassForAirbag <> Status::Error)
  • 24. 24 System.initialized = true AND OccupancyStatus.ClassForSeat <> Error AND OccupancyStatus.ClassForAirbag <> Error Path condition: OCL Solver :System Initialized = true Version = 3 :OccupancyStatus ClassForSeat = Adult ClassForAirbag = Adult Input Values OccupancyStatus.ClassForAirbag = Adult OccupancyStatus.ClassForSeat = Adult System.initialized = true Object Diagram 1 System AirbagControl Sensor OccupantStatus - ClassForAirbag - ClassForSeat 1 1 1 1 1 1 1..* Domain Model:
  • 25. THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND ERRORS ARE ABSENT TEMPERATURE IS LOW STATUS IS VALID Identify Constraints 4 Constraint descriptions Errors.size() == 0 Status != null t > 0 && t < 50 Generate Scenarios and Inputs 6 Elicit Use Cases 1 Missing Entities Specify Constraints 5 OCL constraints Model the Domain 2 Evaluate Consistency 3 Domain Model RUCM Use Cases Generate Test Cases 7 Test Cases Object Diagrams Test Scenarios 25
  • 26. 26 UseCaseStart Input Include Condition Output Exit Test Case occupancyStatus.ClassForAirbag = Adult OccupancyStatus DomainEntity Scenario Under Test System.initialized = true <INPUT> <CHECK> <INPUT> AirbagControlUnit.AllInstances() -> forAll(a|a.status = a.bodySense.occupancyStatus) System.initialized = true OCL Constraint Input Values occupancyStatus.ClassForAirbag = Adult occupancyStatus.ClassForSeat = Adult System.initialized = true occupancyStatus.ClassForSeat = Adult AirbagControlUnit.AllI… OCL Constraint Abstract Test Case
  • 27. THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND ERRORS ARE ABSENT TEMPERATURE IS LOW STATUS IS VALID Identify Constraints 4 Constraint descriptions Errors.size() == 0 Status != null t > 0 && t < 50 Generate Scenarios and Inputs 6 Elicit Use Cases 1 Missing Entities Specify Constraints 5 OCL constraints Model the Domain 2 Evaluate Consistency 3 Domain Model RUCM Use Cases Generate Test Cases 7 Test Cases Object Diagrams Test Scenarios 27 Mapping Table
  • 28. Generation of Executable Test Cases 28 ResetPower (Time = INIT_TIME) SetBus (Chanel = RELAY_CLASS, Status = CLASS1) ReadAndCheckBus ( D0 = OCCUPIED, D1 = OCCUPIED) Abstract test steps Resulting Test Driver Functions Matching Patterns Function Name Parameters <INPUT> Classfor* = Adult SetBus <INPUT> System.initialized = true ResetPower <CHECK> AirBagControlUnit.allInstant… ReadAndCheckBus Chanel = RELAY_CLASS Status = CLASS1 Time = INIT_TIME Mapping Table: occupancyStatus.ClassForAirbag = Adult System.initialized = true <INPUT> <CHECK> <INPUT> AirbagControlUnit.AllInstances() -> forAll(a|a.status = a.bodySense.occupancyStatus) occupancyStatus.ClassForSeat = Adult Abstract Test Case: D0=OCCUPIED … Executable Test Case:
  • 29. THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND THE SYSTEM VALI THE SYSTEM DIS THE ACTOR SEND ERRORS ARE ABSENT TEMPERATURE IS LOW STATUS IS VALID Identify Constraints 4 Constraint descriptions Errors.size() == 0 Status != null t > 0 && t < 50 Generate Scenarios and Inputs 6 Elicit Use Cases 1 Missing Entities Specify Constraints 5 OCL constraints Model the Domain 2 Evaluate Consistency 3 Domain Model RUCM Use Cases Generate Test Cases 7 Test Cases Object Diagrams Test Scenarios 29 Mapping Table
  • 30. Case Study • BodySense, embedded system for detecting occupancy status in a car • Evaluation: • Cost of additional modelling • Effectiveness in terms of covered scenarios compared to current practice at IEE 30
  • 31. Complexity of the Case Study 31 Use Case Steps Use Case Flows UC1 50 8 UC2 44 13 UC3 35 8 UC4 59 11 UC5 30 8 UC6 25 6
  • 32. Costs of Additional Modeling 32 Use Case Steps Use Case Flows OCL Constraints UC1 50 8 9 UC2 44 13 7 UC3 35 8 8 UC4 59 11 12 UC5 30 8 5 UC6 25 6 12 5 to 10 minutes to write each constraints
  • 33. Effectiveness: scenarios covered 33 0 5 10 15 20 25 30 35 40 UC1 UC2 UC3 UC4 UC5 UC6 Scenarios Covered By Engineer Scenarios Covered By UMTG 100% 100% 100% 100% 100% 100% 81% 77% 100% 86% 50% 67% It is hard for engineers to capture all the possible scenarios involving error conditions.
  • 34. Problem • Requirements-driven test automation • Traceability between requirements and system test cases – This cannot be manual • E.g., automotive industry which must comply to ISO 26262 34 ERRORS ARE ABSENT TEMPERATURE IS LOW STATUS IS VALID Errors.size() == 0 Status = null > 0 && t < 50 Identify Constraints 4 Generate Scenarios and Inputs 6 Generate Test Cases 7 Evaluate Consistency 3 Elicit Use Cases 1 Model the Domain 2 Specify Constraints 5 Domain Model Missing Entities Constraint descriptions OCL constraints THE ACTOR SEND HE SYSTEM VALI HE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND HE SYSTEM VALI HE SYSTEM DIS THE ACTOR SEND THE ACTOR SEND HE SYSTEM VALI HE SYSTEM DIS THE ACTOR SEND RUCM Use Cases Test Cases Object Diagrams Test Scenarios0 5 10 15 20 25 30 35 40 UC1 UC2 UC3 UC4 UC5 UC6 Scenarios Covered By Engineer Scenarios Covered By UMTG 100% 100% 100% 100% 100% 100% 81% 77% 100% 86% 50% 67% Acceptable modelling effort Full scenario coverage
  • 35. 35 NLP Pipeline Tokenizer UMTG Gazetteer Part of Speech Tagger UMTG Transducers The seat SENDS occupancy status TO the system.
  • 36. 36 NLP Pipeline Tokenizer UMTG Gazetteer Part of Speech Tagger UMTG Transducers The seat SENDS occupancy status TO the system. ACTOR SEND NOUN PHRASE SYSTEMTO
  • 37. 37 NLP Pipeline Tokenizer UMTG Gazetteer Part of Speech Tagger UMTG Transducers The seat SENDS occupancy status TO the system. ACTOR SEND NOUN PHRASE SYSTEMTO ACTOR SEND TONOUN PHRSE SYSTEM INPUT STEP PATTERN