SlideShare a Scribd company logo
1 of 17
Download to read offline
Model-based Testing using Microsoft’s
Spec Explorer Tool: A Case Study

Dharmalingam Ganesan

© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

1
Spec Explorer - Background
Tester develops a model (a.k.a. model program)
Model program is a simplified version of the SUT
Spec Explorer generates state machines from models
Test cases are automatically derived from state machines
SUT’s behavior is automatically compared with model
Tests failure: Deviation between model and SUT
Tests success: model and SUT are consistent

Supports offline and on-the-fly testing
Offline: Tests are generated and executed against the SUT
On-the-fly: Test generation and execution are interleaved
© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

2
Why we used Spec Explorer?
Testing of asynchronous systems (e.g. software bus)
Components communicate indirectly using the pub-sub style

Non-deterministic behaviors
E.g.: Messages received in different orders than published

Support for parameterization
Instantiating the model for multiple connections to the bus
Automatic generation of parameter values and combinations

Support for configurability
Ability to slice models into smaller models using operators
Test cases can be short tests or long tests

© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

3
SUT: NASA’s GMSEC API
Message bus for component communication
Standardized API based on the pub-sub style

Supports middleware technologies
Users can configure the middleware of interests
API users are agnostic to middleware vendors’ APIs

Supports multiple programming languages
For example: C, C++, Java, .NET, and Perl
Same concept but different syntax at the API level

Testing question: Can we generate test cases using one
model to test all languages and middleware?
© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

4
Developing the model programs
Spec Explorer runs as a plug-in to MS Visual Studio
Model programs are written in C# like syntax
Models are based on the API documentation of GMSEC
Sometimes existing test cases were referred
Developers opinion were taken into consideration

Spec Explorer analyses our models
Generates state machines
Checks whether model satisfies invariants

A selected subset of features were modeled incrementally
Test cases were generated and executed in each increment
© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

5
SUT Adapter
Adapter wraps the SUT
Converts data/commands from the model into SUT’s
syntax
Adapter simplifies modeling complexity
Methods of the model should map to the adapter
Our adapter is in C#
We also “print” test code from our adapter for different
languages such C, C++, and Java

© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

6
Fragments of model programs
[Rule]
public static void Create([Domain("ConnIdDomain")] int connId)
{
Condition.IsTrue(CanCreate(connId));
Guards enable the rules if
InitConn(connId);
the condition is satisfied.
}
[Rule]
public static void Connect([Domain("ConnIdDomain")]int connId)
{
Condition.IsTrue(CanConnect(connId));
ConnectionData connData = connections[connId];
connData.connected = true;
SetConnState(connId, connData);
}
[Rule]
public static void Disconnect([Domain("ConnIdDomain")]int connId)
{
Condition.IsTrue(CanDisconnect(connId)); CleanupDisconn(connId);
}
© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

7
[Rule] methods – Key ideas
Rule methods usually update one or more state variables
State variables are members of our model classes
Rule methods do not call one another
Rule methods get called automatically based on guards
Parameters are configurable
Parameters can be generated using domain generators

© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

8
Invariants for Model V&V- Samples
// if a connection is created it can always be destroyed
[StateInvariant]
public static bool CreateDestroy()
{
bool property = !connections.Exists(c => !IsWaitingMode() &&
!CanDestroy(c.Key));
return property;
}
// if a connection is connected it cannot connect again
[StateInvariant]
public static bool ConnNoDuplicate()
{
bool property = !connections.Exists(c => c.Value.connected &&
CanConnect(c.Key));
return property;
}
© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

9
Slicing the model - sample
// Create and Destroy connections
machine CreateDestroyScenario() : Main
{
Create* ||| Destroy*
}
machine CreateDestroyProgram() : Main
{
CreateDestroyScenario || DefaultModelProgram
}
machine CreateDestroyTestSuite() : Main where TestEnabled = true
{
construct test cases where strategy = "shorttests" for
CreateDestroyProgram()
}
© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

