Week 8
Week 8
SOFTWARE RE-ENGINEERING
Code Reverse Engineering
Code Reverse Engineering
1. Redocumentation of artifacts
2. Design recovery
Code Reverse Engineering
1. Redocumentation of artifacts
• It aims at revising the current description of components or
generating alternative views at the same abstraction level.
2. Design recovery
• It creates design abstractions from code, expert
knowledge, and existing documentation.
Factors necessitating the need for Reverse Engineering:
• The first three of the six steps involve local analysis, the rest
involve global analysis.
Describe the Create the input and
Key Steps in Reverse
Partition source code
Engineering..
meanings of those output schematics of
into units units and identify the the units identified
functional units before
Create an internal
Describe the Describe the system
structure of the
connected units application
system
Applications of Reverse
Applications of Reverse Engineering
Engineering
Reverse engineering has been effectively applied in the following
problem areas:
• Redocumenting programs
• Discovering design architectures
• Recovering design patterns
• Building traceability between code and documentation
• Deriving conceptual data models
• Detecting duplications and clones
• Cleaning up code smells
• Computing change impact
Applications of Reverse Engineering..
• Transforming binary code into source code
• Redesigning user interfaces
• Parallelizing largely sequential programs
• Translating a program to another language
• Migrating data
• Extracting business rules
• Wrapping legacy code
• Auditing security and vulnerability
• Extracting protocols of network applications
Typical Reverse engineering process recovers
artifacts which exist at domain, functional,
Reverse
structural andEngineering Process
implementation levels.
• Abstraction
• Presentation
High Level Reverse Engineering Process
Presentation Phase
• It provides access to information produced by the extraction and
abstraction processes as well as provides feedback to the user in a
particular format.
• It helps the user to control and initiate the operations.
• It separates user presentation concerns from extraction and
abstraction concerns.
Abstraction Phase
• Abstraction process communicates with the interface component
and the extraction component to create and represent the
abstract artifacts e.g. mapping or analysis scripts.
Extraction Phase
• The extraction Phase allows the user to extract the required
artifacts of interest through the presentation phase.
• The user specify the patterns, actions and analysis depending on
the available source code and documents.
• Documents are mapped to the source code.
User specification, Mapping, Inputs/Outputs
User specification
• User specifies the required artifacts specification for his
requirement
Mapping
• Mapping is performed at all levels of abstraction to extract,
abstract and present artifacts
Inputs/Outputs
• The inputs in the RE process are available source code,
documentation and domain knowledge to extract, abstract
and present artifacts in particular format
Reverse Engineering Process (Ian Sommerville)
Program stucture
Automated diagrams
analysis
System
System to be Document Data stucture
information
re-engineered generation diagrams
store
Manual
annotation Traceability
matrices
Reverse Engineering Tools
Reverse Engineering Tools
• Many reverse engineering tools concentrate on extracting the
structure or architecture of a legacy system with the goal of
transferring this information into the minds of the software
engineers trying to maintain or reuse it.