SlideShare a Scribd company logo
1 of 17
Download to read offline
Adding Random
Operations to OCL
Antonio Vallecillo,
Martin Gogolla
SEPTEMBER 19, 2017
Random in OCL
• Uncertainty is an essential element of
many of the systems we have to model
• Values of properties representing measures
• Decisions and branches
• Number of elements of populations
• Expected durations, costs, tolerance,…
• Random numbers and probability distributions can be of help here
• They permit combining definite knowledge at one level with uncertain values
• Expectations and assumptions that remain uncertain or imprecise at high-
level, can be made precise and realized by stating the corresponding
percentages or the probability distributions that parameters or values follow
2
Random in OCL
• Current OCL specification does not provide support for random
numbers or probability distributions
• Indeterminism only provided by “any()” operation on OCL Collections
11.9.1 Collection
any()
Returns any element in the source collection for which body evaluates to true.
Returns invalid if any body evaluates to invalid for any element, otherwise if
there are one or more elements for which body is true, an indeterminate
choice of one of them is returned, otherwise the result is invalid.
source->any(iterator | body) =
source->select(iterator | body)->asSequence()->first()
3
Indeterminism <> random
• This is the common behaviour of OCL “any()”
4
OCL random operations
context Real::rand() : Real
post undetermined:
if self > 0.0 then ( 0.0 <= result ) and ( result < self )
else if self < 0.0 then ( result <= 0.0 ) and ( self < result )
else result = self endif endif
post statisticallyRandom:
-- A sequence contains no recognizable patterns or regularities
-- This property deserves its own discussion :-)
context Integer::srnd() : Integer
post seedGeneration:
-- if self > 0 then self is the new seed
-- else a new seed is automatically generated (time, etc.)
-- in both cases it returns the previous seed
5
Some examples
6
Probability distributions
7
Some examples
8
Some examples
9
Generating random samples
10
Generating random samples
11
Implementation (1/2)
<operation source="Real" name="rand" returnType="Real">
<body>
<![CDATA[
$self * Random.rand
]]>
</body>
</operation>
<operation source="Integer" name="srand“ returnType="Integer">
<body>
<![CDATA[
if $self > 0 return Random.srand($self) % 1000000
else return Random.srand() % 10000000
end
]]>
</body>
</operation> 12
Implementation (2/2)
• Employing USE
extension mechanism
• Ruby implementation
of newly defined
operations
13
14
Conclusions
• Random numbers and Probability distributions permit dealing with
uncertainty at different levels
• Values of parameters and attributes
• Number of objects and links
• Size of test samples and values
• Beyond the basic indeterminism currently provided by OCL.
• Implementation available at
https://www.dropbox.com/s/2j9tgejbj507id0/oclextensions.zip?dl=0
15
Thanks!
Adding Random
Operations to OCL
Antonio Vallecillo,
Martin Gogolla
SEPTEMBER 19, 2017

More Related Content

Similar to Adding Random Operations to OCL

Two methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersTwo methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersUniversity of Huddersfield
 
Oracle real application clusters system tests with demo
Oracle real application clusters system tests with demoOracle real application clusters system tests with demo
Oracle real application clusters system tests with demoAjith Narayanan
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayGDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayTerrance Cohen
 
Functional Operations - Susan Potter
Functional Operations - Susan PotterFunctional Operations - Susan Potter
Functional Operations - Susan Potterdistributed matters
 
Mining source code for structural regularities (SATTOSE2010)
Mining source code for structural regularities (SATTOSE2010)Mining source code for structural regularities (SATTOSE2010)
Mining source code for structural regularities (SATTOSE2010)kim.mens
 
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz
 
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...butest
 
The operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerThe operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerAndrey Karpov
 
2. overview of c#
2. overview of c#2. overview of c#
2. overview of c#Rohit Rao
 
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...Lionel Briand
 
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...Sean Kandel - Data profiling: Assessing the overall content and quality of a ...
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...huguk
 
ObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptxObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptxssuserc074dd
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomizationNirav Desai
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheckBeScala
 
An introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methodsAn introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methodsAjith Narayanan
 
OCAT: Object Capture based Automated Testing (ISSTA 2010)
OCAT: Object Capture based Automated Testing (ISSTA 2010)OCAT: Object Capture based Automated Testing (ISSTA 2010)
OCAT: Object Capture based Automated Testing (ISSTA 2010)Sung Kim
 

Similar to Adding Random Operations to OCL (20)

