0% found this document useful (0 votes)
69 views15 pages

Lecture 3 - Re Engineering

The document discusses reverse engineering and program comprehension. It defines reverse engineering as analyzing software to understand its components and relationships at a higher level of abstraction, without changing the software. Program comprehension involves acquiring knowledge about a computer program. Reverse engineering techniques include redocumentation, design rediscovery, restructuring, and reengineering. Program comprehension is important for software maintenance and development. It allows understanding legacy systems and is difficult due to conceptual gaps between problem/solution, abstract/concrete, and intended/actual software structures. Approaches to program comprehension include textual analysis, graphing methods, and execution/testing.

Uploaded by

Vaibhav Sinha
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views15 pages

Lecture 3 - Re Engineering

The document discusses reverse engineering and program comprehension. It defines reverse engineering as analyzing software to understand its components and relationships at a higher level of abstraction, without changing the software. Program comprehension involves acquiring knowledge about a computer program. Reverse engineering techniques include redocumentation, design rediscovery, restructuring, and reengineering. Program comprehension is important for software maintenance and development. It allows understanding legacy systems and is difficult due to conceptual gaps between problem/solution, abstract/concrete, and intended/actual software structures. Approaches to program comprehension include textual analysis, graphing methods, and execution/testing.

Uploaded by

Vaibhav Sinha
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Introduction To Reverse

Engineering

Anuja arora
CSE / IT
JIITU,Noida
8/14/2008 1
• Forward Engineering: This term, the obvious opposite of reverse
engineering, is offered to distinguish the traditional software
engineering process from reverse engineering.

XYZ

Today’s Design Tomorrow’s Product

• Reverse Engineering: The process of identifying software


components, their interrelationships, and representing these entities at
a higher level of abstraction. Reverse engineering by itself involves only
analysis, not change. Program comprehension and program
understanding are terms often used interchangeably with reverse
engineering

?
Yesterday Design Today’s Product
8/14/2008 2
Re-documentation: Perhaps the weakest form of reverse engineering,
this involves merely the creation (if none existed) or revision of system
documentation at the same level of abstraction.

Design Rediscovery: Re-documents, but uses domain knowledge and


other external information where possible to create a model of the system
at a higher level of abstraction.
system

design
docs

Redocumentation and
Design rediscovery
produces documentation
and design ;Leave System
8/14/2008 Unchanged 3
Restructuring: Lateral transformation of the system within the same
level of abstraction. Also maintains same level of functionality and
semantics.
system

Restructuring Transforms the


system, but functionality
Remains intact

Reengineering: The most radical and far reaching extension. Generally


involves a combination of reverse engineering for comprehension,and a
reapplication of forward engineering to reexamine which functionalities
need to be retained, deleted or added.

system

Reengineering changes
8/14/2008 functionality, direction of 4
system
Program Understanding: When?

• During maintenance/Evolution:
• The change

• During Development:
• When fixing bugs after testing
• Formal/Informal code review
• When new staff join a project part way through
• Software Reuse
• Code leverage

8/14/2008 5
Program Understanding: How ?

• Tools
• Software visualization
• Program analysis and transformation
• Reverse engineering
• But the most fundamental tool:

THE HUMAN BRAIN !

8/14/2008 6
During Maintenance

•Up to 50% of a software maintainers time can be spent


determining the content of source code.

• Within the maintenance function, reverse engineering activities


like Program Comprehension require 47% and 62% of the total
time for enhancement and correction tasks, respectively

• “However, maintenance of existing systems is estimated to


consume between 50% and 80% of there sources in the total
software budget

• The growing demand to reevaluate and re-implement legacy


software systems, has underscored the need for reverse
engineering tools and techniques.

8/14/2008 7
During Development

• Component Identification 60%


