Brief Introduction to AOP
                     Rejuvenation Approach
                 Simple Motivating Example
                                  Downloads




                  Rejuvenate Pointcut1
       A Tool for Pointcut Expression Recovery in Evolving
                    Aspect-Oriented Software


             Raffi Khatchadourian, Awais Rashid
  khatchad@cse.ohio-state.edu,awais@comp.lancs.ac.uk
                    Ohio State University, Lancaster University


                              September 29, 2008


  1
   This material is based upon work supported in part by European
Commission grants IST-33710 (AMPLE) and IST-2-004349 (AOSD-Europe).
          Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                       Rejuvenation Approach
                   Simple Motivating Example
                                    Downloads


Outline


  1   Brief Introduction to AOP

  2   Rejuvenation Approach

  3   Simple Motivating Example
        Phase I: Analysis
        Phase II: Rejuvenation

  4   Downloads



            Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                     Rejuvenation Approach
                 Simple Motivating Example
                                  Downloads


Aspect-Oriented Programming




     AOP reduces scattering and tangling of crosscutting concern
     (CCCs) implementations.
     Developer specifies behavior (advice).
     Advice is composed at specific execution points (join points).
     Join points specified via pointcut expressions (PCEs).




          Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                     Rejuvenation Approach
                 Simple Motivating Example
                                  Downloads


Aspect-Oriented Programming




     AOP reduces scattering and tangling of crosscutting concern
     (CCCs) implementations.
     Developer specifies behavior (advice).
     Advice is composed at specific execution points (join points).
     Join points specified via pointcut expressions (PCEs).




          Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                     Rejuvenation Approach
                 Simple Motivating Example
                                  Downloads


Aspect-Oriented Programming




     AOP reduces scattering and tangling of crosscutting concern
     (CCCs) implementations.
     Developer specifies behavior (advice).
     Advice is composed at specific execution points (join points).
     Join points specified via pointcut expressions (PCEs).




          Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                     Rejuvenation Approach
                 Simple Motivating Example
                                  Downloads


Aspect-Oriented Programming




     AOP reduces scattering and tangling of crosscutting concern
     (CCCs) implementations.
     Developer specifies behavior (advice).
     Advice is composed at specific execution points (join points).
     Join points specified via pointcut expressions (PCEs).




          Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                    Rejuvenation Approach
                Simple Motivating Example
                                 Downloads


Example PCEs




     execution(* Foo.*(..))
     execution(* Foo.methodA())




         Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                    Rejuvenation Approach
                Simple Motivating Example
                                 Downloads


Example PCEs




     execution(* Foo.*(..))
     execution(* Foo.methodA())




         Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


Fragile Pointcut Problem


      Constructing optimal pointcut expressions that capture true
      intentions of where a CCC applies can be difficult.
      Ideally, pointcut expressions (PCEs) should remain valid as
      the software evolves.
      However, situations arise where base-code alterations induce
      the invalidity of existing PCEs.
      PCEs must be amended as a result.
      But which join points should be included?
      Can we automatically infer join points that should be included
      in the new version of the PCE upon evolution?


           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


Fragile Pointcut Problem


      Constructing optimal pointcut expressions that capture true
      intentions of where a CCC applies can be difficult.
      Ideally, pointcut expressions (PCEs) should remain valid as
      the software evolves.
      However, situations arise where base-code alterations induce
      the invalidity of existing PCEs.
      PCEs must be amended as a result.
      But which join points should be included?
      Can we automatically infer join points that should be included
      in the new version of the PCE upon evolution?


           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


Fragile Pointcut Problem


      Constructing optimal pointcut expressions that capture true
      intentions of where a CCC applies can be difficult.
      Ideally, pointcut expressions (PCEs) should remain valid as
      the software evolves.
      However, situations arise where base-code alterations induce
      the invalidity of existing PCEs.
      PCEs must be amended as a result.
      But which join points should be included?
      Can we automatically infer join points that should be included
      in the new version of the PCE upon evolution?


           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


Fragile Pointcut Problem


      Constructing optimal pointcut expressions that capture true
      intentions of where a CCC applies can be difficult.
      Ideally, pointcut expressions (PCEs) should remain valid as
      the software evolves.
      However, situations arise where base-code alterations induce
      the invalidity of existing PCEs.
      PCEs must be amended as a result.
      But which join points should be included?
      Can we automatically infer join points that should be included
      in the new version of the PCE upon evolution?


           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