Two methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersTwo methods for optimising cognitive model parameters
Two methods for optimising cognitive model parameters
 
Oracle real application clusters system tests with demo
Oracle real application clusters system tests with demoOracle real application clusters system tests with demo
Oracle real application clusters system tests with demo
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayGDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
 
Functional Operations - Susan Potter
Functional Operations - Susan PotterFunctional Operations - Susan Potter
Functional Operations - Susan Potter
 
Mining source code for structural regularities (SATTOSE2010)
Mining source code for structural regularities (SATTOSE2010)Mining source code for structural regularities (SATTOSE2010)
Mining source code for structural regularities (SATTOSE2010)
 
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016
 
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...
 
The operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerThe operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzer
 
2. overview of c#
2. overview of c#2. overview of c#
2. overview of c#
 
Java Tutorial
Java Tutorial Java Tutorial
Java Tutorial
 
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
 
STL Algorithms In Action
STL Algorithms In ActionSTL Algorithms In Action
STL Algorithms In Action
 
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...Sean Kandel - Data profiling: Assessing the overall content and quality of a ...
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...
 
ObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptxObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptx
 
ppt.pptx
ppt.pptxppt.pptx
ppt.pptx
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheck
 
cb streams - gavin pickin
cb streams - gavin pickincb streams - gavin pickin
cb streams - gavin pickin
 
An introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methodsAn introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methods
 
OCAT: Object Capture based Automated Testing (ISSTA 2010)
OCAT: Object Capture based Automated Testing (ISSTA 2010)OCAT: Object Capture based Automated Testing (ISSTA 2010)
OCAT: Object Capture based Automated Testing (ISSTA 2010)
 

More from Antonio Vallecillo

Modeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain BehaviorsModeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain BehaviorsAntonio Vallecillo
 
Introducing Subjective Knowledge Graphs
Introducing Subjective Knowledge GraphsIntroducing Subjective Knowledge Graphs
Introducing Subjective Knowledge GraphsAntonio Vallecillo
 
Using UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital TwinsUsing UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital TwinsAntonio Vallecillo
 
Modeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCLModeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCLAntonio Vallecillo
 
Modeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of UncertaintyModeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of UncertaintyAntonio Vallecillo
 
Research Evaluation - The current situation in Spain
Research Evaluation - The current situation in SpainResearch Evaluation - The current situation in Spain
Research Evaluation - The current situation in SpainAntonio Vallecillo
 
Belief Uncertainty in Software Models
Belief Uncertainty in Software ModelsBelief Uncertainty in Software Models
Belief Uncertainty in Software ModelsAntonio Vallecillo
 
Extending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured InformationExtending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured InformationAntonio Vallecillo
 
Towards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software EngineeringTowards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software EngineeringAntonio Vallecillo
 
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...Antonio Vallecillo
 
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código ÉticoLa Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código ÉticoAntonio Vallecillo
 
La ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidadesLa ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidadesAntonio Vallecillo
 
Los Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de MálagaLos Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de MálagaAntonio Vallecillo
 
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...Antonio Vallecillo
 
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...Antonio Vallecillo
 
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...Antonio Vallecillo
 
Accountable objects: Modeling Liability in Open Distributed Systems
Accountable objects: Modeling Liability in Open Distributed SystemsAccountable objects: Modeling Liability in Open Distributed Systems
Accountable objects: Modeling Liability in Open Distributed SystemsAntonio Vallecillo
 
Improving Naming and Grouping in UML
Improving Naming and Grouping in UMLImproving Naming and Grouping in UML
Improving Naming and Grouping in UMLAntonio Vallecillo
 
On the Combination of Domain Specific Modeling Languages
On the Combination of Domain Specific Modeling LanguagesOn the Combination of Domain Specific Modeling Languages
On the Combination of Domain Specific Modeling LanguagesAntonio Vallecillo
 

More from Antonio Vallecillo (20)

Modeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain BehaviorsModeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain Behaviors
 
Introducing Subjective Knowledge Graphs
Introducing Subjective Knowledge GraphsIntroducing Subjective Knowledge Graphs
Introducing Subjective Knowledge Graphs
 
Using UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital TwinsUsing UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital Twins
 
Modeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCLModeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCL
 
Modeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of UncertaintyModeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of Uncertainty
 
Research Evaluation - The current situation in Spain
Research Evaluation - The current situation in SpainResearch Evaluation - The current situation in Spain
Research Evaluation - The current situation in Spain
 
