Prism is Research in Software Modularization Prism pattern

  • Slides: 20
Download presentation
Prism is Research in Software Modularization Prism pattern recognition for aspect mining Charles Zhang

Prism is Research in Software Modularization Prism pattern recognition for aspect mining Charles Zhang and Hans-Arno Jacobsen University of Toronto {czhang, jacobsen}@eecg. toronto. edu e. TX Workshop OOPSLA 2003

Transforming Legacy Systems Using AOP tools Aspect discovery/mining Prism Aspect Refactoring Aspect footprints AJDT

Transforming Legacy Systems Using AOP tools Aspect discovery/mining Prism Aspect Refactoring Aspect footprints AJDT Code-level Verification ARV Re-factored Aspects Over or under refactoring Functional Verification Unit/Regression Testing Tool e. TX Workshop OOPSLA 2003 Verified Aspects

What is Prism? ¡ ¡ ¡ Goal: A platform discovers aspects in very large

What is Prism? ¡ ¡ ¡ Goal: A platform discovers aspects in very large systems composed in a variety of languages. Consists of both backend engine and user interface. Core: A framework supports arbitrary language patterns and different pattern matching algorithms. Language pattern: l l l Lexical pattern: Usage of types: Execution flow: regular expressions where is my type. A? where are my actions? e. TX Workshop OOPSLA 2003

Prism Architecture: A set of extension points ¡ ¡ Prism fingerprint: A pattern definition

Prism Architecture: A set of extension points ¡ ¡ Prism fingerprint: A pattern definition specified by the user. Prism footprint: A encapsulation of the location information of a particular fingerprint. Prism task: A customizable assembly of Prism fingerprints which represents a more complex pattern. Prism algorithm: An algorithm responsible for matching a particular pattern and generating the associated footprint. Prism fingerprint Prism Task 1 Prism footprint Prism Engine Prism Algorithm Prism fingerprint Prism Task 2 Prism footprint e. TX Workshop OOPSLA 2003

Prism Eclipse Plug-in Prism footprints Prism tasks Fingerprints Projects Java Editor e. TX Workshop

Prism Eclipse Plug-in Prism footprints Prism tasks Fingerprints Projects Java Editor e. TX Workshop OOPSLA 2003

Configuring a Prism Fingerprint ¡ ¡ A Prism fingerprint consists of any combinations of

Configuring a Prism Fingerprint ¡ ¡ A Prism fingerprint consists of any combinations of lexical patterns and type patterns. Examples of type pattern: l l l ¡ Referencing all types in a particular package. All types in package: org. omg. CORBA Referencing all methods of any class type: All call sites for all methods of class: org. omg. CORBA. Any Aspect. J joinpoint definitions. Examples of lexical pattern: l Regular expressions e. TX Workshop OOPSLA 2003

Prism Fingerprint Configuration Fingerprint name Type pattern listing Type browser Regular expression listing e.

Prism Fingerprint Configuration Fingerprint name Type pattern listing Type browser Regular expression listing e. TX Workshop OOPSLA 2003

Prism Footprint ¡ ¡ Results of matching fingerprints in the source code. Example: A

Prism Footprint ¡ ¡ Results of matching fingerprints in the source code. Example: A fingerprint defined as “any method defined in the ‘class java. util. Hashtable’, of which the name starts by ‘get’ ” has the following footprints. e. TX Workshop OOPSLA 2003

Prism Framework: Decomposition Units and Fingerprints 1. The decomposition unit hierarchy. 2. The implementation

Prism Framework: Decomposition Units and Fingerprints 1. The decomposition unit hierarchy. 2. The implementation of fingerprints and its associated footprints e. TX Workshop OOPSLA 2003

Prism Framework: Prism Algorithms e. TX Workshop OOPSLA 2003

Prism Framework: Prism Algorithms e. TX Workshop OOPSLA 2003

Prism Framework: Task Execution e. TX Workshop OOPSLA 2003

Prism Framework: Task Execution e. TX Workshop OOPSLA 2003

Callex Extension of Prism Framework • Callex stands for call and lexical pattern based

Callex Extension of Prism Framework • Callex stands for call and lexical pattern based aspect analysis e. TX Workshop OOPSLA 2003

Logical Mining Architecture User interaction Source code Indexing, type and structure analyzer Results Aspect

Logical Mining Architecture User interaction Source code Indexing, type and structure analyzer Results Aspect Miner Intermediate representation e. TX Workshop OOPSLA 2003

Sample Mining Results • Sizes of the target systems minded ORB Number of Classes

Sample Mining Results • Sizes of the target systems minded ORB Number of Classes KLOC Jac. Orb 1778 70. 1 ORBacus 1777 62. 7 Open. Orb 1521 45. 8 • Degree of scattering ORB DPM PI Error Pre/ Post Logging Sync. Jac. Orb 23% 3. 52% 46. 5% 13. 3% 14. 66% 14. 11% ORBacus 26. 56% 7. 09% 45. 5% 5. 47% 18. 9% 9. 16% Open. Orb 23% 13% 44. 6% 10. 4% 16. 3% 9. 41% e. TX Workshop OOPSLA 2003

Other Project(s) Building on Prism e. TX Workshop OOPSLA 2003

Other Project(s) Building on Prism e. TX Workshop OOPSLA 2003

ARV, A Prism Implementation Declare Warning Effective joinpoints Prism Fingerprint Prism Task ARV Extension

ARV, A Prism Implementation Declare Warning Effective joinpoints Prism Fingerprint Prism Task ARV Extension Prism Algorithms Prism Engine e. TX Workshop OOPSLA 2003 ARV is Aspect Refactoring Verifier Prism Footprints

Goals Achieved To Date ¡ ¡ Complete GUI integration with Eclipse. Provides the Eclipse

Goals Achieved To Date ¡ ¡ Complete GUI integration with Eclipse. Provides the Eclipse aspect mining perspective. Enable search of calling patterns defined at package level, class level, and method level. Supports the Aspect. J call pattern convention. Supports navigation between mining results and source locations. Supports quantification of type usage scattering through computing degree of scattering as well as scattering ranking. e. TX Workshop OOPSLA 2003

Goals Achieved To Date ¡ ¡ ¡ Packaged as Eclipse plug-in Managed in CVS

Goals Achieved To Date ¡ ¡ ¡ Packaged as Eclipse plug-in Managed in CVS source tree Short user manual (targets aspect-aware developers) Short technical communication about Prism (unpublished) Poster and demos at e. TX/ICSE 2003, e. TX/OOPSLA 2003, CASCON 2003 Intention to submit as demo proposal to AOSD 2004 e. TX Workshop OOPSLA 2003

Future Work ¡ ¡ Mining of multiple languages (e. g. , C++). Support finding

Future Work ¡ ¡ Mining of multiple languages (e. g. , C++). Support finding patterns based on language phrases. Enable mining aspects based on their control/data flow characteristics. Analysis of conditional variables. Find non -localized slices caused by conditionals as candidates of aspects. Aspect mining algorithms based on statistical learning and data mining techniques. e. TX Workshop OOPSLA 2003

References Charles Zhang and Hans-Arno Jacobsen, Quantifying Aspects in Middleware Systems. AOSD 2003. Charles

References Charles Zhang and Hans-Arno Jacobsen, Quantifying Aspects in Middleware Systems. AOSD 2003. Charles Zhang and Hans-Arno Jacobsen, Re-factoring Middleware Systems: A case study. DOA Charles Zhang and Hans-Arno Jacobsen, Re-factoring Middleware with Aspects, IEEE TPDS. e. TX Workshop OOPSLA 2003