Presentation is loading. Please wait.

Presentation is loading. Please wait.

Click to edit Master text styles JavaMOP Hamid Reza Niroomand A presentation to Dr. Babamir.

Similar presentations


Presentation on theme: "Click to edit Master text styles JavaMOP Hamid Reza Niroomand A presentation to Dr. Babamir."— Presentation transcript:

1 Click to edit Master text styles JavaMOP Hamid Reza Niroomand A presentation to Dr. Babamir

2 Click to edit Master text styles RV Conference Background The Runtime verification workshop series was initiated in 2001, and workshops have occurred each year since then. The objective of these events is to bring scientists from both academia and industry together to debate on how to monitor, analyze and guide the execution of programs Starting with year 2010, RV has become an international yearly conference. http://runtime-verification.org/

3 Click to edit Master text styles

4

5

6

7 RV Conference Runtime Verification (RV) has become a mature field within the last decades. It aims at checking correctness properties based on the actual execution of a software or hardware system. Runtime Verification is about Monitoring. Monitoring Specifications Runtime Verification

8 Click to edit Master text styles RV Conference Debugging Development Error messages Testing Development Error messages Security/Reliability/Robustness/… Production Recovery mechanisms Programming Paradigm Production General actions Applications of Runtime Verification

9 Click to edit Master text styles RV Conference Runtime Verification Systems (a few of them) ≤ 2001 MAC (UPenn), PAX (NASA), TimeRover (commercial) 2002-2004 HAWK/Eagle (NASA), MOP (UIUC), POTA (UTA) ≥ 2005: PQL (Stanford) Tracematches (Oxford) PTQL (Berkeley/Stanford/Novell) Pal (UPenn) RuleR (Manchester) … many others

10 Click to edit Master text styles AOP AOP stands for Aspect Oriented Programming AOP is not a complete new approach It is a new branding system of some old ideas… AOP important concepts: Cross Cutting Concern Advice Pointcut Aspect

11 Click to edit Master text styles AOP Most classes in an OO application perform a single specific function this is their main functionality. Those same classes also share common secondary functionality with other classes in the application (for example logging, or security,… are secondary functionality needed by most classes within an application) Cross Cutting Concern is the secondary functionality needed by most classes in an app. (e.g. logging is a Cross Cutting Concern. Essentially, the horizontal application of logging is a cross cutting concern…) What is Cross Cutting Concern?

12 Click to edit Master text styles AOP The term Advice in AOP refers to the code executed when the aspect is invoked In a logging example, an Advice is the logging code that is applied whenever a method is entered or exited if entry or exit is logged… What is an Advice?

13 Click to edit Master text styles AOP The Pointcut is the point of execution in an application where cross cutting concerns are applied. For the logging example, where entry and exit of methods are logged, the Pointcuts are essentially the point of entry and exit of methods where the cross cutting concern pf logging needs to be applied through a logging advice. What is Pointcut?

14 Click to edit Master text styles AOP The Aspect is the combination of pointcuts and advice. For example a logging Aspect can be added to an application, by defining pointcut(s) within the app. And giving the needed advice, when those pointcuts are reached. What is Aspect?

15 Click to edit Master text styles Demo

16 Click to edit Master text styles How to install AspectJ on Eclipse? 1.Download JRE and JDK (x64) and install [Copy java.exe and javac.exe path to “path” environment variable] 1.http://www.oracle.com/technetwork/java/javase/downloads/index.htmlhttp://www.oracle.com/technetwork/java/javase/downloads/index.html 2.Run “java -version“ and “javac -version“ to ensure they are installed correctly 2.Download Eclipse (x64) and extract it somewhere [note: download a version that AspectJ supports it…] 1.http://www.eclipse.org/http://www.eclipse.org/ 3.Copy javaw.exe from JRE installation path to root of Eclipse 4.Download ajdt and copy “features” and “plugins” folders to Eclipse folder 1.http://www.eclipse.org/ajdt/downloads/http://www.eclipse.org/ajdt/downloads/ Follow me:

