SlideShare a Scribd company logo
2009. 10. 9                       TOKYO INSTITUTE OF TECHNOLOGY
                                   DEPARTMENT OF COMPUTER SCIENCE
MODELS 2009


      Generating Assertion
        Code from OCL:
  A Transformational Approach Based on
 Similarities of Implementation Languages

 Rodion Moiseev Shinpei Hayashi Motoshi Saeki

               Department of Computer Science
                Tokyo Institute of Technology
                            Japan
Abstract
   Generation Assertion Code from OCL
    − Transformational Approach:
      Regarding OCL-to-code as model transformation
    − Similarities of Implementation Languages:
      Constructing a language hierarchy for effective
      developing of transformation rules
   Results
    − A translation framework has been developed
    − Showed ~50% of effort to construct translation
      rules saved
                                                        2
Background
 Model-centric approaches are becoming
  important in academia and industry
 OCL is often the language of choice for
  stipulating constraints on models
 Successful application depends on
  mature tool support:
    − Support for multiple programming languages
    − Customizable assertion code/test case
      generation
                                                   3
Motivating Example
   Application design: UML with OCL

           <<interface>>       OCL
        MyApplication


    doQuery(q : Query) : Integer


                                     context MyApplication::doQuery(
                                               q: Query): Integer
                                       pre: not q = null
                                       post: result >= 0

                                                                       4
Motivating Example
   A need to check OCL for multiple languages

         MyApplication                               Client 1
                 Perl                                   Java

    Server

             <<interface>>                           Client 2
         MyApplication
                                                      Haskell

     doQuery(q : Query) : Integer
                                    context MyApplication::doQuery(
                                              q: Query): Integer
                                      pre: not q = null
                                      post: result >= 0
                                                                      5
Pinpointing the Problem
   Interface
  (UML+OCL)
                 Generate         <<write code>>
                 Skeleton
           OCL

                        Code
                                       Code
     OCL
                       Skeleton


                                    Assertion
                                      Code
                   Generate
                 assertion code
                                                   6
Problems
   Troublesome to make individual OCL
    translators
    − Many languages exist
      • Most of existing tools are tailor-made for a
        specific language
    − Creating a translator requires efforts
      • Specifying OCL translation rules for each
        individual OCL concept, operator, etc.

   Our solution:
    Usage of language similarities
                                                       7
