Impact Analysis - PowerPoint PPT Presentation

1 / 92
About This Presentation
Title:

Impact Analysis

Description:

Barbara G. Ryder. Fenil Shah. Frank Tip. Chianti: high-level concept. Inputs: ... [4] Ryder, B., Tip, F. Change impact analysis for object-oriented programs. ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 93
Provided by: urriy
Category:
Tags: analysis | impact | ryder

less

Transcript and Presenter's Notes

Title: Impact Analysis


1
Impact Analysis
University of SaarlandDepartment of Computer
Science
  • Yury Chebiryak
  • urriy_at_wjpserver.cs.uni-sb.de

2
Impact Analysis
  • is often used to assess the effects of a change
    after change has been made
  • is rarely used to predict the effect of change
    before it is instantiated

3
Techniques
4
Dependency-based IA
5
Whole Program Path-Based Dynamic Impact Analysis
  • James Law
  • Gregg Rothermel

6
PathImpact
  • Dynamic
  • Call-based
  • Works on binaries
  • Relatively low cost
  • Relatively low overhead

7
Call Graph
8
Call Graph
B is changed
9
Call Graph
Assumption change in B has a potential impact on
nodes reachable from B
10
Execution Traces (ET)
Run M()
ET M
11
Execution Traces
Run B()
ET MB
12
Execution Traces
Return
ET MBr
13
Execution Traces
Run A()
ET MBrA
14
Execution Traces
Run C()
ET MBrAC
15
Execution Traces
Run D()
ET MBrACD
16
Execution Traces
Return
ET MBrACDr
17
Execution Traces
Run E()
ET MBrACDrE
18
Execution Traces
Return
ET MBrACDrEr
19
Execution Traces
Return
ET MBrACDrErr
20
Execution Traces
Return
ET MBrACDrErrr
21
Execution Traces
Return
ET MBrACDrErrrrx
22
Execution Traces II
  • Single
  • Multiple

MBrACDrErrrrx
MBrACDrErrrrxMBGrrrrxMBCFrrrrx
Programs with loops gt very long trace
23
SEQUITUR algorithm
  • Data compression algorithm by Larus
  • Online
  • Created grammar reproduces trace exactly
  • O(N) running time
  • O(N) size in the worst case
  • O(log N) size in the best case
  • e.g. 2GB trace ? 100 MB

24
SEQUITUR algorithm
  • algorithm SEQUITUR( S )
  • input Execution Trace S
  • output Grammar G
  • Grammar G
  • Rule T
  • 1. for each token in S
  • 2. append token to end of production for T
  • 3. if duplicate digram appears
  • 4. if other occurrence is a rule g in G
  • 5. replace new digram with non-terminal of g.
  • 6. else
  • 7. form a new rule and replace duplicate
  • 8. digrams with the new non-terminal.
  • 9. if any rule in G is used only once
  • 10. remove the rule by substituting the
    production.
  • 11. return G

25
SEQUITUR example
  • ET MBrACDrErrrrxMBGrrrrxMBCFrrrrx

26
SEQUITUR example
  • ET MBrACDrErrrrxMBGrrrrxMBCFrrrrx

T ? MBrACDrErrrrx
27
SEQUITUR example
  • ET MBrACDrErrrrxMBGrrrrxMBCFrrrrx

T ? MBrACDrE x 1 ? rr
1
1
28
SEQUITUR example
  • ET MBrACDrErrrrxMBGrrrrxMBCFrrrrx

T ? MBrACDrE11x 1 ? rr
29
SEQUITUR example
  • ET MBrACDrErrrrxMBGrrrrxMBCFrrrrx

T ? MBrACDrE11xM 1 ? rr
30
SEQUITUR example
  • ET MBrACDrErrrrxMBGrrrrxMBCFrrrrx

T ? rACDrE11x 1 ? rr
MB
MB
31
SEQUITUR example
  • ET MBrACDrErrrrxMBGrrrrxMBCFrrrrx

T ? rACDrE11x 1 ? rr 2 ? MB
2
2
32
SEQUITUR example
  • ET MBrACDrErrrrxMBGrrrrxMBCFrrrrx

T ? 2rACDrE11x2 1 ? rr 2 ? MB
33
SEQUITUR example
  • ET MBrACDrErrrrxMBGrrrrxMBCFrrrrx

T ? 2rACDrE113G43CF4rx 1 ? rr 2 ? MB 3 ? x2 4 ?
1r
grammar gt whole path DAG
34
Whole path DAG
35
PathImpact
36
PathImpact
37
PathImpact
PathImpact(E) I ?E
I
Returns0
38
PathImpact
PathImpact(E) up(T, E)
I E
Returns0
39
PathImpact
PathImpact(E) forward(1)
I E
Returns0
40
PathImpact
PathImpact(E) forward(r)
I E
Returns0
41
PathImpact
PathImpact(E) Returns
I E
Returns0
42
PathImpact
PathImpact(E) forward(r)
I E
Returns1
43
PathImpact
PathImpact(E) Returns
I E
Returns1
44
PathImpact
PathImpact(E) after forward(1)
I E
Returns4
45
PathImpact
PathImpact(E) forward(3) -gt x
I E
Returns4
46
PathImpact
PathImpact(E) backward(r)
I E
Returns4
Skip0
47
PathImpact
PathImpact(E) Skip
I E
Returns4
Skip0
48
PathImpact
PathImpact(E) backward(D)-gtSkip--
I E
Returns4
Skip1
49
PathImpact
PathImpact(E) backward(C)-gt I I U
C, Returns--
I E
Returns4
Skip0
50
PathImpact
PathImpact(E) backward(A)-gt I I U
A, Returns--
I E, C
Returns3
Skip0
51
PathImpact
PathImpact(E) backward(r)-gtSkip
I E, C, A
Returns2
Skip0
52
PathImpact
PathImpact(E) after backward(2)
I E, C, A, M
Returns1
Skip0
53
Chianti A Tool for ChangeImpact Analysis of
Java Programs
  • Ophelia Chesley
  • Xiaoxia Ren
  • Barbara G. Ryder
  • Fenil Shah
  • Frank Tip