17 Click to edit Master text styles

18 How to install AspectJ on Eclipse? 1.Download JRE and JDK (x64) and install [Copy java.exe and javac.exe path to “path” environment variable) 1.http://www.oracle.com/technetwork/java/javase/downloads/index.htmlhttp://www.oracle.com/technetwork/java/javase/downloads/index.html 2.Run “java -version“ and “javac -version“ to ensure they are installed correctly 2.Download Eclipse (x64) and extract it somewhere [note: download a version that AspectJ supports it…] 1.http://www.eclipse.org/http://www.eclipse.org/ 3.Copy javaw.exe from JRE installation path to root of Eclipse 4.Download ajdt and copy “features” and “plugins” folders to Eclipse folder 1.http://www.eclipse.org/ajdt/downloads/http://www.eclipse.org/ajdt/downloads/ Follow me:

19 Click to edit Master text styles

20 Demo

21 Click to edit Master text styles Monitoring-Oriented Programming Monitoring is well-adopted in many engineering disciplines Fuses, watchdogs, fire-alarms, etc. Monitoring adds redundancy Increases reliability, robustness and confidence in correct behavior, reduces risk Provably correct systems can fail, too Unexpected environment, wrong/strong assumptions, hardware or OS errors, etc. Why Monitoring?

22 Click to edit Master text styles Monitoring-Oriented Programming Monitoring-Oriented Programming, abbreviated MOP, is a software development and analysis framework aiming at reducing the gap between formal specification and implementation by allowing them together to form a system. In MOP, runtime monitoring is supported and encouraged as a fundamental principle for building reliable software: monitors are automatically synthesized from specified properties and integrated into the original system to check its dynamic behaviors during execution. When a specification is violated or validated at runtime, user-defined actions will be triggered, which can be any code from information logging to runtime recovery. What is MOP?

23 Click to edit Master text styles Monitoring-Oriented Programming Observe a run of a system Requires instrumentation Can be offline or online Check it against desired properties Specified using patterns or in a logical formalism React/Report (if needed) Error messages Recovery mechanisms General code What MOP Supports

24 Click to edit Master text styles

25 Instances of MOP * The rows show instances by the language and the columns instances by the logic

26 Click to edit Master text styles How JavaMOP works JavaMOPAspectJ under the hood

27 Click to edit Master text styles JavaMOP Syntax

28 Click to edit Master text styles JavaMOP Syntax Cont’d

29 Click to edit Master text styles JavaMOP Example

30 Click to edit Master text styles

31 How to install JavaMOP? 1.Download AspectJ and install it: 1.java -jar aspectj-1.8.7.jar 2.Copy AspectJ path to Path Environment variable 3.Create a CLASSPATH variable and Add ` /lib/aspectjrt.jar`, ` /lib/aspectjweaver.jar` and ` /lib/aspectjtools.jar` to your CLASSPATH. 4.Download RV-Monitor and type in cmd: java – jar “path-to-/rv-monitor-installer-1.3.jar” and install it… [You need a Key which should be created from RV-Monitor website] 1.https://runtimeverification.com/monitorhttps://runtimeverification.com/monitor 5.Add "C:\RV-Monitor\bin" to “Path” Environment variable and run “rv-monitor - version” to ensure it is installed correctly. 6.Add this to your CLASSPATH: 1.C:\RV-Monitor\lib\rv-monitor.jar;C:\RV- Monitor\lib\rv-monitor-rt.jar;C:\RV- Monitor\lib\aspectjweaver.jar 7.Download JavaMOP and extract it: 1.https://github.com/runtimeverification/javamophttps://github.com/runtimeverification/javamop 8.add ` /bin` to your PATH. 9.Check JavaMOP is installed properly: run `javamop` from a terminal. Follow me:

32 Click to edit Master text styles Demo


Download ppt "Click to edit Master text styles JavaMOP Hamid Reza Niroomand A presentation to Dr. Babamir."

Similar presentations


Ads by Google