1 Incremental Analysis of Interference Among Aspects Authors: Emilia Katz, Shmuel Katz The Technion.

Slides:



Advertisements
Similar presentations
Implementation and Verification of a Cache Coherence protocol using Spin Steven Farago.
Advertisements

Modular and Verified Automatic Program Repair Francesco Logozzo, Thomas Ball RiSE - Microsoft Research Redmond.
Digital Certificate Installation & User Guide For Class-2 Certificates.
Transactions - Concurrent access & System failures - Properties of Transactions - Isolation Levels 4/13/2015Databases21.
Justification-based TMSs (JTMS) JTMS utilizes 3 types of nodes, where each node is associated with an assertion: 1.Premises. Their justifications (provided.
Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services Authored by: Seth Gilbert and Nancy Lynch Presented by:
Temporal Logic and the NuSMV Model Checker CS 680 Formal Methods Jeremy Johnson.
1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
1 Modular Verification of Strongly Invasive Aspects Authors: Emilia Katz, Shmuel Katz The Technion.
Aspect-Oriented Software Development (AOSD) Tutorial #10 Interference among Aspects.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
Efficient Query Evaluation on Probabilistic Databases
Software Reliability CIS 640 Adapted from the lecture notes by Doron Pelel (
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor Formal Methods in Software Engineering1.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
© Katz, 2007CS Formal SpecificationsLecture - Temporal logic 1 Temporal Logic Formal Specifications CS Shmuel Katz The Technion.
© Katz, 2003 Formal Specifications of Complex Systems-- Real-time 1 Adding Real-time to Formal Specifications Formal Specifications of Complex Systems.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Aspect-Oriented Software Development (AOSD) Tutorial #10 Interference among Aspects.
Formalisms and Verification for Transactional Memories Vasu Singh EPFL Switzerland.
CPSC 668Set 16: Distributed Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Interferences: aspect-base and between aspects Shmuel Katz, using slides from Lodewijk Bergmans.
Verification of Hierarchical Cache Coherence Protocols for Future Processors Student: Xiaofang Chen Advisor: Ganesh Gopalakrishnan.
Categories of Aspects Shmuel Katz Computer Science Department The Technion Haifa, Israel.
Categories of Aspects Shmuel Katz Computer Science Department The Technion Haifa, Israel.
© Katz, 2007 Formal Specifications of Complex Systems-- Real-time 1 Adding Real-time to Formal Specifications Formal Specifications of Complex Systems.
Specification and Verification of Aspects Shmuel Katz.
1 Detecting Interference or Proving Interference Freedom Among Aspects Shmuel Katz Computer Science Department The Technion.
Rigorous Fault Tolerance Using Aspects and Formal Methods Shmuel Katz Computer Science Department The Technion Haifa, Israel
Chapter 1 Principles of Programming and Software Engineering.
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Aspect-Oriented Software Development (AOSD) Tutorial #9 Modular Verification of Aspects.
Aspect-Oriented Software Development (AOSD) Tutorial #9 Modular Verification of Aspects.
EmployeeS Verify/Enter/Update Address In EmpowHR Preparing for LincPass and Forgot Your Password Reminder Slide2Verify/Enter/Update Address.
Application Process USAJOBS – Application Manager USA STAFFING ® —OPM’S AUTOMATED HIRING TOOL FOR FEDERAL AGENCIES.
Tri-Counties Regional Center (TCRC) DS1891 Compliance Website Information and Instructions Biennial Requirement to Update Form DS1891 – Applicant/Vendor.
Masud Hasan Secue VS Hushmail Project 2.
A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Reliable Communication in the Presence of Failures Based on the paper by: Kenneth Birman and Thomas A. Joseph Cesar Talledo COEN 317 Fall 05.
Distributed Transaction Management, Fall 2002 Unconventional transactions Jyrki Nummenmaa
1cs Intersection of Concurrent Accesses A fundamental property of Web sites: Concurrent accesses by multiple users Concurrent accesses intersect.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Categories of Aspects Shmuel Katz Computer Science Department The Technion Haifa, Israel.
Network Protocols Network Systems Security Mort Anvari.
May University of Glasgow Generalising Feature Interactions in Muffy Calder, Alice Miller Dept. of Computing Science University of Glasgow.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
SysRép / 2.5A. SchiperEté The consensus problem.
© Copyright 2009 SSLPost 01. © Copyright 2009 SSLPost 02 a recipient is sent an encrypted that contains data specific to that recipient the data.
Introduction to OOP CPS235: Introduction.
PROGRAMMING PRE- AND POSTCONDITIONS, INVARIANTS AND METHOD CONTRACTS B MODULE 2: SOFTWARE SYSTEMS 13 NOVEMBER 2013.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 16: Distributed Shared Memory 1.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
Error Explanation with Distance Metrics Authors: Alex Groce, Sagar Chaki, Daniel Kroening, and Ofer Strichman International Journal on Software Tools for.
From Natural Language to LTL: Difficulties Capturing Natural Language Specification in Formal Languages for Automatic Analysis Elsa L Gunter NJIT.
“Distributed Algorithms” by Nancy A. Lynch SHARED MEMORY vs NETWORKS Presented By: Sumit Sukhramani Kent State University.
Collecting Copyright Transfers and Disclosures via Editorial Manager™ -- Editorial Office Guide 2015.
Distributed Systems Lecture 6 Global states and snapshots 1.
OPS Requirements Specification and Analysis Dustin Larson Bryan Campbell Charles Sears.
Principles of Programming & Software Engineering
Synthesis for Verification
Principles of Programming and Software Engineering
For any QuickBooks user who aspires to work on payroll, it is quite essential to at least know how one gets started with QuickBooks payroll. We will now.
Aspect Validation: Connecting Aspects and Formal Methods
Greta Mameniskyte IV course 3rd group
Presentation transcript:

1 Incremental Analysis of Interference Among Aspects Authors: Emilia Katz, Shmuel Katz The Technion

2 Motivation Multiple aspects are often woven into the same system => Unintended interactions among the aspects may occur, even if each aspect is “correct” when woven alone Libraries of reusable aspects (example: a library implementing the ACID properties for transactional objects) => Usage guidelines for the participating aspects are needed

3 New Interference Type Previously defined interference types: Interference caused by - Common join-points Updating shared variables Changing join-points  Not enough!  More general definition is needed! Interference caused by the semantics of the aspects! example – soon!

4 Aspect Specifications Specification of aspect A is (P A, R A ) The principle: assume – guarantee (generalized) A assumes: P A holds in the base system –what’s true at joinpoints –global properties of base system –properties of aspect parameters A guarantees: R A is true in the woven system –new properties added by A –properties of base system maintained in woven system What is a “correct” aspect? Pair of LTL formulas in any reasonable base system for A unusual! in any woven system with A possibly global ! prior work … because model- checking is used in proof method automatization …

5 Semantic Interference Among Aspects One aspect “causes” another to not give the desired result (violate its guarantee): Aspect A satisfies its specification (P A, R A ) Aspect B satisfies its specification (P B, R B ) Base system satisfies both P A and P B pairwise definition; will be generalized to N aspects…

6 Aspect Interference A, B – aspects; S – underlying system (S + A) +B  WRONG S + A  OK OR (S + B) +A  WRONG S + B  OK OR S + (A,B)  WRONG From now on: assume all the aspects are “correct” This (“joint”) weaving will be discussed later

7 Interference Example General description: Two aspects – part of a security-aspects library, to be used in password-protected systems Aspect E encrypts passwords Whenever a password is sent from the login screen of the system, it is encrypted (there is also a decryption part, but we ignore it here) Aspect F for retrieving forgotten passwords Adds a button to report that the password is forgotten. When the button is pressed, security questions are asked. If the answers are correct, the password is sent to the user.

8 Example Usage: Internet Access to Bank Accounts Underlying system: Internet terminal Server send (login, password) grant_access (info)

9 Adding Password Encryption Aspect E, responsible for encryption. E’s pointcut: a password is sent from login screen E’s assumption, P E : password-containing messages are sent only from login screen E’s guarantee, R E : each time a password is sent, it is encrypted

10 Later addition: aspect F Aspect F, retrieving forgotten passwords: F’s pointcut: “forgot_password” button is pressed F’s assumption, P F : true (no assumption needed) F’s guarantee, R F : each time a password is forgotten, it’s ed to the user, provided the security questions are answered

11 Example – contd.(3) Internet terminal Server send (login, encr(password)) grant_access (info) Unencrypted!!! (S+E)+F: “forgot_psw.” pressed F psw.

12 Cause of the problem Common join-points? – No. Updating shared variables? – No. Changing join-points? – Not as written. The semantics of E and F? – Yes! 1. The presence of F (resulting in ed passwords) violates the guarantee of E (all passwords encrypted)  F cannot be woven after E. 2. The presence of F ( ed passwords) violates the assumption of E (passwords sent from Login Screen only)  E cannot be woven after F

13 Semantic Interference – more formally A – aspect, specified by (P A, R A ) B – aspect, specified by (P B, R B ) Definition: A does not interfere with B if for every system S, (*) (*) Notation: OK AB We assume both aspects are correct both assumptions hold both guarantees hold

14 Non-Interference in a Library Generalization of the definition to a library of N aspects: The aspect library is interference free if for every subset of the aspects, when they are woven into a system that satisfies all their assumptions, the resulting system satisfies all the guarantees We detect interference or prove interference-freedom using model-checking, where advice is modeled as state-transition system

15 Proving Non-Interference Need to prove: OK AB and OK BA Intuitive method: Direct proof. For every system S satisfying P A ∧ P B, show that ((S+A)+B) and ((S+B)+A) satisfy R A ∧ R B But: What about N aspects in a library? Pairwise checks are not enough! Need to prove for every subset of aspects separately! (for all the subsets of 2,3,…N aspects)

16 Incremental Non-Interference Proof Theorem (dividing the proof task): To prove OK AB, it’s enough to show [KP AB ] And [KR AB ] A keeps the assumption of B B keeps the guarantee of A

17 The Incremental Method Generalizes to N If N aspects pairwise satisfy KP and KR in both directions, for any combination of m ≤ N aspects from that set, there is no semantic interference. Each one preserves the assumption and guarantee of all the others, so no matter how many are applied, all guarantees will hold if all assumptions held in the base The above generalization does NOT hold for the Direct method. example – soon!

18 Adding an Aspect to a Library A P A, R A A1 P A1, R A1 A2 P A2, R A2 An P An, R An … ? ? … ? A PA,RAPA,RA A1, A2, … An A, A1, A2, … An counterexample unavoidable interference all checks succeeded or check failed ; - pairwise interference checks, based on model-checking library of aspects new aspect A’s assume- guarantee specification extended library (A added) error analysis guidelines refinement usage guidelines: interference free subsets; permissible weaving orders extended (including A) “offline ” checks!

19 Non-generalization of Direct: Example Aspect A: Encrypts “secret” data sent in the system –In the bank system, encrypts passwords sent from login screen Aspect B: Adds a possibility to “remember” the password of the user –Adds a private variable “password” to the User class, and stores the password there if needed. Aspect C: “Publishes” data of specified non-secret objects [objects with no “secret” fields] – sends all the object data (including private fields) upon request. –In the bank system – sends user data.

20 Aspect Specifications: Aspect A: –Assumes the password are the only type of secret data, and the passwords are sent only from the login screen –Guarantees all the secret data is sent encrypted Aspect B: –Assumes nothing (adds the “save_password” button itself) –Guarantees the password is stored in the user data if it was requested Aspect C: –Assumes user objects store no secret data –Guarantees all stored user data is sent

21 Interference? Incremental method: –Verification of KP BC fails –Interference among the aspects is detected by pairwise checks alone. Direct method: –All pairwise interference checks succeed! –But: the aspects do interfere when all three are applied! Aspect C violates the guarantee of A, by sending passwords unencrypted after B saves them. How??? – C’s assumption is only checked for the original base system, not for the system with B woven problem! B violates C’s assumption: password might be “secret”

22 Feasibility of Composition A – aspect, specified by (P A, R A ) B – aspect, specified by (P B, R B ) Definition: composition of A before B is feasible iff all the following formulas are satisfiable: P A ⋀ P B (the assumptions are not contradictory) R A ⋀ P B (the guarantee of A and the assumption of B) R A ⋀ R B (the guarantees are not contradictory) ≡ non- contradicting specifications

23 Feasibility Check Recommended to perform in case interference was detected Might be performed even before the verification starts, but is not essential Is easier and quicker than the full verification process If fails – the aspects can not be woven together into a system without changing their specifications (and maybe also their advice)

24 Automatic and Modular Interference Detection Both for Direct and Incremental method The MAVEN tool – extended: improved and adopted for interference-detection purpose Original purpose of MAVEN: automatic modular verification of assume-guarantee aspect specifications

25 Strategy – MAVEN tool Build a “generic” state machine version (T P ) of assumption P A (called “tableau”) Weave the aspect (A) into this model Prove that this augmented generic model (T P +A) satisfies the desired result, R A TψTψ TPTP TψTψ representation of all the possible systems satisfying P A by running NuSMV model-checker prior work

26 Direct Proof Method 1. Build tableau T for P A  P B 2. Use MAVEN to prove OK AB - weave A into T, then weave B - show R A  R B on the result 3. Use MAVEN to prove OK BA - weave B into T, then weave A - show R A  R B on the result

27 Incremental Proof Method Verify KP AB, KR AB, KP BA, KR BA : 1.Use MAVEN to prove KP AB - build tableau T P for P A  P B - weave A into T P - show P B on the result 2. Use MAVEN to prove KR AB - build tableau T R for R A  P B - weave B into T R - show R A on the result 3, 4 (for KP BA, KR BA ) – symmetric (  OK BA )  OK AB A maintains the assumption of B B maintains the guarantee of A

28 Incremental method – advantages beyond generalization to N 1.Easier weaving 2.Quicker verification 3.Incremental verification during library construction, and not when a system is run: When adding an aspect to the library, allows checking only the new aspect vs. all the rest 4. Advantage in failure analysis: Depending on the verification step at which we obtained the counterexample, we will know exactly which aspect caused interference and how (= which property was violated) Cause: smaller models and TL formulas => lower complexity

29 Error Analysis Who is guilty (failure localization), and what is to be done (failure treatment)? Failure localization: Which assertion was violated? Which aspect is responsible for the failure? Failure treatment: Should the specification of any aspects be changed? Should some advice be changed?

30 Failure Localization In Direct method – problematic. In Incremental method – straightforward: – Immediately follows from the verification stage that failed : KP AB failed => A’s advice violates B’s assumption. KR AB failed => B’s advice violates A’s guarantee –Possible to detect and localize multiple failures (i.e., when both properties are violated)

31 Failure Treatment Feasibility check fails => –Specifications have to be changed –Advice implementation might have to be changed Feasibility check succeeds => –Advice implementation has to be changed –Specifications might have to be changed Failure elimination impossible => Usage guidelines for the aspects (restrictions on the possible weaving order)

32 Bank System Example - Reminder S: system providing internet access to bank accounts. Involves sending passwords from “login” screen E: aspect in charge of encrypting the passwords sent from login screens F: aspect in charge of retrieving forgotten passwords; sends them by

33 Bank system – Verification Failures KR EF fails  F can not be woven after E, because it does not preserve the guarantee of E, R E (the ed password will be unencrypted) KP FE fails  F can not be woven before E, because F violates the assumption of E, P E (the passwords are sent not only from the “login” screen)

34 Bank system – Error Analysis Example: KP FE check failed, but Feasibility check succeeds Possible solution: Change the advice of F! –For example: Change F to bring the user to a login screen and offer to enter the new password –Result: Specifications stay the same, but OK FE now holds, so we can weave F before E (but not the reverse)

35 Joint Weaving At every point of the program decides which of the aspects to apply and in which order When is joint weaving equivalent to sequential? –(S + (A,B)) ≡? ((S+A)+B) –(S + (A,B)) ≡? ((S+B)+A)

36 Joint Vs. Sequential Weaving - 1 Notation: J A (S) = set of join-points of A in S If: J A (S) ∩ J B (S) = ∅ J A (S+B) = J A (S) => J B (S+A) = J B (S) Then: (S + (A,B)) ≡ ((S+A)+B) ≡ ((S+B)+A) A and B have no common join-points B does not affect the set of A’s join-points A does not affect the set of B’s join-points Both orders of sequential weaving are equivalent to the joint weaving

37 Joint Vs. Sequential Weaving - 2 If: J A (S) ∩ J B (S) = ∅ J A (S+B) = J A (S) => J B (S) ⊆ J B (S+A) ⊆ J B (S) ∪ S A Then: (S + (A,B)) ≡ ((S+A)+B) A and B have no common join-points B does not affect the set of A’s join-points A does not remove join- points matched by B A might add join-points matched by B, but only inside A’s advice Joint weaving of A and B is equivalent to first weaving A and then B

38 Interference Detection in Java Systems Work in progress : industrial case study Toll System (Siemens) – charging for road use –Formalization of aspect specifications –Translating advice to transition systems –Verification of aspects and interference detection Intermediate results: –Interference between two aspects found and is being analyzed now

39 Interference Detection in Java Systems(2) Planned: case study based on library of reusable aspects that implement ACID properties for transactional objects Large library of aspects, intended to be used as benchmark Authors state there is interference between the aspects Goal: formalization, analysis => interference warnings and non-interference proofs for the aspects => usage guidance for the library atomicity consistency isolation durability

40 More Work in Progress Generalizing the proof method –More weaving strategies –Extending MAVEN Refining the error analysis Running more complicated examples The formalization and proof method can be extended to treat other types of aspect interactions, such as cooperation [one aspect establishes the assumption of another…]

41 Summary Semantic interference among aspects is defined Interference-detection method is modular and incremental Verification result is not “yes” or “no”! The method gives usage guidelines for the library For any comments / questions, please write to new!

Thank you!