Language Similarities
 E.g.,    for-loop iterating over a collection
                For Each apple In apples Do:
                  If apple.color == “red” Then
                     …
                Next                           Imperative
                                            Pseudo-language

 for (Iterator it = apples.iterator(); it.hasNext(); ) {
   Apple apple = (Apple) it.next();
   if (apple.color == “red”) {          for apple in apples:
       …                                   if apple.color == “red”:
                           Java             …
                                                             Python
                                                                      8
The Approach
   Hierarchy of programming languages
    based on their structural similarities
                                   OCL


            Imperative             Functional                          DbC


Java, C# like            Python   Lisp          Haskell                JML

                           Step-by-step                   <<described in terms of>>
    Java        C#          Translation                   Pseudo-languages
                                                          Concrete languages
MultiJava
                                                                            High
                                                                    concreteness      9
Advantages
   Provide a single framework for creating
    OCL translators for any language
     − Reuse translator implementations
   Bridges semantic gap
     − Effort of understanding OCL is alleviated
     − Manual effort of creating OCL translators is
       reduced
                     OCL                      OCL

    Semantic gap                            Imperative

                    Python                   Python
                                                         10
Generation Process
                                                                               Environment
                                                                              containing type
                                                                                information

  Parser + type checker                             OCL AST             ENV

                             AST→Imperative DL        AST         ENV
             OCL

       OCL                                        Imperative DL

      Input                 Imper. DL→Python DL     Imper. DL     ENV
    UML + OCL
                        rewriting rules            Python DL              Python Code
                         Python DL→Python Code Python DL          ENV


                       printing rules
                                                         DL = Definition Language
                   (Structural representation of pseudo/implementation languages) 11
Comparison with MDE
                         DL Definition and                   MDE Terms
                         Rewriting System
                          Metalanguage


                         Rewriting Language
         written in   Transformation Language   written in

                               written in

 Imperative DL           Imper. DL→Python DL          Python DL
     PIM                   Transformation              PSM
                               Rules

                          Rewriting engine

                                                                         12
Transformation Example
 All employees in the company earn more than 10,000
 employees->forAll( e : Employee | e.salary > 10000)
 OCL AST:
 iteratorExp
   (assocEndCallExp simpleName("self") . simpleName("employees"))
   -> simpleName("forAll") ( varDecl(simpleName("e"), pathName("Employee")) |
       operCallExp(
           attrCallExp simpleName("e") . simpleName("salary"),
           simpleName(">"),
           intLitExp("10000")
                                     Company 1 .. * employees           Employee
       )
                                                                        salary : Int
   )

                                                                                   13
Rewriting Rules
iteratorExp OE -> simpleName(“forAll”) `( varDecl(SN, TYPE) | OE’’ `)


         impMethodExtract(
         {
               impForLoop( OE, impVarDecl(TYPE, SN),
               {
                    impIf( impNot(OE''),
                                                           OCL AST→Imperative DL
                    {
                         impReturn( boolLitFalse )
                    })
               })
               ; impReturn( boolLitTrue )
         }, pathName("Boolean")) .


                                                                                   14
Imperative DL
impMethodExtract(
  {emptyCtx |
     impForLoop(
         assocEndCallExp simpleName("self"). simpleName("employees"),
          impVarDecl(pathName("Employee"),simpleName("e")),
      { "ctx:iter" = simpleName("it_e") |
            impIf( impNot(operCallExp(
               attrCallExp simpleName("e"). simpleName("salary"),
               simpleName(">"),
               intLitExp(“10000"))),
            {emptyCtx |
               impReturn(boolLitFalse)
            })
       })
   };
   {emptyCtx |
       impReturn(boolLitTrue)
   },pathName("Boolean"))
                                                                        15
Generation Result
class Employee:                          From UML
     def __init__(self, name, salary):
      self.name = name
      self.salary = salary

class Company:
     def __init__(self, employees):
      self.employees = employees

    def callExtMethod_A(self):           From OCL
     for e in self.employees:
         if (not (e.salary > 10000)):
             return False
         return True
    def inv(self):
     return self.callExtMethod_A()
                                                    16
Approach Evaluation
   Implemented a tool in the Maude System (*)
   To show the ability to implement several OCL
    translators with significant effort savings
   Target languages
     − Imperative
         • Java
                                                      OCL      Predefined
         • Python
                                         Imperative         Functional
     − Functional
         • Haskell
                                  Java           Python      Haskell
         • O’Haskell
                                                            O’Haskell

    * http://maude.cs.uiuc.edu/
                                                                            17
Approach Evaluation
   Compare effort in our approach vs.
    direct approach:
    − # rewriting rules + # structures + # printing rules
                                                         OCL AST
                     OCL AST
                                                      Imperative DL
                                     Imper. DL→Java DL
                          Compare
     OCL AST →Java                                       Java DL
                                       Java DL→Java


       Java Code                        Java Code
     Direct Approach                Proposed Approach                 18
Evaluation Results
   Imperative languages                                      rewriting rules
                                                              structures
                                                              printing rules

                      Java                         Python
               85              58%                       99         40%
                              effort                               effort
                                                              59
                              saved                                saved
    Effort




                                       Effort
                         36




             Direct     Our                     Direct     Our
                      approach                           approach

                                                                                19
Evaluation Results
   Functional languages                                   rewriting rules
                                                           structures
                                                           printing rules

                    Haskell                       O’Haskell

                               32%                               99%
               76                                76
                              effort                            effort
                        52    saved                             saved
    Effort




                                       Effort

                                                            1

             Direct     Our                     Direct     Our
                      approach                           approach

                                                                             20
Evaluation Results
                    Direct     Proposed
                   Approach    Approach
     Java             85          36
    Python            99          59
    Haskell           76          52
   O’Haskell          76          1
     Total           316         148
  ~50% effort could be saved on average
                                          21
Conclusion
   Proposed a novel technique to generate
    assertion code from OCL constraints
   Used structural similarities of programming
    languages to enable reusing in OCL
    translators for multiple languages
    − Saving manual effort
   Run an experiment to show the claimed effort
    savings by using our approach



                                                  22
Future Work
   Uncovered functionalities of OCL
    − History expressions (@pre)
    − OCL messages
    − allInstances, etc.
   Hierarchy Limitations
    − Difficult to extend hierarchy from the middle
    − Does not allow multiple parent nodes
      (e.g. useful for implementing an
      imperative/functional hybrid)
   Real case study
                                                      23

More Related Content

PDF
Detecting Occurrences of Refactoring with Heuristic Search
PDF
Sentence-to-Code Traceability Recovery with Domain Ontologies
PDF
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
PDF
iFL: An Interactive Environment for Understanding Feature Implementations
PDF
A Recommender System for Refining Ekeko/X Transformation
PDF
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
PDF
Ekeko Technology Showdown at SoTeSoLa 2012
PDF
The SOUL Tool Suite for Querying Programs in Symbiosis with Eclipse
Detecting Occurrences of Refactoring with Heuristic Search
Sentence-to-Code Traceability Recovery with Domain Ontologies
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
iFL: An Interactive Environment for Understanding Feature Implementations
A Recommender System for Refining Ekeko/X Transformation
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
Ekeko Technology Showdown at SoTeSoLa 2012
The SOUL Tool Suite for Querying Programs in Symbiosis with Eclipse

What's hot (19)

PDF
Detecting aspect-specific code smells using Ekeko for AspectJ
PDF
Boost.Dispatch
PDF
The Rise of Dynamic Languages
PDF
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
PDF
HDR Defence - Software Abstractions for Parallel Architectures
PDF
(Costless) Software Abstractions for Parallel Architectures
PDF
Guiding Identification of Missing Scenarios for Dynamic Feature Location
PDF
Designing Architecture-aware Library using Boost.Proto
PDF
Extending and scripting PDT
PDF
Toward Understanding How Developers Recognize Features in Source Code from De...
PDF
Refactoring Edit History of Source Code
PDF
Visualizing Stakeholder Concerns with Anchored Map
PPSX
SRAVANByCPP
PPTX
GCC RTL and Machine Description
PDF
Syntutic
PPTX
14.jun.2012
PDF
Introduction to new features in java 8
PDF
2013 bookmatter learn_javaforandroiddevelopment
PDF
ICPC08b.ppt
Detecting aspect-specific code smells using Ekeko for AspectJ
Boost.Dispatch
The Rise of Dynamic Languages
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
HDR Defence - Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures
Guiding Identification of Missing Scenarios for Dynamic Feature Location
Designing Architecture-aware Library using Boost.Proto
Extending and scripting PDT
Toward Understanding How Developers Recognize Features in Source Code from De...
Refactoring Edit History of Source Code
Visualizing Stakeholder Concerns with Anchored Map
SRAVANByCPP
GCC RTL and Machine Description
Syntutic
14.jun.2012
Introduction to new features in java 8
2013 bookmatter learn_javaforandroiddevelopment
ICPC08b.ppt
Ad

Viewers also liked (12)

PDF
Understanding Source Code Differences by Separating Refactoring Effects
PDF
Class Responsibility Assignment as Fuzzy Constraint Satisfaction
PDF
Modeling and Utilizing Security Knowledge for Eliciting Security Requirements
PDF
Feature Location for Multi-Layer System Based on Formal Concept Analysis
PDF
How Can You Improve Your As-is Models? Requirements Analysis Methods Meet GQM
PDF
Terminology Matching of Requirements Specification Documents and Regulations ...
PDF
Incremental Feature Location and Identification in Source Code
PDF
Historef: A Tool for Edit History Refactoring
PDF
Establishing Regulatory Compliance in Goal-Oriented Requirements Analysis
PDF
Toward Structured Location of Features
PDF
Supporting Design Model Refactoring for Improving Class Responsibility Assign...
PDF
FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」
Understanding Source Code Differences by Separating Refactoring Effects
Class Responsibility Assignment as Fuzzy Constraint Satisfaction
Modeling and Utilizing Security Knowledge for Eliciting Security Requirements
Feature Location for Multi-Layer System Based on Formal Concept Analysis
How Can You Improve Your As-is Models? Requirements Analysis Methods Meet GQM
Terminology Matching of Requirements Specification Documents and Regulations ...
Incremental Feature Location and Identification in Source Code
Historef: A Tool for Edit History Refactoring
Establishing Regulatory Compliance in Goal-Oriented Requirements Analysis
Toward Structured Location of Features
Supporting Design Model Refactoring for Improving Class Responsibility Assign...
FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」
Ad

Similar to Generating Assertion Code from OCL: A Transformational Approach Based on Similarities of Implementation Languages (20)

PDF
Peyton jones-2011-parallel haskell-the_future
PDF
Simon Peyton Jones: Managing parallelism
PPTX
LINQ/PLINQ
PDF
IN4308 1
PPTX
1 cc
PDF
ModRef'09: Gecode support for MCP
PDF
The Forces Driving Java
ODP
IDE as a Front-end and Fast time-to-market language support in Eclipse IDE re...
PDF
Experiments in Sharing Java VM Technology with CRuby
PDF
The Evolution of Scala / Scala進化論
PDF
Introduction to Clojure
ODP
EcoreTools-Next: Executable DSL made (more) accessible
ODP
OCL Integration and Code Generation
PDF
2004 Esug Prototalk
ODP
Eclipse OCL Summary
PDF
Introduction to OpenSees by Frank McKenna
PPTX
Unit1 principle of programming language
PDF
.NET Core, ASP.NET Core Course, Session 3
PPT
Basics-Of-Java
PDF
PL Lecture 01 - preliminaries
Peyton jones-2011-parallel haskell-the_future
Simon Peyton Jones: Managing parallelism
LINQ/PLINQ
IN4308 1
1 cc
ModRef'09: Gecode support for MCP
The Forces Driving Java
IDE as a Front-end and Fast time-to-market language support in Eclipse IDE re...
Experiments in Sharing Java VM Technology with CRuby
The Evolution of Scala / Scala進化論
Introduction to Clojure
EcoreTools-Next: Executable DSL made (more) accessible
OCL Integration and Code Generation
2004 Esug Prototalk
Eclipse OCL Summary
Introduction to OpenSees by Frank McKenna
Unit1 principle of programming language
.NET Core, ASP.NET Core Course, Session 3
Basics-Of-Java
PL Lecture 01 - preliminaries

More from Institute of Science Tokyo (9)

PDF
Revisiting the Effect of Branch Handling Strategies on Change Recommendation
PDF
An Extensive Study on Smell Aware Bug Localization
PDF
RefactorHub: A Commit Annotator for Refactoring
PDF
Can Automated Impact Analysis Technique Help Predicting Decaying Modules?
PDF
The Impact of Systematic Edits in History Slicing
PDF
ChangeMacroRecorder: Recording Fine-Grained Textual Changes of Source Code
PDF
Inference-Based Detection of Architectural Violations in MVC2
PDF
Detecting Bad Smells of Refinement in Goal-Oriented Requirements Analysis
PDF
ソフトウェア工学勉強会への誘い
Revisiting the Effect of Branch Handling Strategies on Change Recommendation
An Extensive Study on Smell Aware Bug Localization
RefactorHub: A Commit Annotator for Refactoring
Can Automated Impact Analysis Technique Help Predicting Decaying Modules?
The Impact of Systematic Edits in History Slicing
ChangeMacroRecorder: Recording Fine-Grained Textual Changes of Source Code
Inference-Based Detection of Architectural Violations in MVC2
Detecting Bad Smells of Refinement in Goal-Oriented Requirements Analysis
ソフトウェア工学勉強会への誘い

Recently uploaded (20)

PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Spectroscopy.pptx food analysis technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
Teaching material agriculture food technology
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
20250228 LYD VKU AI Blended-Learning.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
Spectroscopy.pptx food analysis technology
Chapter 3 Spatial Domain Image Processing.pdf
Big Data Technologies - Introduction.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Teaching material agriculture food technology

Generating Assertion Code from OCL: A Transformational Approach Based on Similarities of Implementation Languages

  • 1. 2009. 10. 9 TOKYO INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE MODELS 2009 Generating Assertion Code from OCL: A Transformational Approach Based on Similarities of Implementation Languages Rodion Moiseev Shinpei Hayashi Motoshi Saeki Department of Computer Science Tokyo Institute of Technology Japan
  • 2. Abstract  Generation Assertion Code from OCL − Transformational Approach: Regarding OCL-to-code as model transformation − Similarities of Implementation Languages: Constructing a language hierarchy for effective developing of transformation rules  Results − A translation framework has been developed − Showed ~50% of effort to construct translation rules saved 2
  • 3. Background  Model-centric approaches are becoming important in academia and industry  OCL is often the language of choice for stipulating constraints on models  Successful application depends on mature tool support: − Support for multiple programming languages − Customizable assertion code/test case generation 3
  • 4. Motivating Example  Application design: UML with OCL <<interface>> OCL MyApplication doQuery(q : Query) : Integer context MyApplication::doQuery( q: Query): Integer pre: not q = null post: result >= 0 4
  • 5. Motivating Example  A need to check OCL for multiple languages MyApplication Client 1 Perl Java Server <<interface>> Client 2 MyApplication Haskell doQuery(q : Query) : Integer context MyApplication::doQuery( q: Query): Integer pre: not q = null post: result >= 0 5
  • 6. Pinpointing the Problem Interface (UML+OCL) Generate <<write code>> Skeleton OCL Code Code OCL Skeleton Assertion Code Generate assertion code 6
  • 7. Problems  Troublesome to make individual OCL translators − Many languages exist • Most of existing tools are tailor-made for a specific language − Creating a translator requires efforts • Specifying OCL translation rules for each individual OCL concept, operator, etc.  Our solution: Usage of language similarities 7
  • 8. Language Similarities  E.g., for-loop iterating over a collection For Each apple In apples Do: If apple.color == “red” Then … Next Imperative Pseudo-language for (Iterator it = apples.iterator(); it.hasNext(); ) { Apple apple = (Apple) it.next(); if (apple.color == “red”) { for apple in apples: … if apple.color == “red”: Java … Python 8
  • 9. The Approach  Hierarchy of programming languages based on their structural similarities OCL Imperative Functional DbC Java, C# like Python Lisp Haskell JML Step-by-step <<described in terms of>> Java C# Translation Pseudo-languages Concrete languages MultiJava High concreteness 9
  • 10. Advantages  Provide a single framework for creating OCL translators for any language − Reuse translator implementations  Bridges semantic gap − Effort of understanding OCL is alleviated − Manual effort of creating OCL translators is reduced OCL OCL Semantic gap Imperative Python Python 10
  • 11. Generation Process Environment containing type information Parser + type checker OCL AST ENV AST→Imperative DL AST ENV OCL OCL Imperative DL Input Imper. DL→Python DL Imper. DL ENV UML + OCL rewriting rules Python DL Python Code Python DL→Python Code Python DL ENV printing rules DL = Definition Language (Structural representation of pseudo/implementation languages) 11
  • 12. Comparison with MDE DL Definition and MDE Terms Rewriting System Metalanguage Rewriting Language written in Transformation Language written in written in Imperative DL Imper. DL→Python DL Python DL PIM Transformation PSM Rules Rewriting engine 12
  • 13. Transformation Example All employees in the company earn more than 10,000 employees->forAll( e : Employee | e.salary > 10000) OCL AST: iteratorExp (assocEndCallExp simpleName("self") . simpleName("employees")) -> simpleName("forAll") ( varDecl(simpleName("e"), pathName("Employee")) | operCallExp( attrCallExp simpleName("e") . simpleName("salary"), simpleName(">"), intLitExp("10000") Company 1 .. * employees Employee ) salary : Int ) 13
  • 14. Rewriting Rules iteratorExp OE -> simpleName(“forAll”) `( varDecl(SN, TYPE) | OE’’ `) impMethodExtract( { impForLoop( OE, impVarDecl(TYPE, SN), { impIf( impNot(OE''), OCL AST→Imperative DL { impReturn( boolLitFalse ) }) }) ; impReturn( boolLitTrue ) }, pathName("Boolean")) . 14
  • 15. Imperative DL impMethodExtract( {emptyCtx | impForLoop( assocEndCallExp simpleName("self"). simpleName("employees"), impVarDecl(pathName("Employee"),simpleName("e")), { "ctx:iter" = simpleName("it_e") | impIf( impNot(operCallExp( attrCallExp simpleName("e"). simpleName("salary"), simpleName(">"), intLitExp(“10000"))), {emptyCtx | impReturn(boolLitFalse) }) }) }; {emptyCtx | impReturn(boolLitTrue) },pathName("Boolean")) 15
  • 16. Generation Result class Employee: From UML def __init__(self, name, salary): self.name = name self.salary = salary class Company: def __init__(self, employees): self.employees = employees def callExtMethod_A(self): From OCL for e in self.employees: if (not (e.salary > 10000)): return False return True def inv(self): return self.callExtMethod_A() 16
  • 17. Approach Evaluation  Implemented a tool in the Maude System (*)  To show the ability to implement several OCL translators with significant effort savings  Target languages − Imperative • Java OCL Predefined • Python Imperative Functional − Functional • Haskell Java Python Haskell • O’Haskell O’Haskell * http://maude.cs.uiuc.edu/ 17
  • 18. Approach Evaluation  Compare effort in our approach vs. direct approach: − # rewriting rules + # structures + # printing rules OCL AST OCL AST Imperative DL Imper. DL→Java DL Compare OCL AST →Java Java DL Java DL→Java Java Code Java Code Direct Approach Proposed Approach 18
  • 19. Evaluation Results  Imperative languages rewriting rules structures printing rules Java Python 85 58% 99 40% effort effort 59 saved saved Effort Effort 36 Direct Our Direct Our approach approach 19
  • 20. Evaluation Results  Functional languages rewriting rules structures printing rules Haskell O’Haskell 32% 99% 76 76 effort effort 52 saved saved Effort Effort 1 Direct Our Direct Our approach approach 20
  • 21. Evaluation Results Direct Proposed Approach Approach Java 85 36 Python 99 59 Haskell 76 52 O’Haskell 76 1 Total 316 148 ~50% effort could be saved on average 21
  • 22. Conclusion  Proposed a novel technique to generate assertion code from OCL constraints  Used structural similarities of programming languages to enable reusing in OCL translators for multiple languages − Saving manual effort  Run an experiment to show the claimed effort savings by using our approach 22
  • 23. Future Work  Uncovered functionalities of OCL − History expressions (@pre) − OCL messages − allInstances, etc.  Hierarchy Limitations − Difficult to extend hierarchy from the middle − Does not allow multiple parent nodes (e.g. useful for implementing an imperative/functional hybrid)  Real case study 23