Belief Uncertainty in Software Models
Belief Uncertainty in Software ModelsBelief Uncertainty in Software Models
Belief Uncertainty in Software Models
 
Extending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured InformationExtending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured Information
 
Towards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software EngineeringTowards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software Engineering
 
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
 
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código ÉticoLa Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
 
La ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidadesLa ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidades
 
Los Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de MálagaLos Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de Málaga
 
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
 
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
 
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
 
Accountable objects: Modeling Liability in Open Distributed Systems
Accountable objects: Modeling Liability in Open Distributed SystemsAccountable objects: Modeling Liability in Open Distributed Systems
Accountable objects: Modeling Liability in Open Distributed Systems
 
Models And Meanings
Models And MeaningsModels And Meanings
Models And Meanings
 
Improving Naming and Grouping in UML
Improving Naming and Grouping in UMLImproving Naming and Grouping in UML
Improving Naming and Grouping in UML
 
On the Combination of Domain Specific Modeling Languages
On the Combination of Domain Specific Modeling LanguagesOn the Combination of Domain Specific Modeling Languages
On the Combination of Domain Specific Modeling Languages
 

Recently uploaded

Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Gáspár Nagy
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfFurqanuddin10
 
How to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfHow to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfTestgrid.io
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Soroosh Khodami
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabbereGrabber
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdfkalichargn70th171
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfkalichargn70th171
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAlluxio, Inc.
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationHelp Desk Migration
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024vaibhav130304
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfmbmh111980
 
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfMicrosoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfQ-Advise
 
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityAPVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityamy56318795
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfMehmet Akar
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersEmilyJiang23
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignNeo4j
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAlluxio, Inc.
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationWave PLM
 

Recently uploaded (20)

Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
How to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfHow to pick right visual testing tool.pdf
How to pick right visual testing tool.pdf
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand
 
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfMicrosoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
 
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityAPVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 

Adding Random Operations to OCL

  • 1. Adding Random Operations to OCL Antonio Vallecillo, Martin Gogolla SEPTEMBER 19, 2017
  • 2. Random in OCL • Uncertainty is an essential element of many of the systems we have to model • Values of properties representing measures • Decisions and branches • Number of elements of populations • Expected durations, costs, tolerance,… • Random numbers and probability distributions can be of help here • They permit combining definite knowledge at one level with uncertain values • Expectations and assumptions that remain uncertain or imprecise at high- level, can be made precise and realized by stating the corresponding percentages or the probability distributions that parameters or values follow 2
  • 3. Random in OCL • Current OCL specification does not provide support for random numbers or probability distributions • Indeterminism only provided by “any()” operation on OCL Collections 11.9.1 Collection any() Returns any element in the source collection for which body evaluates to true. Returns invalid if any body evaluates to invalid for any element, otherwise if there are one or more elements for which body is true, an indeterminate choice of one of them is returned, otherwise the result is invalid. source->any(iterator | body) = source->select(iterator | body)->asSequence()->first() 3
  • 4. Indeterminism <> random • This is the common behaviour of OCL “any()” 4
  • 5. OCL random operations context Real::rand() : Real post undetermined: if self > 0.0 then ( 0.0 <= result ) and ( result < self ) else if self < 0.0 then ( result <= 0.0 ) and ( self < result ) else result = self endif endif post statisticallyRandom: -- A sequence contains no recognizable patterns or regularities -- This property deserves its own discussion :-) context Integer::srnd() : Integer post seedGeneration: -- if self > 0 then self is the new seed -- else a new seed is automatically generated (time, etc.) -- in both cases it returns the previous seed 5
  • 12. Implementation (1/2) <operation source="Real" name="rand" returnType="Real"> <body> <![CDATA[ $self * Random.rand ]]> </body> </operation> <operation source="Integer" name="srand“ returnType="Integer"> <body> <![CDATA[ if $self > 0 return Random.srand($self) % 1000000 else return Random.srand() % 10000000 end ]]> </body> </operation> 12
  • 13. Implementation (2/2) • Employing USE extension mechanism • Ruby implementation of newly defined operations 13
  • 14. 14
  • 15. Conclusions • Random numbers and Probability distributions permit dealing with uncertainty at different levels • Values of parameters and attributes • Number of objects and links • Size of test samples and values • Beyond the basic indeterminism currently provided by OCL. • Implementation available at https://www.dropbox.com/s/2j9tgejbj507id0/oclextensions.zip?dl=0 15
  • 17. Adding Random Operations to OCL Antonio Vallecillo, Martin Gogolla SEPTEMBER 19, 2017