10
Composition of slices - sample
// Connect and Disconnect scenario
machine ConnectDisconnectScenario() : Main where forExploration = false
{
CreateDestroyScenario ||| (Connect* ||| Disconnect*)
}
machine ConnMgmtProgram() : Main where Group = "Connect, Disconnect"
{
(ConnectDisconnectScenario || DefaultModelProgram)
}
machine ConnMgmtTestSuite() : Main where TestEnabled = true, Group = "Test"
{
construct test cases where strategy = "shorttests" for ConnMgmtProgram()
}

© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

11
Generated state machine - sample

© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

12
Generated test sequences - sample

© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

13
Advantages of using Spec Explorer
Generated tests are pretty readable
This is due to the ability to slice models into smaller models

Data parameters are well handled
E.g., Model can be configured to test multiple connections

Non-determinism is not a problem
Tests do not fail because messages arrived in different orders

Models are programs
Ideal for programmers (who prefer coding than drawing)
But we can visualize the generated (small) state machines

Models can be formally verified
Invariants encoded in the model help to validate the model
© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

14
Challenges with Spec Explorer
Modeling errors can lead to infinite state machine
Need to be careful with unbounded types (e.g., int parameters)

Syntax for slicing the model is powerful but not that easy
Easy to misuse some of (algebraic) operators for slicing

Completeness of our slices
Did we miss any combination of behaviors during slicing?

Model debugging. For example:
Why a new state was generated?
Where/Why the invariants are violated?

Managing the model’s abstraction level
Which aspects of the SUT can be moved to the adapter
Which aspects of the SUT can be left out in the testing, etc.
© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

15
Benefits to SUT
Numerous specification issues during modeling time
Models and generated state machines can be used a spec.

New test failures on a tested system
Often issues with the SUT
In some cases, issues with the model program and/or adapters
Most issues were corner-cases

Innumerable number of test cases from the model
Test cases are agnostic to a particular programming language
Same tests for all supported languages and middleware

© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

16
Questions
Dharma Ganesan (dganesan@fc-md.umd.edu)

© 2014 Fraunhofer USA, Inc.
Center for Experimental Software Engineering

17

More Related Content

What's hot

imp plc-presentation-140205031532-phpapp02
imp plc-presentation-140205031532-phpapp02imp plc-presentation-140205031532-phpapp02
imp plc-presentation-140205031532-phpapp02
Haji Hussain
 
Mi 3155 eurotest_xd_short_spa guia rapida
Mi 3155 eurotest_xd_short_spa guia rapidaMi 3155 eurotest_xd_short_spa guia rapida
Mi 3155 eurotest_xd_short_spa guia rapida
Eric Rojas
 
Programming logic controllers (plc)
Programming  logic controllers (plc)Programming  logic controllers (plc)
Programming logic controllers (plc)
Sudhir Reddy
 
Tài liệu biến tần Siemens Sinamic V20 - Hướng dẫn sử dụng bằng Tiếng Việt
Tài liệu biến tần Siemens Sinamic V20 - Hướng dẫn sử dụng bằng Tiếng ViệtTài liệu biến tần Siemens Sinamic V20 - Hướng dẫn sử dụng bằng Tiếng Việt
Tài liệu biến tần Siemens Sinamic V20 - Hướng dẫn sử dụng bằng Tiếng Việt
Công ty công nghệ tự động hóa Hoàng Gia
 
Plc 8 raja presentation plc
Plc 8  raja presentation  plcPlc 8  raja presentation  plc
Plc 8 raja presentation plc
Rameez Raja
 

What's hot (20)

Introduction to plc (s7)­
Introduction to  plc (s7)­ Introduction to  plc (s7)­
Introduction to plc (s7)­
 
mạng truyền thông công nghiệp
mạng truyền thông công nghiệpmạng truyền thông công nghiệp
mạng truyền thông công nghiệp
 
Lập trình PLC S7 1200 tiếng Việt-Chuong 4 khái niệm lập trình
Lập trình PLC S7 1200 tiếng Việt-Chuong 4 khái niệm lập trìnhLập trình PLC S7 1200 tiếng Việt-Chuong 4 khái niệm lập trình
Lập trình PLC S7 1200 tiếng Việt-Chuong 4 khái niệm lập trình
 
trabajar siemens
trabajar siemenstrabajar siemens
trabajar siemens
 
