0% found this document useful (0 votes)
20 views

Week 8

Uploaded by

Munazza Tabassum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Week 8

Uploaded by

Munazza Tabassum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 38

SE602

SOFTWARE RE-ENGINEERING
Code Reverse Engineering
Code Reverse Engineering

In the context of software engineering, Chikofsky and Cross


defined reverse engineering as a process to:
(i) identify the components of an operational software.
(ii) identify the relationships among those components.
(iii) represent the system at a higher level of abstraction or in
another form.
Code Reverse Engineering

Reverse engineering is performed to achieve two key objectives:

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.

• Examples of redocumentation are pretty printing and


drawing CFGs.
Code Reverse Engineering
Code Reverse Engineering

Control Flow Graph


Code Reverse Engineering

2. Design recovery
• It creates design abstractions from code, expert
knowledge, and existing documentation.
Factors necessitating the need for Reverse Engineering:

• The original programmers have left the organization.

• The language of implementation has become obsolete, and the


system needs to be migrated to a newer one.

• There is insufficient documentation of the system.


Factors necessitating the need for Reverse Engineering:

• The business relies on software, which many cannot understand.

• The company acquired the system as part of a larger acquisition


and lacks access to all the source code.

• The system requires adaptations and/or enhancements.

• The software does not operate as expected.


Reverse Engineering & Re-Engineering

Figure: Relationship between re-engineering and reverse engineering


©IEEE, 1990
Synthesizing
Generating
Objectives of Reverse Recovering lost
Engineering higher levels of
alternative views information
Six objectives of reverse engineering, as identifiedabstractions
by Chikofsky and Cross:

Detecting side Coping with


Facilitating reuse
effects complexity
Key Steps in Reverse Engineering

• There are Six key steps in reverse engineering, as documented


in the IEEE Standard for Software Maintenance.

• 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.

A no. of Forward Engineering process models


exists.

Reverse Engineering process depends on the


requirements of maintainer. There is still no
standard reverse engineering process model.
Reverse Engineering Process
The high level reverse engineering process is categorized into three
phases:
• Extraction

• 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.

• Traditional architecture of reverse engineering environment was


made of extraction, repository and tools.
Reverse Engineering Tools
• Most tools are developed based on parse based and lexical based
techniques.

• Tool architecture must provide functionality to extract, abstract


and present the software system artifacts to support extraction,
abstraction and presentation of the recovery of desired artifacts.
Reverse Engineering Tools Attributes
• RE tools are developed with number of features to support
different methodologies according to customers’ requirements.

• RE tools must have following attributes:


• Flexibility
• Extensibility
• Scalability
Reverse Engineering Tools
• A number of tools available.
• The reference architecture of RE tool is given as:
Reverse Engineering Tools
The basic structure of reverse engineering tools is as follows:
• The software system to be reverse engineered is analyzed.
• The results of the analysis are stored in an information base.
• View composers use the information base to produce
alternative views of the system.

Basic structure of reverse engineering tools ©IEEE


1990
Enterprise Architect- a very useful tool
• UML based modeling tool with support of forward and reverse
engineering
• Supports 10 plus programming languages
• Continuous improvement and progression
• Cost effective solution
• Over 300,000 liscened users
• Supports all types of UML diagrams
• www.sparxsystems.com
CASE Tools
• Most CASE tools can reverse engineer class diagrams, but there is
lack of tool support for extracting all type of diagrams. Popular
CASE tools like Rational XDE, Borland Together, Eclipse GMT, and
Fujaba support round-trip engineering.

• Borland Together is one of the leader in commercial round-trip


engineering tools.
CASE Tools
• Eclipse is an open source framework, which can be extended to be
a complete integrated developing environment by external plugins.
• Several model transformation tools are implemented as Eclipse
plugin, for example UML modeling tools including simple round-
trip engineering support. Borland Together is available as an
Eclipse plugin.
• Eclipse Generative Modeling Tools (GMT) is a set of tools in the
area of model driven development.
Comparison of CASE Tools
Class Blueprint form
Class Blueprint form
Class Diagram

You might also like