SlideShare a Scribd company logo
1 of 39
Automated Generation of Test
Cases for Software Verification:
Quality Assurance for Service-based
Applications
Dimitris Dranidis
International Faculty of the University of Sheffield
CITY College, Thessaloniki, Greece
December 2017
1
2
Dr Dimitris Dranidis
 Senior Lecturer in Computer Science Department
 Academic director of postgraduate programmes:
 MSc in Advanced Software Engineering
 MSc in Management of Business, Innovation and
Technology
 Coordinator of the "Software Engineering & Service-Oriented
Technologies" research group
 http://www.city.academic.gr/csd/dranidis/
Personal research interests
 Formal methods
 Stream X-machines
 Model-based testing
 Testing & Run-time
Monitoring
 Service-based applications
 Certification registry for
SBAs
 Educational Informatics
 StudentUML
 Peer assessment
 Development of JSXM
 www.jsxm.org
 Model-based testing tool
(SXM testing theory)
3
Outline
 A world of services
 Motivation for automated test generation
 Model Based Testing
 State-based MBT
 Stream X-machines
 Testing Method
 The JSXM testing tool
 Features
4
Service-based Applications
service
service
consumer
consumes
service
Organization
boundaries
service
service
5
Traditional Testing approaches
are not effective!
 An application developer can
Guarantee the correctness of internal modules
Unit testing
Integration testing
Fix internal errors
Have control over changes
 … but should rely on correctness of external modules:
Testing of external modules is not enough….
Due to uncontrolled change
6
Need for Model-based testing -
Fully Automated Test generation
 A certification registry should be able to perform the tests
that guarantee service correctness.
The tests should not be provided by the provider
Tests might be incomplete (trust?)
Tests might depend on the implementation
 INSTEAD:
The tests must be produced based on the service
specification
Automated generation of tests based on a model
Generation is triggered by the registry
7
Model-based testing
Model System
Under Test
Abstract
Test Cases
describes
generate
generate
Executable
Test Cases
execute
8
Application of
Model-Based Testing on
Service-based Applications
9
Service publication &
Service verification by automated testing
service
Certification Registry
Service
spec tests
Automated
generation
10
Service advertisement &
Service animation (Sandbox Validation)
service
Certification Registry
Service
spec tests
consumer
Execution
of the model
11
Service monitoring
(run-time verification)
service
Certification Registry
Service
spec tests
consumer
Execution
of the service
Execution
of the model
12
Model-Based Testing based on
SXM Testing Theory
13
Finite Automata
 A Finite Automaton consists of:
a set of states Q
a set of inputs Σ
an initial state q0
a set of final states T
a function F: Q x Σ -> Q called the transition (next-
state) function.
 Can be represented as state diagrams in which
transitions are labeled with inputs.
14
Problems with FA
 State explosion!
 Focus only on control flow
15
Stream X-Machines
 A Stream X-Machine (SXM) is like a FA
with the following differences:
The machine has memory
transitions are labeled with functions that
• operate on inputs and memory
• update the memory and
• produce outputs
16
SXM definition
 An SXM consists of:
a set of states Q
a set of inputs Σ
a set of outputs Γ
a set M called memory
an initial state q0
an initial memory m0
a set Φ of processing functions, where each φ in Φ:
• φ : Σ x M -> Γ x M
a function F: Q x Φ -> Q called the transition function.
17
Processing functions
 A processing function consists of:
A guard condition depending on the input and
the memory
An effect which
• changes the memory and
• produces an output
18
SXM Account
Open(b, open()) = (openOut, 0)
Deposit(b, deposit(a)) = (depositOut, b + a)
Withdraw(b, withdraw(a)) =(withdrawOut, b - a) if a<b
WithdrawAll(b, withdraw(a)) =(withdrawOut, 0) if a=b
Close(b, close()) = (closeOut, b)
19
Initial Memory
b = 0
20
SXM Testing
method
SXM Testing method:
Verification by testing
 A finite test set is produced
 based on a generalization of the W-method
 Execution of tests guarantees:
 Implementation conforms to the Model
