Your SlideShare is downloading. ×

wtaop.ppt

287
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
287
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Does not have side effects on the objects that exist immediately before the advice is invoked.
  • Transcript

    • 1. A Regression Test Selection Technique for Aspect-Oriented Programs Guoqing Xu The Ohio State University [email_address]
    • 2. Outline
      • background
      • Problem statement and motivation
      • Our analysis
      • Implementation status
      • Related work
    • 3. Regression Test Selection
      • Testing after software modifications
      • Re-running the entire regression test suite is expensive
      • Select a subset of tests to run
      • Safe test selection chooses every test case that may reveal a fault
    • 4. Related Previous Work
      • Rothermel and Harrold, TOSEM 97
        • Graph traversal algorithms
      • Harrold et al., OOPSLA 01
        • Java interclass graph (JIG)
      Copied f rom [Harrold et al., OOPSLA 01] Execute P/ Record Coverage Identify Dangerous Entities Select Tests Program P Program P’ Program P Program P’ P’s Edge Coverage Matrix Dangerous Entities containing edges in P
    • 5. Regression Testing for AOSD
      • When AO features are added/modified, the program needs to be regression tested
      • Case 1: P is an OO program and P’ is an AO version of P
      • Case 2: Both P and P’ are AO programs
      • How should regression test selection be performed for AO software?
    • 6. Outline
      • B ackground
      • Problem statement and motivation
      • Our analysis
      • Implementation status
      • Related work
    • 7. Existing Work Applied to AO Programs
      • How to compare two JIGs?
        • The JIG of the woven code includes redundant nodes and edges and does not correspond to the logical control flow as presented in the source
        • Need new representations
      • How to recover CFG edges from the execution trace when computing edge-coverage matrix? (when P is AO program)
        • The execution trace is compiler-specific
        • Need instrumentation before/during weaving
    • 8. Existing Work Applied to AO Programs
      • class C {
      • public void m (int i) {…}
      • 3. }
      • void bar (C p, int k) {
      • p.m(k);
      • }
      • Java version P
      • CFG edge
      • Call edge
      Java Interclass Graph (JIG) bar() p.m() return C.m() … exit exit
    • 9. Example
      • class C {
      • public void m(int i){…};
      • 3. }
      • void bar(C p, int k) {
      • p.m(k);
      • }
      • aspect Sample{
      • void around (C c, int i):
      • call (C.m(int)) &&
      • target (c) &&
      • args (i) {
      • 14. proceed (p , x);
      • 15. }
      AspectJ Version P’ bar() p.m() Return C.m() … exit JIG for P C. m () … exit bar() .. around$0 return … c.m() return JIG for P’ (from woven code) ..Sample. around$0
    • 10. Some Results
      • When we applied the [Harrold et.al. 01] algorithm to several subjects:
      19 20 testReadFile 4 0 4 0 tracing 1 0 1 0 tjp 3 0 3 0 telecom 1 0 1 0 observer 4 0 4 0 introduction 1 0 1 0 bean V 2 ( AspectJ version ) Num of selected tests V1 (java version) Num of tests Subjects
    • 11. Possible Approach
      • Create “clean” CFGs in which the wrapper code inserted during weaving is removed
        • Graph traversal and comparison corresponds to the “logical” structure of the code, not the compiler-specific woven code
      • New representation: AJIG
        • Aspect J Inter-module Graph – more later
      • For regression test selection, need to consider additional issues
    • 12. A More Complex Problem
      • class C {
      • public void m(int i){…};
      • 3. }
      • void bar(C p, int k) {
      • C.m(k);
      • }
      • aspect Sample{
      • void around(C c, int i):
      • call(C.m(int)) &&
      • target(c) &&
      • args(i) {
      • System.out.println(i);
      • proceed(p , x);
      • 15. }
      C. m () bar() return m() AJIG for P’ … exit exit System.out….
      • Do we need to select all the tests that go through the edge marked in red?
    • 13. Why it needs to be addressed
      • This is an issue not only for AO software, but also for procedural and OO software
      • Advices are often free of side effects
        • Study in [Rinard et al. FSE 04] reported 6 “observer” advices out of ten inspected advices
        • Recommended for “safe” AO programming
      • Adding side-effect-free advices should not result in overly conservative regression test selection
      • Approach: use side-effect analysis
    • 14. Outline
      • Big picture and background
      • Problem statement and motivation
      • Our analysis
      • Implementation status
      • Related work
    • 15. Our Work
      • Consider both situations:
        • Case 1: P is an OO version, P’ is an AO version
        • Case 2: both P and P’ are AO versions
      • Analysis to select regression tests
        • Build a new control flow representation: A J IG
        • Apply existing graph-traversal algorithm on AJIG
        • Side-effect analysis when comparing AJIGs
    • 16. AJIG
      • Aspect J Inter-module Graph (recent work)
        • For the Java parts, same as JIG.
        • Shadow node
        • A shadow node is associated with
            • a set of JIGs of advices
            • the precedence of these advices
            • an integrated shadow advice JIG
        • AJIG supports all static AspectJ pointcut types
        • Conservatively approximate the dynamic part of pointcut designators.
    • 17. Basic Idea
      • Build AJIGs for P and P’.
      • Apply the graph-traversal algorithm on AJIGs of P and P’ .
    • 18. New Test Selection Criterion
      • Side effect related node in AJIG
        • Has side effects
        • Has some dependency on the nodes that have side effects
      • Safe edge in AJIG
        • An edge is safe edge, if the sink node of this edge is side effect related.
    • 19. New Test Selection criterion
      • New Test Selection criterion:
        • Dangerous set S computation: for each edge e in P, and its counter part e’ in P’
          • e is not equivalent to e’ and
          • both e and e’ are side effect related
      • Select a test that execute one or more edges in S
    • 20. Selection
      • Computing dangerous set S by comparing AJIGs.
      • We plan to use some form of side-effect analysis
        • Large body of existing work
      • Selecting tests.
    • 21. Implementation progress
      • The implementation of algorithms described in [Harrold et.al. 01] √
      • Building AspectJ Inter-module Graph √
        • Make an extension for the abc compiler that generates the Jimple based CFGs for aspects between the weaving of inter-type declarations and advices.
        • Instrument advices at different phases.
      • Side effect analysis ongoing work
      • Evaluation
    • 22. Related Work
      • Static/Dynamic Analysis for AO programs.
        • abc compiler [AOSD 05] [PLDI 05] [TR 04].
        • Static analysis of aspects [Sereni and Moor, AOSD 02].
        • Zhao’s work on the analysis and testing of AO programs [COMPSAC 03] [WPC 02][AOSD 06].
        • Josh-an open implementation of AspectJ-like languages [Chiba and Nakagawa AOSD 03]
        • Classification system for AO programs [Rinard et. al. FSE 04].
    • 23. Related Work (Cont’d)
      • Regression Test Selection
        • [LW ICSM 91], [CRV ISCE 94], [RH TOSEM 97], [Ball ISSTA 98], [Harrold+ OOPSLA 01], [OSH FSE 04]…
      • Change Impact Analysis
        • [KGH+ ICSM 94], [RT PASTE 01], [OAH FSE 03], [OAL+ ICSE 04], [RST+ OOPSLA 04], …
    • 24.
      • Thank you!!
      • Questions??

    ×