(prepare Re-documentation (view) and Program
comprehension sheet (example: Template)

• Redesigning 10-15%

• Reconstruction 25-30%

8/14/2008 8
• Reverse engineering has been a standard practice in the hardware
community for some time. It has only been within the last ten years that
reverse engineering, or “program comprehension,”has grown into the
current sub-discipline of software Evolution and Software Development.

• The purpose is to deduce design decisions from end products with


little or no additional knowledge about the procedures involved in the
original production. The same techniques are currently being
researched for application to legacy software systems

• Program comprehension or understanding, is a research area


devoted to developing tools and methodologies to aid in the
understanding and management of the increasing number of legacy
systems.

• Traditional software engineering research and development focuses


on increasing the productivity and quality of systems under
development or being planned

8/14/2008 9
Definition Of Program Comprehension

Program comprehension is the process of acquiring knowledge


about a computer program. Increased knowledge enables such
activities as bug correction, enhancement, reuse, and
documentation. While efforts are underway to automate the
understanding process, such significant amounts of knowledge
and analytical power are required. Today program comprehension
is largely a manual task.

Program comprehension is a domain of computing science


dealing with the processes used by software engineer to
understand programs.

8/14/2008 10
Program Comprehension –Motivation
9 A closely related term is reengineering. Whereas reverse
Engineering moves from program code to a higher level of
abstraction, reengineering uses the increased understanding to re-
implement the code in a new form.

9 The terms renovation and reclamation are also used to describe


this activity.

9 The need for reengineering may arise due to

1) changes in the operational environment, such as moving from a


centralized computational setting to one where use is
decentralized,

2) degradation to system structure due to long-term maintenance, or

3) so many alterations and enhancements to a system that the


existing architecture is no longer appropriate.
8/14/2008 11
Program Comprehension –Motivation

9 Yet another related term is restructuring. It is sometimes desirable


to reformulate a program without first abstracting it to a higher level.
For example, older software, typically written in versions of Cobol or
Fortran that did not contain modern control structures, makes heavy
use of GOTO statements. Readability can sometimes be improved
by replacing uses of GOTO with their modern equivalents, such as
structured conditional and looping constructs. This process of
reformulating the program without raising the level of abstraction is
called restructuring, and commercial tools are available for many
languages to automate the process.

9 The term reengineering is also popular in another context: business


process reengineering. In this case, the target of the reengineering
is an organization instead of a software system, but the goal is
still reformulation.

8/14/2008 12
Documents prepared after program comprehension

• HLD (High Level Design)


• Plain English (by Re documentation)
• Designing (UML) (by re designing)
HLD huger than LLD.

• LLD (Low Level Design)


• Psudocode

If psudocode is of 1 page then HLD is approx 5-10 pages

8/14/2008 13
Why is Program Comprehension Difficult?
Program comprehension is difficult. It is difficult because it must bridge different
conceptual areas. Of particular importance are bridges over the following five
gaps.

•The gap between a problem from some application domain and a solution
to it in some programming language
•The gap between the concrete world of physical machines and computer
programs and the abstract world of higher level design descriptions
•The gap between the desired coherent and highly structured description
of a system as originally envisioned by its designer and actual system
whose structure may have disintegrated over time.
•The gap between hierarchal world of program and associational nature of
human cognition
•The gap between the bottom up analysis of the source code and top down
synthesis of the description of the application.

8/14/2008 14
Approaches to Program comprehension

Textual, lexical and syntactic analysis –


These approaches focus on the source code itself and its representations.
These include the use of lexical metrics and even automated parsing of the
code searching for cliches . Cliches are standard approaches to problem
solving that can extracted from the source code to give hints about design
decisions. The unit of examination is the program source itself.

Graphing methods –
There are a variety of graphing approaches for program understanding.
These include, in increasing order of complexity and richness: graphing the
control flow of the program, the data flow of the program, and program
dependence graphs . The unit of examination is a graphical representation
of the program source.

Execution and testing –


There are a variety of methods for profiling, testing, and observing program
behavior, including actual execution and inspection walkthroughs. Dynamic
testing and debugging is well known and there are several tools available
for this function. For large systems, a technique called “partial evaluation” is
available to identify and test isolate components of a system .

8/14/2008 15

You might also like