Presentation is loading. Please wait.

Presentation is loading. Please wait.

Aspect Mining Jin Huang Huazhong University of Science & Technology, China

Similar presentations


Presentation on theme: "Aspect Mining Jin Huang Huazhong University of Science & Technology, China"— Presentation transcript:

1 Aspect Mining Jin Huang Huazhong University of Science & Technology, China derick0320@gmail.comderick0320@gmail.com Jin.Huang@cern.chJin.Huang@cern.ch http://cern.ch/huangjhttp://cern.ch/huangj (Under Construction)

2 Outline Introduction  Example  Application Related work Recent research Future work Useful Information

3 Crosscutting Concerns (CCs) Type of Crosscutting Concern  Homogeneous CCs: Similar pattern  Heterogeneous CCs: Different pattern CCs cause comprehension and maintenance problems

4 C Example : Homogeneous CCs void *HeapAlloc(size_t size) { #ifdef NUTDEBUG...//some code #endif NODE **fpp = 0; //code removed #if defined(__arm__) || defined(__m68k__) || defined(__H8300H__) || … while ((size & 0x03) != 0) size++; #endif if (size >= available) { #ifdef NUTDEBUG...//some code #endif return 0; } debug concern system-specific concern int is_orphaned_pgrp(int pgrp) { int retval; … read_lock(&tasklist_lock); … retval = will_become_orphaned _pgrp(pgrp, NULL); … read_unlock(&tasklist_lock); … return retval; } synchronization concern

5 Separating concerns Is There a Solution? Is AOP ?

6 Prefetching - Heterogeneous CCs Prefetching  Prefetching is used to preload the file from disk to memory. It is an OS mechanism for performance.  [‘Checking system rules using system-specific, programmer-written compiler extensions’. (OSDI, 2000)] Execution paths for prefetching  Randomly accessing path  Sequentially accessing path

7 Example 2: Prefetching

8 Application: Spring AOP Spring: An open source application framework  Inversion of Control container  Aspect-oriented programming framework  Transaction management Transaction management  With a number of transaction management  Provides a more simple API for programmatic transaction management than the APIs of JTA.  Paper: “Bringing Advanced Transaction Management Capabilities to Spring” Applicationshttp://www.oracle.com/technology/tech/java/sp ring/jta_spring_article.pdf

9 Why Aspect Mining ? If AOP can do better than OOP ?

10 Outline Introduction Related work Recent research Future work Useful Information

11 Fan-in Analysis  An aspect mining approach that identifying CCs as methods that are called from many different call sites  ['Identifying Crosscutting Concerns Using Fan-In Analysis'.(WCRE2004, Marius Marin)] Limitation:  Only considering fan-in values of methods, can not find patterns of complex crosscutting concerns.

12 Random Walk Model Motivation  Inspired by pageRank algorithm of google Contribution  Paper first adopts the Markov model for computing popularity and significance values of elements in the coupling graphs.  Structure based mining approach: considering the coupling graphs of programs ‘Efficiently mining crosscutting concerns through random walks’. (Charles Zhang, AOSD 2007)

13 Clustering Approach Motivation  Information Retrieval: Clustering Contribution  Vector Space Model: a new model for aspect mining  Clustering approach is adopted for identifying CCs ‘Aspect Mining using a Vector-Space Model Based Clustering Approach’. (G. S. Moldovan and G. Serban, LATE, 2007)

14 Program Analyses for Aspect Mining Program Analyses (PA) Framework  Static analyse: points-to analyses, escape analyseis, and dependence analyses  Analyses Tools for Java: Soot, Indus. Aspect Mining through Program Analyses  Clone Detection: Mining homogeneous CCs.  Dependence Analysis: provide us dependencies for aspect mining.

15 Outline Introduction Related work Recent research  Two States Model  Algorithm  Selection Model  Experiment  Conclusion Future work Useful Information

16 Two States Model (1/2) Information Retrieval Algorithm  HITS algorithm: ‘Authoritative sources in a hyperlinked environment’, Jon Kleinberg, 1998. Two-States Model  Scatter - probability of being crosscutting logic.  Centralization - probability of being core logic Interaction of Two States

17 Algorithm (1/2) For each node q:  aq : Scatter value for vertex q.  hq : Centralization value for vertex q Computation model  Probability Distribution  Iterative Computation: t → t+1

18 Algorithm (2/2) Matrix form of previous equation Obviously the equation (8) converges with the properties of stochastic matrix

19 Selection Model  Implementation and Integration  Frequency  out-degree

20 Experiments setting Cases: Prevayler, JHotDraw and HSQLDB. Metrics  Precision: Threshold is set to be 0.4  Recall: Threshold is set to be 0.5 Comparison with Fan-in and Pagerank algorithms

21 Results for Prevayler

22 Results for JHotDraw

23 Results for HSQLDB

24 Advices for Aspect Refactoring Graph AGAC  AGAC is generated with our model. Grouping Crosscutting Concerns  Association rules mining from AGAC  Grouping CCs from rules

25 Conclusion We apply two-state model for aspect mining. This model is based on scatter and centralization states of program elements. We design a algorithm to compute of ”scatter” and ”centralization” states. with two-state model, we generate advices for Aspect refactoring ‘Aspect Mining through Link Analysis’, Jin Huang, FCST 2010.

26 Outline Introduction Related work Recent research Future work  Structural Aspect Mining  Clustering Useful Information

27 Structural Aspect Mining 1/2 Disadvantage of Existing Aspect Mining Methods  Too simple to find Structural information for aspect refactoring.  Example: Observer pattern may cause crosscutting concerns for ‘updating’. Refactoring

28 Structural Aspect Mining 2/2 Related Topics  Interactions of Structural Aspects. 'Analyzing Interactions of Structural Aspects'. Benoit Kessler, Eric Tanter. International Workshop on Aspects, Dependencies and Interactions (ADI). 2007.  Aspect Dependences and Interactions. 'AspectOptima: A Case Study on Aspect Dependencies and Interactions‘, Jorg Kienzle, Ekwa Duala-Ekoko, Samuel Gelineau, 2009.

29 Clustering Vector Space Model  OO Metrics are suggested.  'Aspect Mining Using Self-Organizing Maps With Method Level Dynamic Software Metrics as Input Vectors'. Sayyed Garba Maisikeli. 2009. EM Clustering  An model-based clustering approach  Problems: Center Identification, Number of clusters

30 Outline Introduction Related work Recent research Future work Useful Information

31 Useful information AOP vs. OOP:  http://www.coolverification.com/2006/10/the_aop_vs_oop_. html http://www.coolverification.com/2006/10/the_aop_vs_oop_. html Mining Software Engineering Data:  http://people.engr.ncsu.edu/txie/research.htm http://people.engr.ncsu.edu/txie/research.htm Program Analysis  Indus: http://indus.projects.cis.ksu.edu Indus: http://indus.projects.cis.ksu.edu  Soot: www.sable.mcgill.ca/soot Soot: www.sable.mcgill.ca/soot Information Retrieval:  Link Analysis: http://www.cs.uic.edu/~liub/teach/cs583-fall- 05/CS583-link-analysis.ppt http://www.cs.uic.edu/~liub/teach/cs583-fall- 05/CS583-link-analysis.ppt  EM Clustering: http://en.wikipedia.org/wiki/Expectation- maximization_algorithm http://en.wikipedia.org/wiki/Expectation- maximization_algorithm

32


Download ppt "Aspect Mining Jin Huang Huazhong University of Science & Technology, China"

Similar presentations


Ads by Google