imp plc-presentation-140205031532-phpapp02
imp plc-presentation-140205031532-phpapp02imp plc-presentation-140205031532-phpapp02
imp plc-presentation-140205031532-phpapp02
 
Levels of Automation
Levels of AutomationLevels of Automation
Levels of Automation
 
PLC and SCADA in Industrial Automation
PLC and SCADA in Industrial AutomationPLC and SCADA in Industrial Automation
PLC and SCADA in Industrial Automation
 
Industrial automation
Industrial automationIndustrial automation
Industrial automation
 
SIMATIC S7-1200 Overview
SIMATIC S7-1200 OverviewSIMATIC S7-1200 Overview
SIMATIC S7-1200 Overview
 
Mi 3155 eurotest_xd_short_spa guia rapida
Mi 3155 eurotest_xd_short_spa guia rapidaMi 3155 eurotest_xd_short_spa guia rapida
Mi 3155 eurotest_xd_short_spa guia rapida
 
Dieu chinh dien ap
Dieu chinh dien ap Dieu chinh dien ap
Dieu chinh dien ap
 
Programming logic controllers (plc)
Programming  logic controllers (plc)Programming  logic controllers (plc)
Programming logic controllers (plc)
 
Hệ truyền động đc một chiều và mạch buck
Hệ truyền động đc một chiều và mạch buckHệ truyền động đc một chiều và mạch buck
Hệ truyền động đc một chiều và mạch buck
 
Hướng dẫn cài đặt biến tần Inovance MD290
Hướng dẫn cài đặt biến tần Inovance MD290Hướng dẫn cài đặt biến tần Inovance MD290
Hướng dẫn cài đặt biến tần Inovance MD290
 
Basic plc
Basic plcBasic plc
Basic plc
 
Tài liệu biến tần Siemens Sinamic V20 - Hướng dẫn sử dụng bằng Tiếng Việt
Tài liệu biến tần Siemens Sinamic V20 - Hướng dẫn sử dụng bằng Tiếng ViệtTài liệu biến tần Siemens Sinamic V20 - Hướng dẫn sử dụng bằng Tiếng Việt
Tài liệu biến tần Siemens Sinamic V20 - Hướng dẫn sử dụng bằng Tiếng Việt
 
Catalogue mitsubishi thiet bi dien acb
Catalogue mitsubishi thiet bi dien acbCatalogue mitsubishi thiet bi dien acb
Catalogue mitsubishi thiet bi dien acb
 
Plc 8 raja presentation plc
Plc 8  raja presentation  plcPlc 8  raja presentation  plc
Plc 8 raja presentation plc
 
Introduction Industrial automation
Introduction Industrial automationIntroduction Industrial automation
Introduction Industrial automation
 
Thiết kế hệ thống giám sát và điều khiển thiết bị công nghiệp, HAY
Thiết kế hệ thống giám sát và điều khiển thiết bị công nghiệp, HAYThiết kế hệ thống giám sát và điều khiển thiết bị công nghiệp, HAY
Thiết kế hệ thống giám sát và điều khiển thiết bị công nghiệp, HAY
 

Viewers also liked

Verifying Architectural Design Rules of a Flight Software Product Line
Verifying Architectural Design Rules of a Flight Software Product LineVerifying Architectural Design Rules of a Flight Software Product Line
Verifying Architectural Design Rules of a Flight Software Product Line
Dharmalingam Ganesan
 
Interface-Implementation Contract Checking
Interface-Implementation Contract CheckingInterface-Implementation Contract Checking
Interface-Implementation Contract Checking
Dharmalingam Ganesan
 
Reverse Engineering of Software Architecture
Reverse Engineering of Software ArchitectureReverse Engineering of Software Architecture
Reverse Engineering of Software Architecture
Dharmalingam Ganesan
 
Software Testing Foundations Part 6 - Intuitive and Experience-based testing
Software Testing Foundations Part 6 - Intuitive and Experience-based testingSoftware Testing Foundations Part 6 - Intuitive and Experience-based testing
Software Testing Foundations Part 6 - Intuitive and Experience-based testing
Nikita Knysh
 
