Monitoring Aspects for the Customization of Automatically Generated Code for Big-Step Models Shahram Esmaeilsabzali Bernd Fischer Joanne M. Atlee

Slides:



Advertisements
Similar presentations
The Quest for Correctness Joseph Sifakis VERIMAG Laboratory 2nd Sogeti Testing Academy April 29th 2009.
Advertisements

Auto-Generation of Test Cases for Infinite States Reactive Systems Based on Symbolic Execution and Formula Rewriting Donghuo Chen School of Computer Science.
Modelling Features as Statecharts Pourya Shaker and Joanne M. Atlee.
Automated Evaluation of Runtime Object States Against Model-Level States for State-Based Test Execution Frank(Weifeng) Xu, Gannon University Dianxiang.
Copyright , Doron Peled and Cesare Tinelli. These notes are based on a set of lecture notes originally developed by Doron Peled at the University.
Models of Concurrency Manna, Pnueli.
Causal-link Planning II José Luis Ambite. 2 CS 541 Causal Link Planning II Planning as Search State SpacePlan Space AlgorithmProgression, Regression POP.
Outline  Introduction  Background  Distributed DBMS Architecture  Distributed Database Design  Semantic Data Control ➠ View Management ➠ Data Security.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Verification of Evolving Software Natasha Sharygina Joint work with Sagar Chaki and Nishant Sinha Carnegie Mellon University.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Identifying, Modifying, Creating, and Removing Monitor Rules for SOC Ricardo Contreras Andrea Zisman
Budapest University of Technology and EconomicsDagstuhl 2004 Department of Measurement and Information Systems 1 Towards Automated Formal Verification.
CS6133 Software Specification and Verification
UPPAAL Introduction Chien-Liang Chen.
CS 290C: Formal Models for Web Software Lecture 4: Implementing and Verifying Statecharts Specifications Using the Spin Model Checker Instructor: Tevfik.
ARCH-05 Application Prophecy UML 101 Peter Varhol Principal Product Manager.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development.
Hydra (A General Framework for Formalizing UML with Formal Languages for Embedded Systems*) *from the Ph.D. thesis of William E. McUmber Software Engineering.
Presented by: Thabet Kacem Spring Outline Contributions Introduction Proposed Approach Related Work Reconception of ADLs XTEAM Tool Chain Discussion.
OASIS Reference Model for Service Oriented Architecture 1.0
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
UML CASE Tool. ABSTRACT Domain analysis enables identifying families of applications and capturing their terminology in order to assist and guide system.
Chapter 1 Principles of Programming and Software Engineering.
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Testing and Monitoring at Penn An Integrated Framework for Validating Model-based Embedded Software Li Tan University of Pennsylvania September, 2003.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Lecture 6 Template Semantics CS6133 Fall 2011 Software Specification and Verification.
Formal Methods 1. Software Engineering and Formal Methods  Every software engineering methodology is based on a recommended development process  proceeding.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
A Survey of Software Refactoring Tom Mens, Tom Tourwé
Context Tailoring the DBMS –To support particular applications Beyond alphanumerical data Beyond retrieve + process –To support particular hardware New.
Assessing the Suitability of UML for Modeling Software Architectures Nenad Medvidovic Computer Science Department University of Southern California Los.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
What is “model transformation”? Distinction between source and target Source may be same as target May be multiple sources, or targets Reaching a fixed.
Scientific Computing By: Fatima Hallak To: Dr. Guy Tel-Zur.
1 Metamodel Access Protocols for Extensible Aspect-Oriented Modeling Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Shinji Sano(Kyushu Institute.
Composing Adaptive Software Authors Philip K. McKinley, Seyed Masoud Sadjadi, Eric P. Kasten, Betty H.C. Cheng Presented by Ana Rodriguez June 21, 2006.
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
/ PSWLAB On the Semantics of Matching Trace Monitoring Patterns P Avgustinov, J Tibble, O Moor (Programming Tool Group, Oxford, UK) June.
Checking Reachability using Matching Logic Grigore Rosu and Andrei Stefanescu University of Illinois, USA.
Requirements Engineering Methods for Requirements Engineering Lecture-30.
Model construction and verification for dynamic programming languages Radu Iosif
Introducing ABC: Programming Languages and AOP Oege de Moor Programming Tools Group University of Oxford joint work with Ganesh Sittampalam, Sascha Kuzins,
Dynamic Program Analysis Klaus Havelund Kestrel Technology NASA Ames Research Center Motivation for writing specs: Instant gratification.
1 A Formal Monitoring-based Framework for Software Development and Analysis Feng Chen Marcelo D'Amorim Grigore Rosu University of Illinois at Urbana-Champaign.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
Verification & Validation By: Amir Masoud Gharehbaghi
Predicate Abstraction. Abstract state space exploration Method: (1) start in the abstract initial state (2) use to compute reachable states (invariants)
From Hoare Logic to Matching Logic Reachability Grigore Rosu and Andrei Stefanescu University of Illinois, USA.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
Constraints Assisted Modeling and Validation Presented in CS294-5 (Spring 2007) Thomas Huining Feng Based on: [1]Constraints Assisted Modeling and Validation.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
All-Path Reachability Logic Andrei Stefanescu 1, Stefan Ciobaca 2, Radu Mereuta 1,2, Brandon Moore 1, Traian Serbanuta 3, Grigore Rosu 1 1 University of.
Facilitating testing and monitoring of number entry systems in medical devices Abigail Cauchi, Christian Colombo, Mark Micallef & Gordon Pace.
Grigore Rosu Founder, President and CEO Professor of Computer Science, University of Illinois
PROGRAMMING PRE- AND POSTCONDITIONS, INVARIANTS AND METHOD CONTRACTS B MODULE 2: SOFTWARE SYSTEMS 13 NOVEMBER 2013.
CS5270 Lecture 41 Timed Automata I CS 5270 Lecture 4.
Model Checking Early Requirements Specifications in Tropos Presented by Chin-Yi Tsai.
Principles of Programming & Software Engineering
Formal methods: Lecture
Opeoluwa Matthews, Jesse Bingham, Daniel Sorin
runtime verification Brief Overview Grigore Rosu
B (The language of B-Method )
Relatively Complete Refinement Type System for Verification of Higher-Order Non-deterministic Programs Hiroshi Unno (University of Tsukuba) Yuki Satake.
Formal Methods in software development
Presentation transcript:

Monitoring Aspects for the Customization of Automatically Generated Code for Big-Step Models Shahram Esmaeilsabzali Bernd Fischer Joanne M. Atlee

Modeling Languages and Code Generation Modeling languages offer... –abstraction – domain specificity –analyzability– but ultimately interested in code: code generation However, code generation can be –opaque: generator implements unknown semantics ⇒ analyze generated code (in terms of modeling language) –iterative: model can change ⇒ automated approach –incomplete: not everything expressed in model ⇒ (ultimately) modify generated code Monitoring framework for a large class of modelling languages and their code generators

Big Step Modeling Languages (BSMLs) Controller Microwave Off On Lock Cooker Unlocked Locked Idle Cooking t: trig [guard_cond] /var_assign ^gen t’: … dest 1 P Q Conjunction of (negation) events Boolean expression over variables Variable assignments Generated events “And” control state “Or” control states M src 1 dest 2 src 2 “Basic” control states... think Statecharts

Big Step Modeling Languages (BSMLs) Controller Microwave Off On Lock Cooker Unlocked Locked Idle Cooking Widely used class of languages and generators: Statecharts (Rhapsody, Statemate,...) RSML Argos...

Big Step Modeling Languages (BSMLs) Controller Microwave Off On Lock Cooker Unlocked Locked Idle Cooking … Environmental Input I... …… Small steps Big step T... titi tjtj tktk

Big Step Modeling Languages (BSMLs) Controller Microwave Off On Lock Cooker Unlocked Locked Idle Cooking Does t3 always fire before t5? Statecharts: “Statecharts”: Does t5 fire always after t3?

Execution of a Big Step in a BSML Determine transitions enabled by events Determine transitions enabled by variables Determine consistent enabled transitions Choose one high- priority small step Execute the small step Maximal Big step? End of big step Big-step initialization with environmental inputs Yes No Remainder Next Small Step Next Big Step GC Big Step GC Small Step Take One Take Many

Execution of a Big Step in a BSML Determine transitions enabled by events Determine transitions enabled by variables Determine consistent enabled transitions Choose one high- priority small step Execute the small step Maximal Big step? End of big step Big-step initialization with environmental inputs Yes No core concepts

Our Contributions A language for specifying monitors that: –uses the vocabulary of models and the modeling language, not the generated code –is independent of the semantics of the language in which the model is specified in A novel aspect-oriented technique to safely add monitors to the generated code A method for automatic code customization for big-step modeling languages –form of customization not determined in advance –functionality of customization not part of the model

Big-Step Monitoring Language (BML) Design goals: check properties of BSML model, and correctness of its implementation check the properties of a BSML and its semantics Design approach: logic (w/ flavor of domain-specific aspect language) operators:enabledness, execution, reachability monitors: invariants, witnesses

BML by Examples Either the door can be locked or radiation can start (i.e., transitions t3 and t5 are not enabled together) invariant: property holds in all snapshots and all big steps (implicit universal quantifier) enabledness: transition is (not) enabled in big step implicit scope: big step

BML by Examples Either the door can be locked or radiation can start (i.e., transitions t3 and t5 are not enabled together) If the door is locked, radiation starts (i.e., if t3 is executed, t5 will also be executed) execution: transition is taken in big step Note: also non-reachability, but is different from reachability: LTL formula over snapshots in big step

BML by Examples Either the door can be locked or radiation can start (i.e., transitions t3 and t5 are not enabled together) If the door is locked, radiation starts (i.e., if t3 is executed, t5 will also be executed) The door can be unlocked (i.e., transition t4 can be executed) witness: property holds in some snapshot in some big step (implicit existential quantifier)

BML by Examples (II) Enabled transitions execute in the same big step Execution of a transition does not invalidate its precondition (global consistency [Pnueli / Shalev, 1991]) limited quantification: only two levels, syntactic sugar, outermost quantifier must match monitor type: invariant↔ universal witness↔ existential

BML is implemented as aspect-oriented runtime monitoring framework. At runtime, check for counter- and witness examples for invariants and witness monitors, respectively. Generated Java aspects evaluate BML expressions, via evaluating en and ex predicates. –only aspect of code generator that needs to be exposed Reachability / unreachability expressions fork a new thread at each snapshot when the antecedent of the expression becomes true.

Prototype Implementation for CGG Family of code generators [Prout, Atlee, Day, and Shaker 2008] Generated aspects take advantage of the structure of the generated code –can use reflection to obtain the necessary information to evaluate the monitors. –minimal change to code generator (change one set of variables into class attributes) only quantifier-free core of BML implemented for the output of the CGG

Experiments Microwave system (and variations) –exhausted various semantic options –monitors behaved as expected Elevator system –uses buffered events (out of the scope of BSMLs) –but generated code has a structure that is compatible with our implementation

Conclusions Introduced BML, a language for specifying monitors for big-step models: –independent of the semantics of a particular language, and thus can be adopted by any BSML –can be used to specify interesting properties Implemented core of BML for the output of a family of code generators. –We developed a novel, aspect-based, multi-threaded technique to generate code to evaluate BMLs –We provided an automatic means for the customization of generated code

Future Work Extending BML to support: –new predicates, to capture the notions like becoming enabled or becoming disabled ⇒ allows specifying a wider range of monitors. –a notion of action to allow modifying the behavior of generated code systematically ⇒ disable(t) action that disables an enabled transition can enforce global consistency semantics for a model Supporting quantification in our implementation

Related Work: Runtime Monitoring Runtime monitoring frameworks (RMFs): –Java PathExplorer [Drusinski 2000] –Temporal Rover [Havelund, Roşu 2001] ⇒ use the vocabulary of programs Aspect-based RMFs: –Trace Matches [Allan, Avgustinov, Christensen, Hendren, Kuzins, Lhoták, de Moor, Sereni, Sittampalam, Tibble, 2005.] –Mop [Chen, Roşu 2007.] ⇒ use pointcut vocabulary in programs

Related Work: Aspects & Code Generation Aspect generation: –Meta AspectJ [Zook, Huang, Smaragdakis, 2004] –Aspect C++ [Lohmann, Blaschke, Spinczyk, 2004] –Generative AOP [Smith, 2004.] ⇒ use general purpose aspects Aspects at model level: –Aspect-oriented domain modelling [Gray, Bapty, Neema, Schmidt, Gokhale, Natarajan, 2003] –Model-based pointcuts [Kellens, Mens, Brichau, Gybels, 2006] ⇒ We unify code, model, and aspects, automatically.

References Esmaeilsabzali, Day, Atlee, Niu: Deconstructing the semantics of big-step modelling languages. Requirements Engineering 15(2), Pnueli,Shalev: What is in a step: On the semantics of statecharts. TACAS, Prout, Atlee, Day, Shake: Semantically configurable code generation. MoDELS, Drusinsky: The temporal rover and the ATG rover. SPIN, Havelund, Roşu: Monitoring Java programs with Java PathExplorer. RV, Allan, Avgustinov, Christensen, Hendren, Kuzins, Lhoták, de Moor, Sereni, Sittampalam, Tibble: Adding trace matching with free variables to AspectJ. OOPSLA, 2005.

References (II) Chen, Roşu: Mop: an efficient and generic runtime verification Framework. OOPSLA, Zook, Huang, Smaragdakis: Generating AspectJ programs with Meta- AspectJ. GPCE, Lohmann, Blaschke, Spinczyk: Generic advice: On the combination of AOP with generative programming in AspectC++. GPCE, Smith: A generative approach to aspect-oriented programming. GPCE, Gray, Bapty, Neema, Schmidt, Gokhale, Natarajan: An approach for supporting aspect-oriented domain modeling. GPCE, Kellens, Mens, Brichau, Gybels: Managing the evolution of aspect-oriented software with model-based pointcuts. ECOOP, 2006.