Fragile Pointcut Problem


      Constructing optimal pointcut expressions that capture true
      intentions of where a CCC applies can be difficult.
      Ideally, pointcut expressions (PCEs) should remain valid as
      the software evolves.
      However, situations arise where base-code alterations induce
      the invalidity of existing PCEs.
      PCEs must be amended as a result.
      But which join points should be included?
      Can we automatically infer join points that should be included
      in the new version of the PCE upon evolution?


           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


Fragile Pointcut Problem


      Constructing optimal pointcut expressions that capture true
      intentions of where a CCC applies can be difficult.
      Ideally, pointcut expressions (PCEs) should remain valid as
      the software evolves.
      However, situations arise where base-code alterations induce
      the invalidity of existing PCEs.
      PCEs must be amended as a result.
      But which join points should be included?
      Can we automatically infer join points that should be included
      in the new version of the PCE upon evolution?


           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


The Idea



     Capture rich program element relationships in a concern graph
     adapted for AOP.
     Associate graph elements with join point shadows contained
     in the PCE.
     Extract patterns from finite, acyclic paths in the graph.
     Place wildcards in place of the associated elements.
     Apply the patterns to the evolved version of the base-code.




           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


The Idea



     Capture rich program element relationships in a concern graph
     adapted for AOP.
     Associate graph elements with join point shadows contained
     in the PCE.
     Extract patterns from finite, acyclic paths in the graph.
     Place wildcards in place of the associated elements.
     Apply the patterns to the evolved version of the base-code.




           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


The Idea



     Capture rich program element relationships in a concern graph
     adapted for AOP.
     Associate graph elements with join point shadows contained
     in the PCE.
     Extract patterns from finite, acyclic paths in the graph.
     Place wildcards in place of the associated elements.
     Apply the patterns to the evolved version of the base-code.




           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


The Idea



     Capture rich program element relationships in a concern graph
     adapted for AOP.
     Associate graph elements with join point shadows contained
     in the PCE.
     Extract patterns from finite, acyclic paths in the graph.
     Place wildcards in place of the associated elements.
     Apply the patterns to the evolved version of the base-code.




           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                      Rejuvenation Approach
                  Simple Motivating Example
                                   Downloads


The Idea



     Capture rich program element relationships in a concern graph
     adapted for AOP.
     Associate graph elements with join point shadows contained
     in the PCE.
     Extract patterns from finite, acyclic paths in the graph.
     Place wildcards in place of the associated elements.
     Apply the patterns to the evolved version of the base-code.




           Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                       Rejuvenation Approach    Phase I: Analysis
                   Simple Motivating Example    Phase II: Rejuvenation
                                    Downloads


Base-code

  package p ;
  public class A {
      int f ;
      void m1 () {
          int a = f + 1;
      }
      void m2 () {
          int b = f + 2;
      }
      void n () {
          int c = f + 3;
      }
  }

            Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                    Rejuvenation Approach        Phase I: Analysis
                Simple Motivating Example        Phase II: Rejuvenation
                                 Downloads


Concern Graph


                                   p


                                    contains


                                   A


            declares_method                    declares_method     declares_method


           A.m2()               declares_field       A.n()           A.m1()


                    gets_field                   gets_field        gets_field


                                    A.f




         Raffi Khatchadourian, Awais Rashid        Rejuvenate Pointcut
Brief Introduction to AOP
                       Rejuvenation Approach    Phase I: Analysis
                   Simple Motivating Example    Phase II: Rejuvenation
                                    Downloads


An Aspect




  package p ;
  public aspect B {
      before () : execution (* m *(..) ) {
      }
  }




            Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                    Rejuvenation Approach        Phase I: Analysis
                Simple Motivating Example        Phase II: Rejuvenation
                                 Downloads


Concern Graph


                                   p


                                    contains


                                   A


            declares_method                    declares_method     declares_method


           A.m2()               declares_field       A.n()           A.m1()


                    gets_field                   gets_field        gets_field


                                    A.f




         Raffi Khatchadourian, Awais Rashid        Rejuvenate Pointcut
Brief Introduction to AOP
                       Rejuvenation Approach    Phase I: Analysis
                   Simple Motivating Example    Phase II: Rejuvenation
                                    Downloads


Base-code




  // . . .
  void o () {
         int d = f + 4;
  }
  // . . .




            Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                        Rejuvenation Approach           Phase I: Analysis
                    Simple Motivating Example           Phase II: Rejuvenation
                                     Downloads