Reverse Architecting of a Medical Device Software
Reverse Architecting of a Medical Device SoftwareReverse Architecting of a Medical Device Software
Reverse Architecting of a Medical Device Software
Dharmalingam Ganesan
 
Ivv workshop model-based-testing-of-nasa-systems
Ivv workshop model-based-testing-of-nasa-systemsIvv workshop model-based-testing-of-nasa-systems
Ivv workshop model-based-testing-of-nasa-systems
Dharmalingam Ganesan
 
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in IndustryAssessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
Dharmalingam Ganesan
 
Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2
Dharmalingam Ganesan
 
Architecture Analysis of Systems based on Publish-Subscribe Systems
Architecture Analysis of Systems based on Publish-Subscribe SystemsArchitecture Analysis of Systems based on Publish-Subscribe Systems
Architecture Analysis of Systems based on Publish-Subscribe Systems
Dharmalingam Ganesan
 
Automated Testing of NASA Software
Automated Testing of NASA SoftwareAutomated Testing of NASA Software
Automated Testing of NASA Software
Dharmalingam Ganesan
 

Viewers also liked (20)

Model-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing of a Software Bus - Applied on Core Flight ExecutiveModel-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing of a Software Bus - Applied on Core Flight Executive
 
Load-time Hacking using LD_PRELOAD
Load-time Hacking using LD_PRELOADLoad-time Hacking using LD_PRELOAD
Load-time Hacking using LD_PRELOAD
 
Linux binary analysis and exploitation
Linux binary analysis and exploitationLinux binary analysis and exploitation
Linux binary analysis and exploitation
 
Automated Test Case Generation and Execution from Models
Automated Test Case Generation and Execution from ModelsAutomated Test Case Generation and Execution from Models
Automated Test Case Generation and Execution from Models
 
Verifying Architectural Design Rules of a Flight Software Product Line
Verifying Architectural Design Rules of a Flight Software Product LineVerifying Architectural Design Rules of a Flight Software Product Line
Verifying Architectural Design Rules of a Flight Software Product Line
 
Interface-Implementation Contract Checking
Interface-Implementation Contract CheckingInterface-Implementation Contract Checking
Interface-Implementation Contract Checking
 
Testing of C software components using Models
Testing of C software components using ModelsTesting of C software components using Models
Testing of C software components using Models
 
Exploiting Cryptographic Misuse - An Example
Exploiting Cryptographic Misuse - An ExampleExploiting Cryptographic Misuse - An Example
Exploiting Cryptographic Misuse - An Example
 
Reverse Engineering of Software Architecture
Reverse Engineering of Software ArchitectureReverse Engineering of Software Architecture
Reverse Engineering of Software Architecture
 
Threat Modeling: Applied on a Publish-Subscribe Architectural Style
Threat Modeling: Applied on a Publish-Subscribe Architectural StyleThreat Modeling: Applied on a Publish-Subscribe Architectural Style
Threat Modeling: Applied on a Publish-Subscribe Architectural Style
 
Test automation is dead CoDe Copenhagen 2016
Test automation is dead   CoDe Copenhagen 2016Test automation is dead   CoDe Copenhagen 2016
Test automation is dead CoDe Copenhagen 2016
 
Software Testing Foundations Part 6 - Intuitive and Experience-based testing
Software Testing Foundations Part 6 - Intuitive and Experience-based testingSoftware Testing Foundations Part 6 - Intuitive and Experience-based testing
Software Testing Foundations Part 6 - Intuitive and Experience-based testing
 
Reverse Architecting of a Medical Device Software
Reverse Architecting of a Medical Device SoftwareReverse Architecting of a Medical Device Software
Reverse Architecting of a Medical Device Software
 
Ivv workshop model-based-testing-of-nasa-systems
Ivv workshop model-based-testing-of-nasa-systemsIvv workshop model-based-testing-of-nasa-systems
Ivv workshop model-based-testing-of-nasa-systems
 
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in IndustryAssessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
 
Secure application programming in the presence of side channel attacks
Secure application programming in the presence of side channel attacksSecure application programming in the presence of side channel attacks
Secure application programming in the presence of side channel attacks
 
Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2
 
