Articles & News Stories

A Framework for Reverse Engineering

Description
A Framework for Reverse Engineering Acta Wexionensia No 77/2005 Computer Science A Framework for Reverse Engineering Thomas Panas Växjö University Press A Framework for Reverse Engineering. Thesis for
Published
of 127
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
A Framework for Reverse Engineering Acta Wexionensia No 77/2005 Computer Science A Framework for Reverse Engineering Thomas Panas Växjö University Press A Framework for Reverse Engineering. Thesis for the degree of Doctor of Philosopy. Växjö University, Sweden 2005 Series editors: Tommy Book and Kerstin Brodén ISSN: ISBN: Printed by: Intellecta Docusys, Gothenburg 2005 Abstract Panas, Thomas, A Framework for Reverse Engineering. Acta Wexionensa, no 77/2005. ISSN: ISBN: Written in English. Reverse engineering is an activity supporting the comprehension of complex software systems. Considering the size of modern software systems, comprehension is anything but simple and must therefore be supported by tools. Many tools for reverse engineering exist and are already considered best practice. We define the tool-based process of reverse engineering as a sequence of three subprocesses: retrieval, analysis and visualization of program information. Most reverse engineering tools support this process only partially, e.g., only retrieval or visualization. To support the entire process, a reverse engineering tool should therefore consist of three types of components (or existing tools): retrieval, analysis and visualization. Since many such reverse engineering components (tools) already exist, the challenge lies therefore in their assembly, i.e., a composition system becomes necessary. In this thesis, we describe the VIZZANALYZER FRAMEWORK, a composition system that has been designed and implemented to support our tool-based reverse engineering process. The framework facilitates the flexible and rapid composition of individual reverse engineering tools. Components (tools) are adapted at design time and selected and composed at run time. Adaptation implies the assimilation of the signature and data of components (tools). The VizzAnalyzer is our instantiation of the framework. It has proven to be useful in solving complex reverse engineering tasks. Moreover, we present two evaluations of the framework, validating its qualities. The first, a case study, analyzes the change in the framework s internal quality over the time that we re-engineered it, assessing especially its maintainability, but also the functionality of its instantiation. The second utilizes a controlled experiment to assess the internal quality of the composed reverse engineering tools, but also to assess the reusability of the framework for arbitrary reverse engineering tasks. Keywords: reverse engineering, program comprehension, software composition Ability is of little account without opportunity. Napoleon Bonaparte Thanks To begin with, I am deeply grateful to my adviser, colleague, and friend Prof. Welf Löwe for his invaluable guidance and continual support. Without his insights and skills the fully operational VizzAnalyzer would not be available by now. My appreciation is best expressed by the following Japanese proverb: better than a thousand days of diligent study is one day with a great teacher. Thank you Welf! I would also like to thank Prof. Per Flensburg, Mathias Hedenborg and Gösta Sundberg for believing in me and giving me the opportunity to proceed my studies in Sweden. This thesis would not have been possible without the financial support of the School of Mathematics and Systems Engineering at Växjö University. Warm thanks also to my first adviser Prof. Uwe Aßmann, formerly at Linköping University. I am also grateful to Prof. John Grundy and Prof. Jim Whitehead for hosting me at Auckland University and University of Santa Cruz, respectively. I have enjoyed working with you and your groups. Many thanks to my colleague Jesper Andersson for all the fruitful discussions on software architectures, aspects and frameworks. Special thanks also to Rüdiger Lincke and Miroslaw Staron for their great support. A big thank you goes to all members of the computer science group at Växjö University for being friends, being fun, and turning serious work to pleasure. Also, my warmest gratitude to Anna Wingkvist for being a wonderful friend. A very special thank you goes to my parents Elisabeth and Roman for their everlasting support. It s all due to you! Thomas Panas Växjö, October 2005 Contents Introduction 1 1 Problem and Goal Motivation Research Approach Goal Criteria Composition Systems Classical Component Composition Systems Architecture Composition Systems Aspect Composition Systems Frameworks as Composition Systems Summary The VIZZANALYZER FRAMEWORK Architecture and Design Graph Library Dynamic Type System Model Mapping Evaluation Framework Maintainability Development Efficiency Reverse Engineering Tool Quality Contributions 29 6 Related Work 30 7 Articles 32 References 33 I Reuse in Reverse Engineering 39 1 Introduction 41 2 Re-engineering Patterns, Tools, and Tasks First Contact (Architecture Representation) Initial Understanding (Class Representation) Detailed Model Capture (Source Representation) Reverse Engineering Tasks Representations A Reverse Engineering Framework Architecture A Common Data Representation General Framework Instantiations Our Framework Instantiation Analysis Plug-Ins Visualization Plug-Ins Additional Features Related Work 54 6 Conclusion 57 References 57 II Rapid Construction of Software Comprehension Tools 61 1 Introduction 63 2 Models for Software Comprehension 66 3 Views for Software Comprehension 67 4 Creating a Base Model 67 5 Analyses to Create a Model for Software Comprehension 69 6 Mapping between Model and View 70 7 Mapping between View and Scene 72 8 Examples of Software Comprehension Tools Comprehending Class Interaction Comprehending Package Interaction Comprehending Program Evolution Comprehending Program Quality Animating Quality Evolution VizzAnalyzer Vizz3D Related Work Conclusion 91 References 91 III A Qualitative Evaluation of a Software Development and Re-Engineering Project 95 1 Introduction 97 2 The VizzAnalyzer The VizzAnalyzer Framework History of the VizzAnalyzer Development Metrics Interpretation of the Metrics System Level Design Class Level Design Complexity Analysis System Design Class Design Complexity Discussion Conclusion 115 References 116 IV Evaluation of a Framework for Reverse Engineering Tool Construction Introduction The VizzAnalyzer Framework The Experiment Experiment Design The GQM Approach Applied Subjects 4.3 Objects Variables Hypothesis and Data Analysis Instrumentation Operation Experiment Results Analysis of Separate Dependent Variables Overall Results Threats to Validity Conclusion 143 References 143 Introduction Think? Why think! We have computers to do that for us. Jean Rostand Computers are useless. They can only give you answers. Pablo Picasso 1 Problem and Goal The problem addressed in this thesis is whether and how we can improve the comprehension of software systems. Reverse engineering aids in comprehending software systems by supporting software developers, designers, maintainers or managers in understanding the purpose, the structure, and the dynamics of such systems. This, it is conducted to complete a stakeholder s mental model about a software system, see Figure 1.1. For instance, a stakeholder may have to read the existing documentation, read the source code, interview users and developers, execute the software, develop and execute test cases, etc., in order to gain understanding [DDN03]. Hence, reverse engineering utilizes many artifacts of a software system, such as requirement documents, design documents, source code documentation, the source code itself, the developer s knowledge, and so forth. However, such documents are often outdated or not available at all [KM05]. Therefore, in many cases, the code of a system (source or binary) is the only trustworthy source of informa- Documents Developer comprehension Goal Code Image Software System Figure 1.1 Reverse engineering processes. Mental Model 4 1 Problem and Goal Retrieval Component Analysis Component Visualization Component RvE-tool assembly Model Reverse Engineering Tool RvE-tool Composition Process Code retrieve/ filter analyze/ focus visualize/ focus Image Tool based Reverse Engineering Process Figure 1.2 Tool-based RvE process vs. RvE-tool composition process. tion [FL02, VN05]. Unfortunately, the code of software systems can be extremely large, comprising millions of lines. Therefore, due to the sheer size of many systems, their comprehensibility needs to be supported by tools. The task of these reverse engineering (RvE) tools is to extract information, analyze and filter it, and, finally, create a visualization appropriate to the person who tries to understand the software system. Most current reverse engineering tools support this process only partially, e.g., only retrieval or visualization (cf. related work in Section 6). To support the entire process, a reverse engineering tool should consist of three types of components (or existing tools): retrieval, analysis and visualization. We refer to this process as the tool-based reverse engineering process, see Figure 1.2. This process, which takes the source code of a software system as input and results in appropriate images of that system as output, consists of three subprocesses (each substitutable by one type of component): retrieval, analysis and visualization of program information. The tool-based reverse engineering process therefore supports stakeholders in comprehending software systems based on its code. However, a main problem is that technology and requirements change fast in the software engineering field. No reverse engineer can predict what functionality a reverse engineering tool will need in the future, what novel analyses will have to be supported and what visualizations will be best suited for a specific task. Therefore, no rigid programunderstanding tool will ever be suitable for all users in all software reverse engineering tasks [TWSM94, BG97]. 1.1 Motivation 5 As a result, engineers configure reverse engineering systems by choosing a tailored environment, i.e., a set of components (tools) they are most productive with. Unfortunately, the large number of possible component variations makes it impossible to predefine a number of appropriate reverse engineering tools. Instead, the suitable combination of components must be individually tailored for each software comprehension task. Therefore, a composition system becomes necessary, cf. RvE-tool composition process in Figure 1.2. The process indicates that reverse engineering components need to be reused and assembled by a suitable composition system to result in a new, goal-specific reverse engineering tool. This process should preferably be quick, meaning rapid composition, and flexible, that is allowing arbitrary existing reverse engineering components (tools) to be assembled. Therefore, the goal of this thesis is to define a composition system for reverse engineering to support the rapid composition of individual reverse engineering tools reusing arbitrary reverse engineering components. DEFINITION 1.1. Reverse Engineering Tool (RvE-Tool) A tool for reverse engineering is a software program supporting the retrieval of information from software systems, its analysis, and its visualization at various levels of abstraction. DEFINITION 1.2. Reverse Engineering Component A software component is a static abstraction of a program with plugs [NT95]. A component for reverse engineering is a component supporting either the retrieval or analysis or visualization of software systems. DEFINITION 1.3. Composition System A composition system is a pair (C,R), where C denotes the constraints on components (composition interface restrictions), and R the rules and infrastructure for assembling components to an executable software system. The process of assembly according to the rules is called composition. DEFINITION 1.4. Composition System for Reverse Engineering A composition system for reverse engineering is a composition system composing reverse engineering components to build reverse engineering tools. 1.1 Motivation Software systems, a recent innovation of human kind, represent one of the most complex human-made artifacts [Bro87] of all times. For example, a relatively simple software component with a hundred if-then statements generates something like a million billion billion billion logical paths, and yet we would expect each of those paths to be correct if the module is to be correct [WY96]. Their daunting size, intangibility, the explosive number of logical paths, and the massive effort to design and test, causes long development times and high costs. The incapability of humans to effectively handle this complexity and the lack of 6 1 Problem and Goal standard software processes [Som01] results in software systems still being built from scratch, frequently adapted and hence aging quickly [DDN03], i.e., the system is becoming more complex through it s fast alteration. Fast-aging systems are very difficult to maintain, often leaving an incomprehensible legacy system behind. This is problematic, since a software system s maintenance alone is estimated to devour 40%-80% of its lifetime resources and costs [TG96, Dav95, Boe81]. The greatest part of software maintenance, in turn, is devoted to understanding the system being maintained. Already in the late 1970s, Fjeldstad and Hamlen reported that 47% and 62% of maintenance time spent on enhancement and correction tasks, respectively, were devoted to understanding [FH79]. According to other studies, the programunderstanding effort is said to cover 40% [Hen97], 60% [Sel90] or even up to 90% [Sta84]. As an example, imagine the worst case of 90% comprehension efforts with a software maintenance cost of 80%. The software-understanding efforts for the entire life cycle of a software system are 72%. Obviously, software comprehension and, hence, reverse engineering as an activity supporting software comprehension are vital. 1.2 Research Approach This thesis is based on a constructive research approach [Jär01]. This approach reasons about the possibility of building a certain innovation, and if built, its usefulness is questioned. In particular, we have (i) closely studied the problem domain [Pan03], (ii) designed and implemented a composition system [PLL04, LP05], (iii) evaluated the composition system via a case study [PLLL05] (qualitative research), and (iv) validated its usefulness via a controlled experiment [PS05] (theory-testing research). 1.3 Goal Criteria We impose the two goal criteria of reusability and maintainability, in exactly that order, on our composition system. These criteria are defined as ISO/IEC 9126 software quality standards [SIS03]: 1. Reusability. Usability is defined as the capability of the software to be understood, learned, used and liked by the user, when used under specified conditions. We are, however, interested in the reuse rather than use of a composition system for reverse engineering. Our system must be reused 1.3 Goal Criteria 7 in order to allow for the repeatable composition of individual reverse engineering tools. Reusability is not specifically mentioned in the ISO standard and has been interpreted [LL05] as the usability of software for the integration in other systems, e.g., usability of libraries and components. The user is substituted here by a software engineer or developer. Reusability, hence, is a special case of the quality factor usability. Our selection of ISO/IEC 9126 subcriteria for reusability is in exactly the following order: Attractiveness. Attributes of software that bear on the capability of the software product to be attractive to the user. Attractiveness for reuse can be understood as attractiveness of software for a software engineer or developer to integrate it into new systems. In the context of reverse engineering, for our system to be attractive, this requires: Tool-based RvE process (R1). A composition system for reverse engineering must consider our tool-based reverse engineering process (cf. Figure 1.2). Hence, the composition system must facilitate reverse engineering tools that are based upon this process High RvE-tool quality. The composition with a composition system shall result in reverse engineering tools with high internal and external quality. Note that we distinguish here the qualities of the composition system from the qualities of the composed reverse engineering tools. We induce the following qualities on the composed reverse engineering tools: RvE-tool maintainability (R2). Maintainability is defined as the capability of the software to be modified. A composed reverse engineering tool occasionally needs to be changed (adapted). For instance, to update a reverse engineering component to a newer version, some of the composition code may have to be changed in order to adapt to possibly new interface specifications. The source code constituting the reverse engineering tool (or just its composition) must therefore be available and maintainable RvE-tool efficiency (R3). RvE-tool efficiency is the capability of the reverse engineering tool to provide the required performance relative to the amount of resources used. Efficiency is important when it comes to analyzing and interactively visualizing complex and large software systems. Therefore, we require our composition system to result in efficient reverse engineering tools. 1 The additional subcriterion compliance, defining attributes of software that make the software adhere to application-related standards, was not chosen as a priority criterion. In addition, the order of subcriteria within the ISO standard is different. 8 1 Problem and Goal Accurate RvE-tool functionality (R4). Attributes of software that bear on the provision of correct or agreed results. Our composition software shall support the composition of accurate reverse engineering tools, i.e., tools that perform their functionality as defined (expected) by the user. 1.2 Programmability. Operability is defined as the attributes of software that bear on the users effort for operation and operation control. From a reuser s point of view, operability can be understood as programmability of software, i.e., the development effort for a software engineer or developer to integrate the software into a new system. In our context of reverse engineering this requires: Flexible composition (R5). A flexible composition system is a system that can be programmed individually (configured) and allows the easy extension of arbitrary reverse engineering components. Flexibility is important for any system that is to be extended in the future Efficient composition (R6). A composition system must allow for the rapid composition of reverse engineering components. A complex and tedious composition process restricts the reuse of any composition system. Hence, a reverse engineering composition system is efficient, when the composition time, defined by the effort of a user, and the composition-specific problems (faults) are minimal. 1.3 Learnability (R7). Attributes of software that bear on the users effort to learn its application. Learnability for reuse can be understood as learnability of software for a software engineer or developer with the purpose of integrating the software into new systems. In our context of reverse engineering, a composition system must have simple restrictions on components and simple composition rules. This ensures that reusers learn to use the system in a short time in order to rapidly build individual reverse engineering tools. 1.4 Understandability (R8). Attributes of software that bear on the users effort for recognizing the logical concept and its applicability. Understandability for reuse can be interpreted as the understandability of software for a software engineer or developer with the purpose of integrating the software into new systems. In our context of reverse engineering, a composition system must be well documented. Reusers must understand
Search
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks