Message Flow Analysis for Composition Filters and Its Application

Message Flow Analysis for Composition Filters and Its Application

Towards More Robust Advice: Message Flow Analysis for Composition Filters and its Application A thesis submitted for the degree of Master of Science at the University of Twente A.J. de Roo Enschede, March 29, 2007 Graduation committee: Twente Research and Education Prof. dr. ir. M. Ak¸sit on Software Engineering Dr. ir. L.M.J. Bergmans Department of Computer Science Ir. P.E.A. D¨urr Faculty of Electrical Engineering, Ir. T. Staijen Mathematics and Computer Science University of Twente Abstract Aspect oriented programming improves the quality of software by allowing a better separation of concerns. Composition filters is a delegation based AOP approach. It introduces advice by filtering messages sent between objects. The declarative syntax of composition filters opens possibilities for powerful reasoning about the behavior of a set of filters. This reasoning includes control flow analysis. But control flow analysis is only the basis of a much more powerful reasoning technique, called message flow analysis. Message flow analysis reasons about the behavior of a filter set for a specific message. It is a combination of control flow analysis and data flow analysis on the message entity. Message flow analysis brings opportunities for powerful conflict detection techniques, analyzing concern signature modifications, inlining of a set of filters and more. This thesis presents a new approach to message flow analysis, called the message flow simulation approach. This new approach improves upon existing approaches, like the message-action tree approach, by providing better granularity, traceability and efficiency. This thesis also works out four different applications of filter reasoning. First, it explains how consistency reasoning can do better reachability analysis and how the results from message flow analysis are used to create a cause and effect relationship between consistency conflicts. Second, it explains how message flow analysis is used to analyze signature modification. Third, it explains how message flow analysis makes behavioral reasoning more precise and more efficient. Finally, it explains how message flow analysis is used to translate a filter set to executable code, which can be woven in the base program. i Acknowledgements With the finishing of my thesis my graduation project has come to an end. There are a number of people that supported me during my graduation project, for which I am grateful. First, I would like to thank the members of my graduation committee. I would like to thank Lodewijk Bergmans, my supervisor, for being an example of a true scientist to me. With his always critic eye and expert knowledge he was of great guidance to me. I also would like to thank Pascal D¨urr. He inspired me with his never ending enthusiasm about composition filters and all its facets. I would like to thank him for always being available for answering questions, giving advice and enlightening discussions. Next, I would like to thank Tom Staijen. Although a less prominent member of my committee, his initial work on this subject gave me a good start of my graduation project. Next, I would like to thank Michiel van Oudheusen and Sverre Boschman for the enjoyable time we had together during the StarLight project and all other Compose? developers for their valuable input. Last, but not least, I would like to thank my parents and my sister for their love and support during all those years and for their unconditional faith in me. Arjan de Roo March 29, 2007 Enschede, The Netherlands iii Contents Abstract i Acknowledgements iii I Introduction 1 1 Introduction to AOSD 2 1.1 Introduction . 2 1.2 Traditional Approach . 4 1.3 AOP Approach . 5 1.3.1 AOP Composition . 6 1.3.2 Aspect Weaving . 6 1.4 AOP Solutions . 8 1.4.1 AspectJ Approach . 9 1.4.2 Hyperspaces Approach . 10 1.4.3 Composition Filters . 11 2 Compose? 13 2.1 Evolution of Composition Filters . 13 2.2 Composition Filters in Compose? ....................... 14 2.3 Demonstrating Example . 16 2.3.1 Initial Object-Oriented Design . 17 2.3.2 Completing the Pacman Example . 17 2.4 Compose? Architecture . 22 2.4.1 Integrated Development Environment . 22 2.4.2 Compile Time . 22 2.4.3 Adaptation . 22 2.4.4 Runtime . 22 2.5 Platforms . 23 2.6 Features Specific to Compose? ........................ 23 2.7 StarLight . 24 2.7.1 StarLight Architecture . 25 2.7.2 Explicit Modeling of the Returning Flow . 25 2.7.3 Defining New Filter Types and Filter Actions . 27 2.7.4 Conditional Superimposition . 29 v 3 Introduction to the .NET Framework 30 3.1 Introduction . 30 3.2 Architecture of the .NET Framework . 31 3.2.1 Version 2.0 of .NET . 32 3.3 Common Language Runtime . 33 3.3.1 Java VM vs .NET CLR . 34 3.4 Common Language Infrastructure . 34 3.5 Framework Class Library . 36 3.6 Common Intermediate Language . 37 II Message Flow Analysis 40 4 Motivation 41 4.1 The Purpose of Filter Reasoning . 41 4.1.1 Conflict Analysis and Error Detection . 42 4.1.2 Signature Generation . 43 4.1.3 Filter Inlining . 45 4.1.4 Further Applicability . 46 4.2 Problem Description . 46 4.3 Requirements . 46 4.3.1 Conceptual Requirements . 47 4.4 Existing Approaches . 48 4.4.1 Logical Expressions Approach . 48 4.4.2 Message-Action Tree Approach . 50 5 The Message Flow Simulation Approach 52 5.1 Transforming the Abstract Syntax Tree to a Flowchart . 52 5.1.1 Transformation Rules . 54 5.2 Simulating the Execution of a Message in the Filter Set . 59 5.2.1 Adding a Frame . 59 5.2.2 Execution Steps . 60 5.2.3 Maintaining State . 63 5.3 Simulating with each Possible Message . 64 5.3.1 Different Messages that Behave the Same . 64 5.3.2 Identifying Equivalence Classes . 65 5.3.3 State Space Example . 67 5.4 Computational Complexity . 68 5.4.1 From AST to Flowchart . 68 5.4.2 Simulating the Execution . 72 5.4.3 Total Time Complexity . 73 5.5 Discussion . 74 5.5.1 Evaluating Condition Expressions . 74 5.5.2 The Meta Filter Uncertainty . 76 5.5.3 Target Matching . 77 5.5.4 Message Lists . 78 6 The Filter Reasoning Engine 80 6.1 Filter Reasoning Engine Overview . 80 6.2 Using Graphs and Graph Transformations . 81 6.2.1 Transforming the AST to a Flowchart . 82 6.2.2 Simulating the Flowchart . 82 6.2.3 Advantages and Disadvantages of using GROOVE . 83 6.3 The Filter Reasoning Engine Preprocessor . 83 6.3.1 Overview of the process . 84 6.3.2 Class Structure . 85 6.3.3 Preprocessing each filter module? . 85 6.4 Combining the Information of Different Filter Modules in a Filter Set . 87 6.4.1 Combining Different Flowcharts . 87 6.4.2 Combining Different Execution Models . 88 6.5 The Filter Reasoning Model . 93 6.5.1 The FIRE Model Structure . 93 6.5.2 The Flowchart Structure . 94 6.5.3 The Execution Model Structure . 96 6.6 Filter Reasoning Engine Tools . 97 6.6.1 Iterators . 98 6.6.2 Regular Expression Checker . 98 6.6.3 Query Engine . 98 6.6.4 Viewer . 101 6.7 Implementation issues . 101 6.7.1 Is Execution Model Expansion Needed? . 101 6.7.2 GROOVE’s inefficiency . 103 III Message Flow Analysis Applied 107 7 Consistency Reasoning 108 7.1 Theory and Concepts . 109 7.1.1 Identifying Unreachable Components . 109 7.1.2 From Unreachable Component to Conflict . 110 7.1.3 Computational Complexity . 115 7.2 Design and Implementation . 117 7.2.1 Position in the Compose? Architecture . 117 7.2.2 Structure of the Consistency Reasoning Engine . 117 7.2.3 Implementation of the Consistency Reasoning Algorithm . 118 7.2.4 Reporting Conflicts . 120 8 Signature Generation 122 8.1 Theory and Concepts . 122 8.1.1 Old Approach to Signature Generation and Type Checking . 123 8.1.2 A Different Interpretation of Holljen’s Definition . 124 8.1.3 Representing the Signature Mapping as a Dependency Graph . 125 8.1.4 Using the Dependency Graph to Generate the Signatures . 128 8.1.5 Conflicts and Type Errors . 132 8.1.6 Using Other Filter Actions as Sufficient Requirement for Inclusion in the Signature . 139 8.2 From Theory to Practice . 140 8.2.1 Incrementally Building a Sufficient Subset of the Dependency Graph140 8.2.2 Initialization . ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    252 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us