Explaining my Phd Thesis to layman
Explaining my Phd Thesis to laymanExplaining my Phd Thesis to layman
Explaining my Phd Thesis to layman
 
Architecture Analysis of Systems based on Publish-Subscribe Systems
Architecture Analysis of Systems based on Publish-Subscribe SystemsArchitecture Analysis of Systems based on Publish-Subscribe Systems
Architecture Analysis of Systems based on Publish-Subscribe Systems
 
Automated Testing of NASA Software
Automated Testing of NASA SoftwareAutomated Testing of NASA Software
Automated Testing of NASA Software
 

Similar to Model-based Testing using Microsoft’s Spec Explorer Tool: A Case Study

Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
Quontra Solutions
 
UIAutomation_Testing
UIAutomation_TestingUIAutomation_Testing
UIAutomation_Testing
Krunal Soni
 
Unit Testing Fundamentals
Unit Testing FundamentalsUnit Testing Fundamentals
Unit Testing Fundamentals
Richard Paul
 
MBT_Installers_Dev_Env
MBT_Installers_Dev_EnvMBT_Installers_Dev_Env
MBT_Installers_Dev_Env
Chris Struble
 

Similar to Model-based Testing using Microsoft’s Spec Explorer Tool: A Case Study (20)

Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)
 
Valsatech selenium octopus framework-whitepages
Valsatech selenium octopus framework-whitepagesValsatech selenium octopus framework-whitepages
Valsatech selenium octopus framework-whitepages
 
12 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 200912 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 2009
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 
Beyond Static Analysis: Integrating .NET Static Analysis with Unit Testing a...
Beyond Static Analysis: Integrating .NET  Static Analysis with Unit Testing a...Beyond Static Analysis: Integrating .NET  Static Analysis with Unit Testing a...
Beyond Static Analysis: Integrating .NET Static Analysis with Unit Testing a...
 
TDD Workshop UTN 2012
TDD Workshop UTN 2012TDD Workshop UTN 2012
TDD Workshop UTN 2012
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
 
UIAutomation_Testing
UIAutomation_TestingUIAutomation_Testing
UIAutomation_Testing
 
Model level debugging and profiling, Code Generation Conference 2014
Model level debugging and profiling, Code Generation Conference 2014Model level debugging and profiling, Code Generation Conference 2014
Model level debugging and profiling, Code Generation Conference 2014
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Mule testing
Mule testingMule testing
Mule testing
 
50120140502017
5012014050201750120140502017
50120140502017
 
Automating The Process For Building Reliable Software
Automating The Process For Building Reliable SoftwareAutomating The Process For Building Reliable Software
Automating The Process For Building Reliable Software
 
Unit Testing Fundamentals
Unit Testing FundamentalsUnit Testing Fundamentals
Unit Testing Fundamentals
 
Requirements driven Model-based Testing
Requirements driven Model-based TestingRequirements driven Model-based Testing
Requirements driven Model-based Testing
 
Presentation Of Mbt Tools
Presentation Of Mbt ToolsPresentation Of Mbt Tools
Presentation Of Mbt Tools
 
Automation Best Practices.pptx
Automation Best Practices.pptxAutomation Best Practices.pptx
Automation Best Practices.pptx
 
MBT_Installers_Dev_Env
MBT_Installers_Dev_EnvMBT_Installers_Dev_Env
MBT_Installers_Dev_Env
 
Stopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under TestStopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under Test
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 

More from Dharmalingam Ganesan

More from Dharmalingam Ganesan (20)

.NET Deserialization Attacks
.NET Deserialization Attacks.NET Deserialization Attacks
.NET Deserialization Attacks
 
Reverse Architecting using Relation Algebra.pdf
Reverse Architecting using Relation Algebra.pdfReverse Architecting using Relation Algebra.pdf
Reverse Architecting using Relation Algebra.pdf
 
How to exploit rand()?
How to exploit rand()?How to exploit rand()?
How to exploit rand()?
 
Cyclic Attacks on the RSA Trapdoor Function
Cyclic Attacks on the RSA Trapdoor FunctionCyclic Attacks on the RSA Trapdoor Function
Cyclic Attacks on the RSA Trapdoor Function
 