Concern Graph


                                    p


                                    contains


                                    A


       declares_method               declares_method         declares_method      declares_method


       A.m2()               declares_field        A.n()           A.o()           A.m1()


                gets_field                          gets_field gets_field           gets_field


                                                  A.f




           Raffi Khatchadourian, Awais Rashid             Rejuvenate Pointcut
Brief Introduction to AOP
                    Rejuvenation Approach    Phase I: Analysis
                Simple Motivating Example    Phase II: Rejuvenation
                                 Downloads


Patterns and Suggestions




         Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                     Rejuvenation Approach
                 Simple Motivating Example
                                  Downloads


Tool and Material Downloads

     Tool research prototype publicly available at
     http://code.google.com/p/rejuvenate-pc.
     Research related material publicly available at
     http://sites.google.com/site/pointcutrejuvenation.




          Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut
Brief Introduction to AOP
                       Rejuvenation Approach
                   Simple Motivating Example
                                    Downloads


Question for SCAM




  Do more expressive PCE languages truly solve the fragile pointcut
  problem?




            Raffi Khatchadourian, Awais Rashid    Rejuvenate Pointcut

Rejuvenate Pointcut: A Tool for Pointcut Expression Recovery in Evolving Aspect-Oriented Software

  • 1.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Rejuvenate Pointcut1 A Tool for Pointcut Expression Recovery in Evolving Aspect-Oriented Software Raffi Khatchadourian, Awais Rashid khatchad@cse.ohio-state.edu,awais@comp.lancs.ac.uk Ohio State University, Lancaster University September 29, 2008 1 This material is based upon work supported in part by European Commission grants IST-33710 (AMPLE) and IST-2-004349 (AOSD-Europe). Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 2.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Outline 1 Brief Introduction to AOP 2 Rejuvenation Approach 3 Simple Motivating Example Phase I: Analysis Phase II: Rejuvenation 4 Downloads Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 3.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Aspect-Oriented Programming AOP reduces scattering and tangling of crosscutting concern (CCCs) implementations. Developer specifies behavior (advice). Advice is composed at specific execution points (join points). Join points specified via pointcut expressions (PCEs). Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 4.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Aspect-Oriented Programming AOP reduces scattering and tangling of crosscutting concern (CCCs) implementations. Developer specifies behavior (advice). Advice is composed at specific execution points (join points). Join points specified via pointcut expressions (PCEs). Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 5.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Aspect-Oriented Programming AOP reduces scattering and tangling of crosscutting concern (CCCs) implementations. Developer specifies behavior (advice). Advice is composed at specific execution points (join points). Join points specified via pointcut expressions (PCEs). Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 6.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Aspect-Oriented Programming AOP reduces scattering and tangling of crosscutting concern (CCCs) implementations. Developer specifies behavior (advice). Advice is composed at specific execution points (join points). Join points specified via pointcut expressions (PCEs). Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 7.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Example PCEs execution(* Foo.*(..)) execution(* Foo.methodA()) Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 8.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Example PCEs execution(* Foo.*(..)) execution(* Foo.methodA()) Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 9.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Fragile Pointcut Problem Constructing optimal pointcut expressions that capture true intentions of where a CCC applies can be difficult. Ideally, pointcut expressions (PCEs) should remain valid as the software evolves. However, situations arise where base-code alterations induce the invalidity of existing PCEs. PCEs must be amended as a result. But which join points should be included? Can we automatically infer join points that should be included in the new version of the PCE upon evolution? Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 10.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Fragile Pointcut Problem Constructing optimal pointcut expressions that capture true intentions of where a CCC applies can be difficult. Ideally, pointcut expressions (PCEs) should remain valid as the software evolves. However, situations arise where base-code alterations induce the invalidity of existing PCEs. PCEs must be amended as a result. But which join points should be included? Can we automatically infer join points that should be included in the new version of the PCE upon evolution? Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 11.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Fragile Pointcut Problem Constructing optimal pointcut expressions that capture true intentions of where a CCC applies can be difficult. Ideally, pointcut expressions (PCEs) should remain valid as the software evolves. However, situations arise where base-code alterations induce the invalidity of existing PCEs. PCEs must be amended as a result. But which join points should be included? Can we automatically infer join points that should be included in the new version of the PCE upon evolution? Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 12.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Fragile Pointcut Problem Constructing optimal pointcut expressions that capture true intentions of where a CCC applies can be difficult. Ideally, pointcut expressions (PCEs) should remain valid as the software evolves. However, situations arise where base-code alterations induce the invalidity of existing PCEs. PCEs must be amended as a result. But which join points should be included? Can we automatically infer join points that should be included in the new version of the PCE upon evolution? Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 13.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Fragile Pointcut Problem Constructing optimal pointcut expressions that capture true intentions of where a CCC applies can be difficult. Ideally, pointcut expressions (PCEs) should remain valid as the software evolves. However, situations arise where base-code alterations induce the invalidity of existing PCEs. PCEs must be amended as a result. But which join points should be included? Can we automatically infer join points that should be included in the new version of the PCE upon evolution? Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 14.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Fragile Pointcut Problem Constructing optimal pointcut expressions that capture true intentions of where a CCC applies can be difficult. Ideally, pointcut expressions (PCEs) should remain valid as the software evolves. However, situations arise where base-code alterations induce the invalidity of existing PCEs. PCEs must be amended as a result. But which join points should be included? Can we automatically infer join points that should be included in the new version of the PCE upon evolution? Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 15.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads The Idea Capture rich program element relationships in a concern graph adapted for AOP. Associate graph elements with join point shadows contained in the PCE. Extract patterns from finite, acyclic paths in the graph. Place wildcards in place of the associated elements. Apply the patterns to the evolved version of the base-code. Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 16.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads The Idea Capture rich program element relationships in a concern graph adapted for AOP. Associate graph elements with join point shadows contained in the PCE. Extract patterns from finite, acyclic paths in the graph. Place wildcards in place of the associated elements. Apply the patterns to the evolved version of the base-code. Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 17.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads The Idea Capture rich program element relationships in a concern graph adapted for AOP. Associate graph elements with join point shadows contained in the PCE. Extract patterns from finite, acyclic paths in the graph. Place wildcards in place of the associated elements. Apply the patterns to the evolved version of the base-code. Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 18.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads The Idea Capture rich program element relationships in a concern graph adapted for AOP. Associate graph elements with join point shadows contained in the PCE. Extract patterns from finite, acyclic paths in the graph. Place wildcards in place of the associated elements. Apply the patterns to the evolved version of the base-code. Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 19.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads The Idea Capture rich program element relationships in a concern graph adapted for AOP. Associate graph elements with join point shadows contained in the PCE. Extract patterns from finite, acyclic paths in the graph. Place wildcards in place of the associated elements. Apply the patterns to the evolved version of the base-code. Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 20.
    Brief Introduction toAOP Rejuvenation Approach Phase I: Analysis Simple Motivating Example Phase II: Rejuvenation Downloads Base-code package p ; public class A { int f ; void m1 () { int a = f + 1; } void m2 () { int b = f + 2; } void n () { int c = f + 3; } } Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 21.
    Brief Introduction toAOP Rejuvenation Approach Phase I: Analysis Simple Motivating Example Phase II: Rejuvenation Downloads Concern Graph p contains A declares_method declares_method declares_method A.m2() declares_field A.n() A.m1() gets_field gets_field gets_field A.f Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 22.
    Brief Introduction toAOP Rejuvenation Approach Phase I: Analysis Simple Motivating Example Phase II: Rejuvenation Downloads An Aspect package p ; public aspect B { before () : execution (* m *(..) ) { } } Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 23.
    Brief Introduction toAOP Rejuvenation Approach Phase I: Analysis Simple Motivating Example Phase II: Rejuvenation Downloads Concern Graph p contains A declares_method declares_method declares_method A.m2() declares_field A.n() A.m1() gets_field gets_field gets_field A.f Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 24.
    Brief Introduction toAOP Rejuvenation Approach Phase I: Analysis Simple Motivating Example Phase II: Rejuvenation Downloads Base-code // . . . void o () { int d = f + 4; } // . . . Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 25.
    Brief Introduction toAOP Rejuvenation Approach Phase I: Analysis Simple Motivating Example Phase II: Rejuvenation Downloads Concern Graph p contains A declares_method declares_method declares_method declares_method A.m2() declares_field A.n() A.o() A.m1() gets_field gets_field gets_field gets_field A.f Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 26.
    Brief Introduction toAOP Rejuvenation Approach Phase I: Analysis Simple Motivating Example Phase II: Rejuvenation Downloads Patterns and Suggestions Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 27.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Tool and Material Downloads Tool research prototype publicly available at http://code.google.com/p/rejuvenate-pc. Research related material publicly available at http://sites.google.com/site/pointcutrejuvenation. Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut
  • 28.
    Brief Introduction toAOP Rejuvenation Approach Simple Motivating Example Downloads Question for SCAM Do more expressive PCE languages truly solve the fragile pointcut problem? Raffi Khatchadourian, Awais Rashid Rejuvenate Pointcut