21
Design-for-test conditions
 Taken from control theory
 Controllability
The ability to move a system in its state space
by admissible inputs
 Observability
The ability to determine the system state (or
behaviour) by using the inputs and the outputs
22
W-method (Chow)
 Applied on the associated finite automaton
A = (Φ, Q, F, q0)
 State cover S:
A set of sequences such that all states are reachable
from the initial state.
 Characterization set W:
a set of sequences for which any two distinct states of
the automaton are distinguishable.
23
W-method Test Set
 Test Set Yk of the associated automaton.
Yk = S.
Φk+1.
W
 A test set consists of sequences of processing functions
that are able to:
Reach every state by applying the state cover
sequences;
apply all tuples of functions of maximum length k+1;
and distinguish the resulting state by applying the
characterisation set sequences.
24
Discovered errors
 The SXM testing method can discover:
Missing states
Extra states
Missing transitions
Extra transitions
25
JSXM Model-based testing tool
http://www.jsxm.org
26
JSXM www.jsxm.org
 Model-based testing tool in Java
 Model as a Stream X-machine (SXM)
 Automated generation of test cases
 JSXM supports:
Model Animation (Model Validation)
Test Generation (Test Generation)
Test Transformation (Test execution)
27
Adapter
Adapter
JSXM overview
28
SXM Model
Java
application
Abstract
Test Cases
XML
generate transform
Junit
Test cases
PHPUnit
Test casestransform PHP
application
execute
execute
Animate
SXM Specification in XML:
Specification top structure
29
<SXM name="Account">
<states>
<initialState>
<transitions>
<memory>
<inputs>
<outputs>
<functions>
</SXM>
SXM Specification in XML:
States
30
<states>
<state name="initial" />
<state name="opened" />
<state name="closed" />
<state name="normal" />
</states>
<initialState state="initial" />
SXM Specification in XML:
Transitions labelled with functions
31
<transitions>
<transition from="initial" function="openF" to="opened" />
<transition from="opened" function="closeF" to="closed" />
<transition from="opened" function="depositF" to="normal" />
<transition from="normal" function="depositF" to="normal" />
<transition from="normal" function="withdrawN" to="normal" />
<transition from="normal" function="withdraw0" to="opened" />
</transitions>
SXM Specification in XML:
Inputs
32
<inputs>
<input name="open" />
<input name="close" />
<input name="deposit">
<arg name="amount" type=“xs:int" />
</input>
<input name="withdraw">
<arg name="amount" type=“xs:int" />
</input>
</inputs>
SXM Specification in XML:
Outputs
33
<outputs>
<output name="openOut" />
<output name="closeOut" />
<output name="depositOut">
<result name="amount" type=“xs:int" />
</output>
<output name="withdrawOut">
<result name="amount" type=“xs:int" />
</output>
</outputs>
SXM Specification in XML:
Memory (Java inline code)
34
<memory>
<declaration>
int balance;
</declaration>
<initial>
balance = 0;
</initial>
</memory>
SXM Specification in XML:
Functions (Java inline code)
35
<functions>
…
<function name="depositF" input="deposit“ ouput=“depositOut”>
<precondition>
deposit.get_amount > 0;
</precondition>
<effect>
balance = balance + deposit.get_amount;
depositOut.amount = deposit. get_amount;
</effect>
</function>
…
</functions>
JSXM Latest Features
 Constraint Logic Programming (CLP)
automates test values generation
 Complete GUI editor in Eclipse platform
Live editing of Diagram/XML specification
Validation of syntax
Quick fixes for frequent problems
36
JSXM Latest Features
 Automated generation of realizable State-Cover
Based on CLP integration
 Automated completion of the specification by
adding all necessary error self-transitions
Based on CLP integration
 Generation of Adapter classes for testing
37
Future research work
 Testing of Web applications
 Evaluation of JSXM in a large scale project
38
39
Thank you!
Questions?

More Related Content

Similar to Automated Test Generation

Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...Lionel Briand
 