An Analysis of RSA Public Exponent e
An Analysis of RSA Public Exponent eAn Analysis of RSA Public Exponent e
An Analysis of RSA Public Exponent e
 
An Analysis of Secure Remote Password (SRP)
An Analysis of Secure Remote Password (SRP)An Analysis of Secure Remote Password (SRP)
An Analysis of Secure Remote Password (SRP)
 
Thank-a-Gram
Thank-a-GramThank-a-Gram
Thank-a-Gram
 
Active Attacks on DH Key Exchange
Active Attacks on DH Key ExchangeActive Attacks on DH Key Exchange
Active Attacks on DH Key Exchange
 
Can I write to a read only file ?
Can I write to a read only file ?Can I write to a read only file ?
Can I write to a read only file ?
 
How do computers exchange secrets using Math?
How do computers exchange secrets using Math?How do computers exchange secrets using Math?
How do computers exchange secrets using Math?
 
On the Secrecy of RSA Private Keys
On the Secrecy of RSA Private KeysOn the Secrecy of RSA Private Keys
On the Secrecy of RSA Private Keys
 
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
Computing the Square Roots of Unity to break RSA using Quantum AlgorithmsComputing the Square Roots of Unity to break RSA using Quantum Algorithms
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
 
Analysis of Short RSA Secret Exponent d
Analysis of Short RSA Secret Exponent dAnalysis of Short RSA Secret Exponent d
Analysis of Short RSA Secret Exponent d
 
Dependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private VariablesDependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private Variables
 
Analysis of Shared RSA Modulus
Analysis of Shared RSA ModulusAnalysis of Shared RSA Modulus
Analysis of Shared RSA Modulus
 
RSA Game using an Oracle
RSA Game using an OracleRSA Game using an Oracle
RSA Game using an Oracle
 
RSA Two Person Game
RSA Two Person GameRSA Two Person Game
RSA Two Person Game
 
RSA without Integrity Checks
RSA without Integrity ChecksRSA without Integrity Checks
RSA without Integrity Checks
 
RSA without Padding
RSA without PaddingRSA without Padding
RSA without Padding
 