54
Chianti high-level concept
  • Inputs
  • test suite T
  • original version of code
  • edited version of code

55
Chianti high-level concept
  1. set of interdependent atomic changes A

56
Chianti high-level concept
  1. set of interdependent atomic changes A
  2. call graph for each test in T

57
Chianti high-level concept
  1. set of interdependent atomic changes A
  2. call graph for each test in T
  3. Tґ? T potentially affected by c?A

58
Chianti high-level concept
  1. set of interdependent atomic changes A
  2. call graph for each test in T
  3. Tґ? T potentially affected by c?A
  4. for ti?Tґ determine Aґ?A that may have affected ti

59
Chianti high-level concept
  1. set of interdependent atomic changes A
  2. call graph for each test in T
  3. Tґ? T potentially affected by c?A
  4. for ti?Tґ determine Aґ?A that may have affected ti

determine subset of methods affected by a set of
changes
isolate subset of changes that affect a given
test
60
Chianti architecture
61
Chianti architecture
62
Chianti architecture
63
Example original version
  • class A
  • public A()
  • public void foo ()
  • class B extends A
  • public B()
  • public void foo()
  • class C extends A
  • public C()

64
Example changed version
65
Example tests
  • class Tests
  • public static void test1()
  • A a new A()
  • a.foo()
  • public static void test2()
  • A a new B()
  • a.foo()
  • public static void test3()
  • A a new C()
  • a.foo()

66
Review Atomic Changes
Change Description
AC Add an empty class
DC Delete an empty class
AM Add an empty method
DM Delete an empty method
CM Change body of a method
LC Change virtual method lookup
AF Add a field
DF Delete a field
67
Review Atomic Changes II
Change Description
CFI Change definition of an instance field initializer
CSFI Change definition of a static field initializer
AI Add an empty instance initializer
DI Delete an empty instance initializer
CI Change definition of an instance initializer
ASI Add an empty static initializer
DSI Delete an empty static initializer
CSI Change definition of a static initializer
68
Example Step 1
69
Example Step 1
70
Example Step 1
71
Example Step 1
72
Example atomic changes
73
Recall high-level concept
  1. set of interdependent atomic changes A
  2. call graph for each test in T
  3. Tґ? T potentially affected by c?A
  4. for ti?Tґ determine Aґ?A that may have affected ti

74
Example affected tests
  • A test is affected if its call graph contains
  • node that corresponds to CM or DM, or
  • edge that corresponds to LC

75
Example affected tests
76
Example test1
void test1() A a new A() a.foo()
77
Example test2
void test2() A a new B() a.foo()
78
Example test3
void test3() A a new C() a.foo()
79
Recall high-level concept
  1. set of interdependent atomic changes A
  2. call graph for each test in T
  3. Tґ? T potentially affected by c?A
  4. for ti?Tґ determine Aґ?A that may have affected ti

80
Example affecting changes
  • The set of atomic changes that affect a given
    affected test includes
  • all atomic changes for nodes with AM and CM,
  • atomic changes in LC category, and
  • their transitively prerequisite atomic changes

81
Example affecting changes
82
Example AffectingChanges(test2)
83
Example AffectingChanges(test2)
84
Example
Remember the atomic change
This atomic change does not affect any of the
tests gt additional tests are needed.
85
Snapshot
86
Chianti Evaluation
Number of atomic changes between each pair of
Daikon versions.
87
Chianti Evaluation
Categorization of the atomic changes.
88
Chianti Evaluation
Percentage of affected tests for each of the
Daikon versions.
89
Chianti Evaluation
Average percentage of affecting changes, per
affected test.
90
Summary
  • PathImpact
  • dynamic uses dynamic traces
  • online
  • works on binaries
  • Chianti
  • uses dynamic call graphs
  • applicable for OOP (e.g. Java)
  • determines affecting changes for every test

91
References
  • 1 Chesley, O., Dolby, J., Ren, X., Ryder, B.,
    Shah, F., and Tip, F. Chianti A prototype change
    impact analysis tool for Java. Tech. Rep.
    DCS-TR-533, Rutgers University Department of
    Computer Science, September 2003.
  • 2 Chesley, O., Ren, X., Ryder, B., Shah, F.,
    and Tip, F. Chianti a tool for change impact
    analysis of java programs. In Proceedings of the
    19th annual ACM SIGPLAN Conference on
    Object-oriented programming, systems, languages,
    and applications, pp. 432?448.
  • 3 Law, J., Rothermel, G. Whole program
    Path-Based dynamic impact analysis. In Proc. of
    the 25th International Conference on Software
    Engineering, May 03-10, 2003, Portland, Oregon.
  • 4 Ryder, B., Tip, F. Change impact analysis for
    object-oriented programs. In Proceedings of the
    2001 ACM SIGPLAN-SIGSOFT workshop on Program
    analysis for software tools and engineering, pp.
    46?53, June 2001, Snowbird, Utah, United States.

92
Thanks for listening.Questions?
Write a Comment
User Comments (0)
About PowerShow.com