Intro to LV in 3 Hours for Control and Sim 8_5.pptx
Intro to LV in 3 Hours for Control and Sim 8_5.pptxIntro to LV in 3 Hours for Control and Sim 8_5.pptx
Intro to LV in 3 Hours for Control and Sim 8_5.pptxDeepakJangid87
 
QA Fest 2019. Антон Молдован. Load testing which you always wanted
QA Fest 2019. Антон Молдован. Load testing which you always wantedQA Fest 2019. Антон Молдован. Load testing which you always wanted
QA Fest 2019. Антон Молдован. Load testing which you always wantedQAFest
 
Automated Testing of Autonomous Driving Assistance Systems
Automated Testing of Autonomous Driving Assistance SystemsAutomated Testing of Autonomous Driving Assistance Systems
Automated Testing of Autonomous Driving Assistance SystemsLionel Briand
 
Approaches to formal verification of ams design
Approaches to formal verification of ams designApproaches to formal verification of ams design
Approaches to formal verification of ams designAmbuj Mishra
 
How Manual Testers Can Break into Automation Without Programming Skills
How Manual Testers Can Break into Automation Without Programming SkillsHow Manual Testers Can Break into Automation Without Programming Skills
How Manual Testers Can Break into Automation Without Programming SkillsRanorex
 
Simulation with Python and MATLAB® in Capella
Simulation with Python and MATLAB® in CapellaSimulation with Python and MATLAB® in Capella
Simulation with Python and MATLAB® in CapellaObeo
 
Unit test candidate solutions
Unit test candidate solutionsUnit test candidate solutions
Unit test candidate solutionsbenewu
 
Automation Framework Presentation
Automation Framework PresentationAutomation Framework Presentation
Automation Framework PresentationBen Ngo
 
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...knowdiff
 
SB_MSC-Apex_Structures_LTR_pt
SB_MSC-Apex_Structures_LTR_ptSB_MSC-Apex_Structures_LTR_pt
SB_MSC-Apex_Structures_LTR_ptanandakumara MB
 
Test strategies for data processing pipelines, v2.0
Test strategies for data processing pipelines, v2.0Test strategies for data processing pipelines, v2.0
Test strategies for data processing pipelines, v2.0Lars Albertsson
 
GNAT Pro User Day: QGen: Simulink® static verification and code generation
GNAT Pro User Day: QGen: Simulink® static verification and code generationGNAT Pro User Day: QGen: Simulink® static verification and code generation
GNAT Pro User Day: QGen: Simulink® static verification and code generationAdaCore
 
Maximizing Efficiency Using Simulation
Maximizing Efficiency Using SimulationMaximizing Efficiency Using Simulation
Maximizing Efficiency Using Simulationjason_cov
 
Chrom works introduction
Chrom works   introductionChrom works   introduction
Chrom works introductionSoo Kim
 
Applying Product Line Use Case Modeling ! in an Industrial Automotive Embedde...
Applying Product Line Use Case Modeling ! in an Industrial Automotive Embedde...Applying Product Line Use Case Modeling ! in an Industrial Automotive Embedde...
Applying Product Line Use Case Modeling ! in an Industrial Automotive Embedde...Lionel Briand
 

Similar to Automated Test Generation (20)

Snow Leopard
Snow LeopardSnow Leopard
Snow Leopard
 
Java Micro-Benchmarking
Java Micro-BenchmarkingJava Micro-Benchmarking
Java Micro-Benchmarking
 
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
 
Intro to LV in 3 Hours for Control and Sim 8_5.pptx
Intro to LV in 3 Hours for Control and Sim 8_5.pptxIntro to LV in 3 Hours for Control and Sim 8_5.pptx
Intro to LV in 3 Hours for Control and Sim 8_5.pptx
 
QA Fest 2019. Антон Молдован. Load testing which you always wanted
QA Fest 2019. Антон Молдован. Load testing which you always wantedQA Fest 2019. Антон Молдован. Load testing which you always wanted
QA Fest 2019. Антон Молдован. Load testing which you always wanted
 
