1 / 32

Aspect Mining

Aspect Mining. Jin Huang Huazhong University of Science & Technology, China derick0320@gmail.com Jin.Huang@cern.ch http://cern.ch/huangj ( U nder C onstruction). Outline. Introduction Example Application Related work Recent research Future work Useful Information.

Download Presentation

Aspect Mining

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aspect Mining Jin Huang Huazhong University of Science & Technology, China derick0320@gmail.comJin.Huang@cern.ch http://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 • HeterogeneousCCs: Different pattern • CCs cause comprehensionand maintenanceproblems

  4. 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; } 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; } C Example : Homogeneous CCs debug concern system-specific concern synchronization concern

  5. Is There a Solution? Is AOP ? Separating concerns

  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 accessingpath • 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/spring/jta_spring_article.pdf

  9. WhyAspectMining? • If AOP can do better than OOP ?

  10. Outline Introduction Related work Recent research Future work Useful Information

  11. Fan-in Analysis • 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) • Obviously the equation (8) converges with the properties of stochastic matrix Matrix form of previous equation

  19. Selection Model • Selection Model • Implementation and Integration • Frequency • out-degree

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

  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 Aspectrefactoring ‘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 Refactoring • Disadvantage of Existing Aspect Mining Methods • Too simple to find Structural information for aspect refactoring. • Example: Observer pattern may cause crosscutting concernsfor‘updating’.

  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'. SayyedGarbaMaisikeli. 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 • Mining Software Engineering Data: • http://people.engr.ncsu.edu/txie/research.htm • Program Analysis • Indus: http://indus.projects.cis.ksu.edu • Soot: www.sable.mcgill.ca/soot • Information Retrieval: • Link Analysis: http://www.cs.uic.edu/~liub/teach/cs583-fall-05/CS583-link-analysis.ppt • EM Clustering: http://en.wikipedia.org/wiki/Expectation-maximization_algorithm

  32. Thank You ! Q&A

More Related