Using AspectJ to Collect Value Spectra - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Using AspectJ to Collect Value Spectra

Description:

Value Spectra. Follow the Xie and Notkin approach ... Apply the collected value spectra to invariant detection techniques. Mohamed Mansour ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 24
Provided by: mans96
Category:

less

Transcript and Presenter's Notes

Title: Using AspectJ to Collect Value Spectra


1
Using AspectJ to Collect Value Spectra
  • Mohamed Mansour
  • SATM 2003

2
Outline
  • Value Spectra
  • Empirical Evaluation
  • Future Work
  • QA

3
Value Spectra
  • Value spectra is the range of values program
    variables acquire during program execution
  • Used in
  • Invariant detection
  • Fault detection and localization
  • Other uses?

4
Value Spectra
  • Follow the Xie and Notkin approach
  • Log values of all arguments at function entry and
    exit (include global variables)

5
Challenges
  • OO languages
  • Encapsulation
  • Polymorphism
  • Dynamic Binding
  • Exceptions
  • Size of log files
  • Performance overhead

6
Solution
  • AspectJ
  • Efficient Encoding Techniques

7
AspectJ
  • An open source extension to Java
  • Java-like syntax for inserting code blocks at
    arbitrary program points
  • Call sites
  • Return sites
  • Exception throw and catch sites
  • And more
  • Byte-code weaving using the ajc compiler

8
Encoding - Plain Format
  • Log fully qualified function name
  • Log values of each variable on the argument list
  • On entry
  • On exit
  • Log return value (if any)

9
Object Logging
  • Log values of each data member
  • Primitive data types are logged as is
  • Object data members are recursively logged using
    the same approach

10
Example I
int foo (SimpleClass arg1) arg1._a 5
arg1._b 10 return 25
//SimpleClass x x._a 0 x._b 0 foo(x)
class SimpleClass int _a int _b
int fooClass.foo(SimpleClass) SimpleClass0,
0SimpleClass SimpleClass5, 10SimpleClass 25
11
Example II
int bar (ComplexClass arg1) arg1._sc._a
5 arg1._sc._b 10 arg1._f 20.5
return 25
//ComplexClass x x._sc._a 0 x._sc._b
0 x._f 0 foo(x)
class SimpleClass int _a int _b
class ComplexClass SimpleClass _sc float
_f
int barClass.bar(ComplexClass) ComplexClassSimp
leClass0, 0SimpleClass, 0.0ComplexClass Comp
lexClassSimpleClass5, 10SimpleClass,
20.5ComplexClass 25
12
Encoding Other techniques
  • Factorize long strings, save them to external
    files
  • Log the index of a string instead of the full
    string

13
Factorization Function Signature
int fooClass.foo(SimpleClass) SimpleClass0,
0SimpleClass SimpleClass5, 10SimpleClass 25
int barClass.bar(ComplexClass) ComplexClassSimp
leClass0, 0SimpleClass, 0.0ComplexClass Comp
lexClassSimpleClass5, 10SimpleClass,
20.5ComplexClass 25
0 SimpleClass0, 0SimpleClass SimpleClass5,
10SimpleClass 25 1 ComplexClassSimpleClass0,
0SimpleClass, 0.0ComplexClass ComplexClass
SimpleClass5, 10SimpleClass,
20.5ComplexClass 25
14
Factorization Class Signature
0 SimpleClass0, 0SimpleClass SimpleClass5,
10SimpleClass 25 1 ComplexClassSimpleClass0,
0SimpleClass, 0.0ComplexClass ComplexClass
SimpleClass5, 10SimpleClass,
20.5ComplexClass 25
SimpleClass ComplexClass
0 00, 00 05, 100 25 1 100, 00,
0.01 105, 100, 20.51 25
15
Factorization Object Signature
0 00, 00 05, 100 25 1 100, 00,
0.01 105, 100, 20.51 25
00, 00 05,100 1lt0gt, 0.01 1lt1gt,
20.51
0 lt0gt lt1gt 25 1 lt2gt lt3gt 25
16
Evaluation
  • Quasi Experiment
  • What is the most effective encoding technique
  • Single subject Nano-XML 2.2.3
  • Control variable
  • encoding technique
  • Dependent variables
  • files size
  • runtime performance

17
Size of Log Files
18
Runtime Performance
19
Stats
  • Total methods 257
  • Total method calls 8279
  • Jar file before weaving41305
  • Jar file after weaving 70069

20
Future Work
  • Log values of global variables
  • Handle container objects
  • Experiment with larger programs from several
    domains
  • Compare to byte-code rewriting techniques
  • Apply the collected value spectra to invariant
    detection techniques

21

Q A
22
public aspect BaseAspect pointcut myTrace()
within(BaseAspect) pointcut javaCode()
within(java..)
call( java..(..)) pointcut methodExec()
execution( net..(..))
!javaCode() !myTrace() before
() methodExec() String enter
getValueSpectra(thisJoinPoint)
stack.push(enter) after () returning
(Object t) methodExec() String enter
stack.pop() String exit
getValueSpectra(thisJoinPoint, t)
log(enter, exit)
23
Micro Benchmarks
Write a Comment
User Comments (0)
About PowerShow.com