Automated Testing of Autonomous Driving Assistance Systems
Automated Testing of Autonomous Driving Assistance SystemsAutomated Testing of Autonomous Driving Assistance Systems
Automated Testing of Autonomous Driving Assistance Systems
 
Approaches to formal verification of ams design
Approaches to formal verification of ams designApproaches to formal verification of ams design
Approaches to formal verification of ams design
 
How Manual Testers Can Break into Automation Without Programming Skills
How Manual Testers Can Break into Automation Without Programming SkillsHow Manual Testers Can Break into Automation Without Programming Skills
How Manual Testers Can Break into Automation Without Programming Skills
 
Simulation with Python and MATLAB® in Capella
Simulation with Python and MATLAB® in CapellaSimulation with Python and MATLAB® in Capella
Simulation with Python and MATLAB® in Capella
 
STPA and Software Verification
STPA and Software VerificationSTPA and Software Verification
STPA and Software Verification
 
Unit test candidate solutions
Unit test candidate solutionsUnit test candidate solutions
Unit test candidate solutions
 
Automation Framework Presentation
Automation Framework PresentationAutomation Framework Presentation
Automation Framework Presentation
 
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...
 
SB_MSC-Apex_Structures_LTR_pt
SB_MSC-Apex_Structures_LTR_ptSB_MSC-Apex_Structures_LTR_pt
SB_MSC-Apex_Structures_LTR_pt
 
Test strategies for data processing pipelines, v2.0
Test strategies for data processing pipelines, v2.0Test strategies for data processing pipelines, v2.0
Test strategies for data processing pipelines, v2.0
 
GNAT Pro User Day: QGen: Simulink® static verification and code generation
GNAT Pro User Day: QGen: Simulink® static verification and code generationGNAT Pro User Day: QGen: Simulink® static verification and code generation
GNAT Pro User Day: QGen: Simulink® static verification and code generation
 
Maximizing Efficiency Using Simulation
Maximizing Efficiency Using SimulationMaximizing Efficiency Using Simulation
Maximizing Efficiency Using Simulation
 
Chrom works introduction
Chrom works   introductionChrom works   introduction
Chrom works introduction
 
QGen GNAT Industrial User Day
QGen GNAT Industrial User DayQGen GNAT Industrial User Day
QGen GNAT Industrial User Day
 
Applying Product Line Use Case Modeling ! in an Industrial Automotive Embedde...
Applying Product Line Use Case Modeling ! in an Industrial Automotive Embedde...Applying Product Line Use Case Modeling ! in an Industrial Automotive Embedde...
Applying Product Line Use Case Modeling ! in an Industrial Automotive Embedde...
 

More from Thessaloniki Software Testing and QA meetup (9)

A Journey Inside a React Native App No Pain No Gain
A Journey Inside a React Native App No Pain No GainA Journey Inside a React Native App No Pain No Gain
A Journey Inside a React Native App No Pain No Gain
 
MoT Athens meets Thessaloniki Software Testing & QA meetup
MoT Athens meets Thessaloniki Software Testing & QA meetupMoT Athens meets Thessaloniki Software Testing & QA meetup
MoT Athens meets Thessaloniki Software Testing & QA meetup
 
Kubernetes + Jenkins X: a Cloud Native Approach
Kubernetes + Jenkins X: a Cloud Native ApproachKubernetes + Jenkins X: a Cloud Native Approach
Kubernetes + Jenkins X: a Cloud Native Approach
 
Service Testing - Workshop Thessaloniki Meetup
Service Testing - Workshop Thessaloniki Meetup Service Testing - Workshop Thessaloniki Meetup
Service Testing - Workshop Thessaloniki Meetup
 
Service testing - Introduction to SoapUI & groovy
Service testing - Introduction to SoapUI & groovyService testing - Introduction to SoapUI & groovy
Service testing - Introduction to SoapUI & groovy
 
Selenium for java developers
Selenium for java developersSelenium for java developers
Selenium for java developers
 