Solutions to online rsa factoring challenges
Solutions to online rsa factoring challengesSolutions to online rsa factoring challenges
Solutions to online rsa factoring challenges
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Model-based Testing using Microsoft’s Spec Explorer Tool: A Case Study

  • 1. Model-based Testing using Microsoft’s Spec Explorer Tool: A Case Study Dharmalingam Ganesan © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 1
  • 2. Spec Explorer - Background Tester develops a model (a.k.a. model program) Model program is a simplified version of the SUT Spec Explorer generates state machines from models Test cases are automatically derived from state machines SUT’s behavior is automatically compared with model Tests failure: Deviation between model and SUT Tests success: model and SUT are consistent Supports offline and on-the-fly testing Offline: Tests are generated and executed against the SUT On-the-fly: Test generation and execution are interleaved © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 2
  • 3. Why we used Spec Explorer? Testing of asynchronous systems (e.g. software bus) Components communicate indirectly using the pub-sub style Non-deterministic behaviors E.g.: Messages received in different orders than published Support for parameterization Instantiating the model for multiple connections to the bus Automatic generation of parameter values and combinations Support for configurability Ability to slice models into smaller models using operators Test cases can be short tests or long tests © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 3
  • 4. SUT: NASA’s GMSEC API Message bus for component communication Standardized API based on the pub-sub style Supports middleware technologies Users can configure the middleware of interests API users are agnostic to middleware vendors’ APIs Supports multiple programming languages For example: C, C++, Java, .NET, and Perl Same concept but different syntax at the API level Testing question: Can we generate test cases using one model to test all languages and middleware? © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 4
  • 5. Developing the model programs Spec Explorer runs as a plug-in to MS Visual Studio Model programs are written in C# like syntax Models are based on the API documentation of GMSEC Sometimes existing test cases were referred Developers opinion were taken into consideration Spec Explorer analyses our models Generates state machines Checks whether model satisfies invariants A selected subset of features were modeled incrementally Test cases were generated and executed in each increment © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 5
  • 6. SUT Adapter Adapter wraps the SUT Converts data/commands from the model into SUT’s syntax Adapter simplifies modeling complexity Methods of the model should map to the adapter Our adapter is in C# We also “print” test code from our adapter for different languages such C, C++, and Java © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 6
  • 7. Fragments of model programs [Rule] public static void Create([Domain("ConnIdDomain")] int connId) { Condition.IsTrue(CanCreate(connId)); Guards enable the rules if InitConn(connId); the condition is satisfied. } [Rule] public static void Connect([Domain("ConnIdDomain")]int connId) { Condition.IsTrue(CanConnect(connId)); ConnectionData connData = connections[connId]; connData.connected = true; SetConnState(connId, connData); } [Rule] public static void Disconnect([Domain("ConnIdDomain")]int connId) { Condition.IsTrue(CanDisconnect(connId)); CleanupDisconn(connId); } © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 7
  • 8. [Rule] methods – Key ideas Rule methods usually update one or more state variables State variables are members of our model classes Rule methods do not call one another Rule methods get called automatically based on guards Parameters are configurable Parameters can be generated using domain generators © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 8
  • 9. Invariants for Model V&V- Samples // if a connection is created it can always be destroyed [StateInvariant] public static bool CreateDestroy() { bool property = !connections.Exists(c => !IsWaitingMode() && !CanDestroy(c.Key)); return property; } // if a connection is connected it cannot connect again [StateInvariant] public static bool ConnNoDuplicate() { bool property = !connections.Exists(c => c.Value.connected && CanConnect(c.Key)); return property; } © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 9
  • 10. Slicing the model - sample // Create and Destroy connections machine CreateDestroyScenario() : Main { Create* ||| Destroy* } machine CreateDestroyProgram() : Main { CreateDestroyScenario || DefaultModelProgram } machine CreateDestroyTestSuite() : Main where TestEnabled = true { construct test cases where strategy = "shorttests" for CreateDestroyProgram() } © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 10
  • 11. Composition of slices - sample // Connect and Disconnect scenario machine ConnectDisconnectScenario() : Main where forExploration = false { CreateDestroyScenario ||| (Connect* ||| Disconnect*) } machine ConnMgmtProgram() : Main where Group = "Connect, Disconnect" { (ConnectDisconnectScenario || DefaultModelProgram) } machine ConnMgmtTestSuite() : Main where TestEnabled = true, Group = "Test" { construct test cases where strategy = "shorttests" for ConnMgmtProgram() } © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 11
  • 12. Generated state machine - sample © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 12
  • 13. Generated test sequences - sample © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 13
  • 14. Advantages of using Spec Explorer Generated tests are pretty readable This is due to the ability to slice models into smaller models Data parameters are well handled E.g., Model can be configured to test multiple connections Non-determinism is not a problem Tests do not fail because messages arrived in different orders Models are programs Ideal for programmers (who prefer coding than drawing) But we can visualize the generated (small) state machines Models can be formally verified Invariants encoded in the model help to validate the model © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 14
  • 15. Challenges with Spec Explorer Modeling errors can lead to infinite state machine Need to be careful with unbounded types (e.g., int parameters) Syntax for slicing the model is powerful but not that easy Easy to misuse some of (algebraic) operators for slicing Completeness of our slices Did we miss any combination of behaviors during slicing? Model debugging. For example: Why a new state was generated? Where/Why the invariants are violated? Managing the model’s abstraction level Which aspects of the SUT can be moved to the adapter Which aspects of the SUT can be left out in the testing, etc. © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 15
  • 16. Benefits to SUT Numerous specification issues during modeling time Models and generated state machines can be used a spec. New test failures on a tested system Often issues with the SUT In some cases, issues with the model program and/or adapters Most issues were corner-cases Innumerable number of test cases from the model Test cases are agnostic to a particular programming language Same tests for all supported languages and middleware © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 16
  • 17. Questions Dharma Ganesan (dganesan@fc-md.umd.edu) © 2014 Fraunhofer USA, Inc. Center for Experimental Software Engineering 17