impact analysis for event-based systems daniel popescu advisor: nenad medvidović march 9, 2010
TRANSCRIPT
Impact Analysis for Event-Based Systems
Daniel PopescuAdvisor: Nenad Medvidović
March 9, 2010
1. Background• Event-Based Architectural Style
Explicit vs. Implicit Invocationpublic class HelloWorld {
public static void main(String[] args) {ConsoleWriter.out("Hello World");
} }
public class HelloWorld {public static void main(String[] args) { Message helloWorld = new Message("Hello World"); MessageHandler.send(helloWorld);}
}
Event Message Routing
Runtime Adaption (1)
Runtime Adaption (2)
Event-Based Application
1. Background• Event-Based Architectural Style• Impact of Changing Procedural Implementations
Impact of Changing Code
Call Graph Dependencies (1)
Call Graph Dependencies (2)
Call Graph Dependencies (3)
1. Background• Event-Based Architectural Style• Impact of Changing Procedural Implementations
2. Impact Analysis in Event-Based Systems• Challenges and Dependence Types
Call Graph Dependencies (4)
Component Interfaces
Vs.
Challenge: Ambiguous Interfaces
public void handle (Notification n){
if (n.name.equals(StateSelector)){…
} else if (n.name.equals(Tick)){
…send(n2);
} }
Interfaces of Event-Based Components need to be recovered
Dependence Types
1. Background• Event-Based Architectural Style• Impact of Changing Procedural Implementations
2. Impact Analysis in Event-Based Systems• Challenges and Dependence Types• Specifying Component State
Challenge of Recovering State Accesspublic class Store {
private Stack s1 = new Stack();
void foo(Stack s2) {s1.push("1");
}
void bar(Stack s2) {s2.push("2");
}}
Specifying and Checking State@ClassStates({
@State(name = "state", inv = "share(s1)")})public class Store {
private Stack s1 = new Stack();
@Share("state")void foo(Stack s2) {
s1.push("1");}
@Pure("state")void bar(Stack s2) {
s2.push("2");}
}
1. Background• Event-Based Architectural Style• Impact of Changing Procedural Implementations
2. Impact Analysis in Event-Based Systems• Challenges and Dependence Types• Specifying Component State• Iterative Data-Flow Analysis
Iterative Data-Flow Analysis • Propagating message through component
statements• Name Checks • Outgoing Messages• State Access
public void handle (Notification n){ if (n.name.equals(StateSelector)){
… } else if (n.name.equals(Tick)){
…send(n2);
} }
Iterative Data Flow Equations
1. Background• Event-Based Architectural Style• Impact of Changing Procedural Implementations
2. Impact Analysis in Event-Based Systems• Challenges and Dependence Types• Specifying Component State• Iterative Data-Flow Analysis• Preliminary Results
Experimental Subjects
Improvement over Black-Box Approach
Including State-Based Dependencies
Only Control-Flow Dependencies
1. Background• Event-Based Architectural Style• Impact of Changing Procedural Implementations
2. Impact Analysis in Event-Based Systems• Challenges and Dependence Types• Specifying Component State• Iterative Data-Flow Analysis• Preliminary Results
Impact Analysis for Event-Based Systems
Daniel [email protected]
http://softarch.usc.edu/~popescu/March 9, 2010