It’s a world of bugs after all
It’s a world of bugs after allIt’s a world of bugs after all
It’s a world of bugs after all
 
GUI, Performance, Load and API testing with Test Studio
GUI, Performance, Load and API testing with Test StudioGUI, Performance, Load and API testing with Test Studio
GUI, Performance, Load and API testing with Test Studio
 
Test automation-framework
Test automation-frameworkTest automation-framework
Test automation-framework
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Recently uploaded (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

Automated Test Generation

  • 1. Automated Generation of Test Cases for Software Verification: Quality Assurance for Service-based Applications Dimitris Dranidis International Faculty of the University of Sheffield CITY College, Thessaloniki, Greece December 2017 1
  • 2. 2 Dr Dimitris Dranidis  Senior Lecturer in Computer Science Department  Academic director of postgraduate programmes:  MSc in Advanced Software Engineering  MSc in Management of Business, Innovation and Technology  Coordinator of the "Software Engineering & Service-Oriented Technologies" research group  http://www.city.academic.gr/csd/dranidis/
  • 3. Personal research interests  Formal methods  Stream X-machines  Model-based testing  Testing & Run-time Monitoring  Service-based applications  Certification registry for SBAs  Educational Informatics  StudentUML  Peer assessment  Development of JSXM  www.jsxm.org  Model-based testing tool (SXM testing theory) 3
  • 4. Outline  A world of services  Motivation for automated test generation  Model Based Testing  State-based MBT  Stream X-machines  Testing Method  The JSXM testing tool  Features 4
  • 6. Traditional Testing approaches are not effective!  An application developer can Guarantee the correctness of internal modules Unit testing Integration testing Fix internal errors Have control over changes  … but should rely on correctness of external modules: Testing of external modules is not enough…. Due to uncontrolled change 6
  • 7. Need for Model-based testing - Fully Automated Test generation  A certification registry should be able to perform the tests that guarantee service correctness. The tests should not be provided by the provider Tests might be incomplete (trust?) Tests might depend on the implementation  INSTEAD: The tests must be produced based on the service specification Automated generation of tests based on a model Generation is triggered by the registry 7
  • 8. Model-based testing Model System Under Test Abstract Test Cases describes generate generate Executable Test Cases execute 8
  • 9. Application of Model-Based Testing on Service-based Applications 9
  • 10. Service publication & Service verification by automated testing service Certification Registry Service spec tests Automated generation 10
  • 11. Service advertisement & Service animation (Sandbox Validation) service Certification Registry Service spec tests consumer Execution of the model 11
  • 12. Service monitoring (run-time verification) service Certification Registry Service spec tests consumer Execution of the service Execution of the model 12
  • 13. Model-Based Testing based on SXM Testing Theory 13
  • 14. Finite Automata  A Finite Automaton consists of: a set of states Q a set of inputs Σ an initial state q0 a set of final states T a function F: Q x Σ -> Q called the transition (next- state) function.  Can be represented as state diagrams in which transitions are labeled with inputs. 14
  • 15. Problems with FA  State explosion!  Focus only on control flow 15
  • 16. Stream X-Machines  A Stream X-Machine (SXM) is like a FA with the following differences: The machine has memory transitions are labeled with functions that • operate on inputs and memory • update the memory and • produce outputs 16
  • 17. SXM definition  An SXM consists of: a set of states Q a set of inputs Σ a set of outputs Γ a set M called memory an initial state q0 an initial memory m0 a set Φ of processing functions, where each φ in Φ: • φ : Σ x M -> Γ x M a function F: Q x Φ -> Q called the transition function. 17
  • 18. Processing functions  A processing function consists of: A guard condition depending on the input and the memory An effect which • changes the memory and • produces an output 18
  • 19. SXM Account Open(b, open()) = (openOut, 0) Deposit(b, deposit(a)) = (depositOut, b + a) Withdraw(b, withdraw(a)) =(withdrawOut, b - a) if a<b WithdrawAll(b, withdraw(a)) =(withdrawOut, 0) if a=b Close(b, close()) = (closeOut, b) 19 Initial Memory b = 0
  • 21. SXM Testing method: Verification by testing  A finite test set is produced  based on a generalization of the W-method  Execution of tests guarantees:  Implementation conforms to the Model 21
  • 22. Design-for-test conditions  Taken from control theory  Controllability The ability to move a system in its state space by admissible inputs  Observability The ability to determine the system state (or behaviour) by using the inputs and the outputs 22
  • 23. W-method (Chow)  Applied on the associated finite automaton A = (Φ, Q, F, q0)  State cover S: A set of sequences such that all states are reachable from the initial state.  Characterization set W: a set of sequences for which any two distinct states of the automaton are distinguishable. 23
  • 24. W-method Test Set  Test Set Yk of the associated automaton. Yk = S. Φk+1. W  A test set consists of sequences of processing functions that are able to: Reach every state by applying the state cover sequences; apply all tuples of functions of maximum length k+1; and distinguish the resulting state by applying the characterisation set sequences. 24
  • 25. Discovered errors  The SXM testing method can discover: Missing states Extra states Missing transitions Extra transitions 25
  • 26. JSXM Model-based testing tool http://www.jsxm.org 26
  • 27. JSXM www.jsxm.org  Model-based testing tool in Java  Model as a Stream X-machine (SXM)  Automated generation of test cases  JSXM supports: Model Animation (Model Validation) Test Generation (Test Generation) Test Transformation (Test execution) 27
  • 28. Adapter Adapter JSXM overview 28 SXM Model Java application Abstract Test Cases XML generate transform Junit Test cases PHPUnit Test casestransform PHP application execute execute Animate
  • 29. SXM Specification in XML: Specification top structure 29 <SXM name="Account"> <states> <initialState> <transitions> <memory> <inputs> <outputs> <functions> </SXM>
  • 30. SXM Specification in XML: States 30 <states> <state name="initial" /> <state name="opened" /> <state name="closed" /> <state name="normal" /> </states> <initialState state="initial" />
  • 31. SXM Specification in XML: Transitions labelled with functions 31 <transitions> <transition from="initial" function="openF" to="opened" /> <transition from="opened" function="closeF" to="closed" /> <transition from="opened" function="depositF" to="normal" /> <transition from="normal" function="depositF" to="normal" /> <transition from="normal" function="withdrawN" to="normal" /> <transition from="normal" function="withdraw0" to="opened" /> </transitions>
  • 32. SXM Specification in XML: Inputs 32 <inputs> <input name="open" /> <input name="close" /> <input name="deposit"> <arg name="amount" type=“xs:int" /> </input> <input name="withdraw"> <arg name="amount" type=“xs:int" /> </input> </inputs>
  • 33. SXM Specification in XML: Outputs 33 <outputs> <output name="openOut" /> <output name="closeOut" /> <output name="depositOut"> <result name="amount" type=“xs:int" /> </output> <output name="withdrawOut"> <result name="amount" type=“xs:int" /> </output> </outputs>
  • 34. SXM Specification in XML: Memory (Java inline code) 34 <memory> <declaration> int balance; </declaration> <initial> balance = 0; </initial> </memory>
  • 35. SXM Specification in XML: Functions (Java inline code) 35 <functions> … <function name="depositF" input="deposit“ ouput=“depositOut”> <precondition> deposit.get_amount > 0; </precondition> <effect> balance = balance + deposit.get_amount; depositOut.amount = deposit. get_amount; </effect> </function> … </functions>
  • 36. JSXM Latest Features  Constraint Logic Programming (CLP) automates test values generation  Complete GUI editor in Eclipse platform Live editing of Diagram/XML specification Validation of syntax Quick fixes for frequent problems 36
  • 37. JSXM Latest Features  Automated generation of realizable State-Cover Based on CLP integration  Automated completion of the specification by adding all necessary error self-transitions Based on CLP integration  Generation of Adapter classes for testing 37
  • 38. Future research work  Testing of Web applications  Evaluation of JSXM in a large scale project 38