Aspect-Oriented Software Development (AOSD) Tutorial #5 Categories of Aspects – contd.; LTL properties formalization; Assume – guarantee specifications.

Slides:



Advertisements
Similar presentations
Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
The Point Class public class Point { public double x; public double y; public Point(double x0, double y0) { x = x0; y = y0; } public double distance(Point.
Problem Solving 5 Using Java API for Searching and Sorting Applications ICS-201 Introduction to Computing II Semester 071.
Introduction to C# Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
1 CS2200 Software Development Lecture: Testing and Design A. O’Riordan, 2008 K. Brown,
Java.sun.com/javaone/sf | 2004 JavaOne SM Conference | Session BUS JavaOne 2004 What is AOP? Gregor Kiczales AspectMentor.com and University of.
359C 10/1/05 Eric Wohlstadter Introductions –Name –Degree objective/Year –Research Area (or interests) Syllabus Aspect-Oriented Programming –AspectJ –AspectC.
Aspect-Oriented Software Development (AOSD) Tutorial #2 AspectJ Basics.
1 Software Testing and Quality Assurance Lecture 23 – JUnit Tutorial.
Aspect-Oriented Software Development (AOSD) Tutorial #4 Categories of Aspects.
Aspect-Oriented Software Development (AOSD) Tutorial #7 Assume – guarantee specifications; EAOP.
Aspect-Oriented Software Development (AOSD) Tutorial #5 Categories of Aspects – contd.; LTL properties formalization.
Writing methods and Java Statements. Java program import package; // comments and /* … */ and /** javadoc here */ public class Name { // instance variables.
Aspect-Oriented Software Development (AOSD) Tutorial #4 Categories of Aspects.
Aspect-Oriented Software Development (AOSD) Tutorial #8 Composition Filters.
Random (1) Random class contains a method to generate random numbers of integer and double type Note: before using Random class, you should add following.
Aspect-Oriented Software Development (236601) 1 Home Assignment (what, where and when)
Aspect-Oriented Software Development (AOSD) Tutorial #2 AspectJ Basics.
Copyright 2006 by Pearson Education 1 Building Java Programs Chapter 8: Classes and Objects.
Software modularity group Gregor Kiczales Professor and NSERC/Xerox/Sierra Systems Software Design Chair University of British Columbia Principal Scientist.
Review. By the end of today you should be able to- Know how to use args Know how to use the JOptionPane Know how to convert a String to a number.
Aspect-Oriented Software Development (AOSD) Additional Tutorial.
Aspect-Oriented Software Development (AOSD) Tutorial #6 Categories of Aspects – contd.; LTL properties formalization; Assume – guarantee specifications.
Aspect-Oriented Software Development (AOSD) Tutorial #3 AspectJ - continued.
Aspect-Oriented Software Development (236608) 1 Aspect-Oriented Software Development (AOSD) Tutorial #1 Course site :
Aspect-Oriented Software Development (AOSD) Tutorial #9 Modular Verification of Aspects.
Aspect-Oriented Software Development (AOSD) Tutorial #5 Categories of Aspects – contd.; LTL properties formalization.
Aspect-Oriented Software Development (AOSD) Tutorial #7 Assume – guarantee specifications; EAOP.
Aspect-Oriented Software Development (AOSD) Tutorial #3 AspectJ - continued.
Aspect-Oriented Software Development (AOSD) Tutorial #9 Modular Verification of Aspects.
16-Aug-15 Java Puzzlers From the book Java Puzzlers by Joshua Bloch and Neal Gafter.
AIXM Viewer Implementation Presentation to AIXM Users’ Conference, Federal Aviation Administration, Washington D.C., Feb 27-March 1, By: Mark Austin,
Outline Introduction Problem Statement Object-Oriented Design Aspect-Oriented Design Conclusion Demo.
Writing Classes (Chapter 4)
1 Inheritance and Subclasses Instructor: Mainak Chaudhuri
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 2.
Aspect Oriented Programming Gülşah KARADUMAN.
Copyright 2008 by Pearson Education Building Java Programs Chapter 8 Lecture 8-3: Encapsulation, this reading: self-checks: #13-17 exercises:
Kiczales and Mezini - FOAL AOP and Modular Reasoning [ICSE05] Start with first-principles definition of modularity and modular reasoning –localization,
Using Data Within a Program Chapter 2.  Classes  Methods  Statements  Modifiers  Identifiers.
AOSD1 Aspect-Oriented Software Design Karl Lieberherr Theo Skotiniotis.
Aspect-Oriented Programming and Modular Reasoning G. KiczalesM. Mezini Presented by Alex Berendeyev.
1 Modularization of crosscutting concerns Write this public class Shape { protected double x_= 0.0, y_= 0.0; protected double width_=0.0, height_=0.0;
1 Contract-based Verification for Aspect-oriented Refactoring Naoyasu Ubayashi(Kyushu Institute of Technology) Jinji Piao(Kyushu Institute of Technology)
Alloy-based Lightweight Verification for Aspect-oriented Architecture Naoyasu Ubayashi(Kyushu Institute of Technology) Yuki Sato(Kyushu Institute of Technology)
Review TEST 2 Chapters 4,5,7. QUESTION For which type of operands does the == operator always work correctly: (a) int, (b) double, or (c) String?
AOP and observer pattern. Design pattern General reusable solution to a commonly occurring problem in software design Not a finished design that can be.
ITI 1120 Lab #3 Tracing and Branching Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot.
CS305j Introduction to Computing Classes II 1 Topic 24 Classes Part II "Object-oriented programming as it emerged in Simula 67 allows software structure.
FOR LOOP WALK THROUGH public class NestedFor { public static void main(String [] args) { for (int i = 1; i
Interfaces An interface is like an extreme case of an abstract class – However, an interface is not a class – It is a type that can be satisfied by any.
Review Creating Objects Pepper many references from rial/java/objects/object.html
Building java programs, chapter 3 Parameters, Methods and Objects.
Announcements Final Exam: TBD. Static Variables and Methods static means “in class” methods and variables static variable: one per class (not one per.
CSC450 Software Engineering Devon M. Simmonds University of North Carolina, Wilmington 1.
From Aspectual Requirements to Proof Obligations for Aspect- Oriented Systems Shmuel Katz and Awais Rashid The Technion Lancaster University Haifa, Israel.
Methods What is a method? Main Method the main method is where a stand alone Java program normally begins execution common compile error, trying.
There are three possible lifetime patterns for Java data. Static Data The data is created when the program begins execution and is retained until the program.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Loops, Methods, Classes Using Loops, Defining and Using Methods, Using API Classes, Exceptions, Defining Classes Svetlin Nakov Technical Trainer
Copyright 2010 by Pearson Education Building Java Programs Chapter 8 Lecture 8-3: Constructors; Encapsulation reading: self-checks: #13-18,
An Interface Mechanism for Encapsulating Weaving in Class-based AOP
CSE 8A Lecture 17 Reading for next class: None (interm exam 4)
Building Java Programs
Building Java Programs
class PrintOnetoTen { public static void main(String args[]) {
Building Java Programs
CSE 142 Lecture Notes Defining New Types of Objects, cont'd.
Building Java Programs
Presentation transcript:

Aspect-Oriented Software Development (AOSD) Tutorial #5 Categories of Aspects – contd.; LTL properties formalization; Assume – guarantee specifications

Aspect-Oriented Software Development (236608) 2 Today: Aspects Categories (contd.), LTL properties Base system properties preservation –guaranteed –occasional From natural language to Temporal Logic Assume – guarantee aspects specification Examples

Aspect-Oriented Software Development (236608) 3 Example: Rational Exam (reminder) private void doExam() { while (true) { r1 = randomRational(); r2 = randomRational(); result = r1.add(r2); answer = getAnswer(r1, r2); if (answer == null) break; checkAnswer(answer, result); } public static void main(String[] args) { RationalExam exam = new RationalExam(); exam.doExam(); } The system generates and checks online exams for students with simple arithmetic exercises for fractions RationalExam class: initiates exams, generates questions, accepts answers, checks answers

Aspect-Oriented Software Development (236608) 4 Rational Exam System Properties -1 “After a user answers a question, the system performs correctness check and prints out the result”

Aspect-Oriented Software Development (236608) 5 Rational Exam System Properties -2 “If an answer is a and the fractions in the question – r1 and r2, the correctness check will result in “true” iff a = r1 + r2”

Aspect-Oriented Software Development (236608) 6 Rational Exam – Properties Preservation Categoryφ1φ1 φ2φ2 Exceptions logging Multiplication Normalization Age restriction Grading Factor

Aspect-Oriented Software Development (236608) 7 From natural language to LTL In this example: Specification of events in the system and their relations Examples from the ontology of ARCADE temporal patterns: match patterns with temporal logic formulas

Aspect-Oriented Software Development (236608) 8 From natural language to LTL Temporal pattern (events)Temporal logic E between A and B A during B A before B, B only after A A leads to B C on A and B

Aspect-Oriented Software Development (236608) 9 Example – Toll System (Reminder) The system needs to react in-time in order to: read the gizmo identifier; turn on the light (to green or yellow); display the amount to be paid; photograph the plate number from the rear; sound the alarm; respond to gizmo activation and reactivation.

Aspect-Oriented Software Development (236608) 10 Toll System - Constraint 1

Aspect-Oriented Software Development (236608) 11 Constraint 1 - formalized Temporal Pattern = ? Predicates: Formula:

Aspect-Oriented Software Development (236608) 12 Constraint 1 – formalized – contd. Formalizing outcome action: Predicates: The whole formula:

Aspect-Oriented Software Development (236608) 13 Toll System - Constraint 2

Aspect-Oriented Software Development (236608) 14 Constraint 2 - formalized Temporal Pattern = ? Predicates: Formula:

Aspect-Oriented Software Development (236608) 15 Example Class: Point - reminder class Point { private int x, y; public Point(int x, int y) { this.x = x; this.y = y; } public void setX(int x) { this.x = x; } public void setY(int y) { this.y = y; } public void MoveTo(Point p) {setX(p.x); setY(p.y); } public int getX() { return x; } public int getY() { return y; } }

Aspect-Oriented Software Development (236608) 16 Assume-guarantee spec. 1 Aspect 1: Positive quarter check. After each change in points, check whether they are in the positive quarter of the space pointcut movePoint … //calls to setX(), setY() … pointcut createPoint … //calls to Point(..) after(Point pt, int newArg) returning(): movePoint(pt, newArg) { if( newArg < 0) System.out.println( “…” ); } after(int x, int y) returning(): createPoint(x, y) { if( x < 0 || y < 0) System.out.println( “…” ); }

Aspect-Oriented Software Development (236608) 17 Assume-guarantee spec. 1 – contd. Assumption: Guarantee:

Aspect-Oriented Software Development (236608) 18 Assume-guarantee spec. 2 Aspect 2: Positive quarter enforce. Make sure all the points are in the positive quarter of the space … void around(Point pt, int newArg): movePoint(pt, newArg) { if( newArg >= 0) proceed(pt, newArg); else System.out.println( “…” ); } Point around(int x, int y) : createPoint(x, y) { if( x < 0) { x=0; System.out.println( “…” );} if( y < 0) { y=0; System.out.println( “…” );} proceed(x,y); }

Aspect-Oriented Software Development (236608) 19 Assume-guarantee spec. 2 – contd. Assumption: Guarantee:

Aspect-Oriented Software Development (236608) 20 Assume-guarantee spec. 3 Aspect3: Adding names to points; tracing movements private String Point.name = ""; public String Point.getName() {return name;} public void Point.setName(String newName) {name = newName;} … pointcut moved(Point pt): target(pt) && (call(void setX(int)) || call(void setY(int))); after(Point pt) returning: moved (pt) { System.out.println("Point "+pt.getName()+" moved to ("+pt.getX()+","+pt.getY()+")"); }

Aspect-Oriented Software Development (236608) 21 Assume-guarantee spec. 2 – contd. Assumption: Guarantee: