Reverse Engineering Tools for Simplifying Programming

advertisement
International Journal of Engineering Trends and Technology (IJETT) – Volume 26 Number 2- August 2015
Reverse Engineering Tools for Simplifying Programming
Environment through Flowcharting
Ms. Nivedita Tiwari1, Mr. Lalji Prasad2
1
PG Student, Department of Computer Science Engineering, TCET, Indore, INDIA
2
Professor, Department of Computer Science Engineering, TCET, Indore, INDIA
Abstract — Software developers use algorithms to
communicate programming techniques. An algorithm
is a step-by-step recipe for processing data. These
algorithms can be designed though the use of
flowcharts. A flowchart graphically represents the
steps a program or set of programs takes to process
data. Algorithms and flowcharts are two tools, a
software developer uses when creating new programs.
A major problem in software engineering is the lack of
well-documented source code software applications.
This paper proposes the flowcharting concept that
recovers the limitations occurred in already existing
tools for the flowchart generator from the source
code. Furthermore, the ability of identifying basic
programming problems from which syntactically
correct program code and its corresponding flowchart
are generated. We also add several advanced features
in flowchart-based programming environments for
improving the performance of existing flowcharting
tools. Proposals for research on this field and
opportunities for a better flowcharting tool for
software engineering and Reverse Engineering are
presented.
Keywords — Software Engineering, Reverse
Engineering,
Flowcharting
Tool,
Automatic
generation of flow charts.
I. INTRODUCTION
Much of the study of computer science is dedicated to
discovering efficient algorithms and representing them
so that they can be understood by computers.
According to the Schneider and Gersting 1995, An
algorithm is a well-ordered collection of
unambiguous and effectively computable operations
that when executed, produces a result and halts in a
finite amount of time [1]. While programming
languages avoid the problems of being wordy and
ambiguous, they have some other disadvantages that
make them undesirable for writing algorithms.
Before writing a complex program, a software
developer usually plans it out by creating a flowchart.
A flowchart shows different steps a program takes,
using different shapes to describe the various actions
the program carries out [7]. Flowcharts serve as
important pieces of documentation for individual
programs and for systems of programs in a larger
system. Because a flowchart accurately summarizes a
program's functions, and because it uses clear English
and easy-to-understand, standard symbols, it takes
ISSN: 2231-5381
much less effort to read it than it does the program
itself [12]. If the program develops problems, a
programmer may save time by checking the flowchart
before examining the program. Though flowcharts are
technically-oriented, non-technical users can easily
follow them, making them useful documents for
project management and auditing.
In this paper, we choose two reverse engineering
flowcharting tools on the basis of their capabilities and
features that captures the functionality of the system
and the design at an abstraction level that removes the
need of language implementation. Our current
research effort focuses on a analysis of these tools that
will be useful in maintaining the consistency of design
document with its code and for understanding large
systems.
The remainder of this paper is organized as follows. In
the section 2 we describe the works that are previously
done as literature survey. In the section 3 brief
introduction to both tools are given; focus on the
generation of flow charts from the source code.
Section 4 describes the supporting languages. The
main part of this paper is section 5 which will present
the analysis of both tools that generate the flow chart
through source code and benefits /shortcomings of
both tools.
II. LITERATURE SURVEY
Flowcharts become a significant issue to explain
different kinds of information based on figure types.
In some documents, flowcharts are so important to
illustrate a lot of details and make it easier to
understand. Some of complex problems cannot be
solved directly without explain these problems in
flowcharts [3]. The most significant role of using
flowcharts is in the designing part of projects. In many
projects, methodology of structured design is one of
primary steps to build entire system and solving
engineering problems that can be explained by using
flowcharts and other types of figures. In addition to
previous points, using flowchart in design helps to
divide problem into smaller parts and manage
problems easily [2].
Phillips et al. describe modern tools as “highly
interactive graphics intensive environments designed
to support the development of computer based
http://www.ijettjournal.org
Page 65
International Journal of Engineering Trends and Technology (IJETT) – Volume 26 Number 2- August 2015
systems” (Phillips et al., 1998). While the standard
ISO 9126 regards software quality to consist of
functionality,
usability,
reliability,
efficiency,
maintainability and portability (Brown,1994), Phillips
et al. emphasise usability in particular [13]. They point
to Apperley and Duncan, who noted that “from the
user’s point-of-view, for a modern application with a
graphical user interface, the interface is the system.”
(Apperley and Duncan, 1994) So for a tool to be good,
it should have a usable graphical user interface.
Flowchart plays an important role in system analysis,
preparatory design of algorithm and system
maintenance aspects.. So, automatic generation of a
flowchart from specific language code will be a very
important practical significance, it allows the designer
to design the system from high-level functions without
concerning for complicated code [12]. Code visual to
flow chart [4] can be used to introduce its flowcharts
to Microsoft Office application including Visio. This
tool shows how the flowchart and code relate to one
another and is a useful indicator.
According to the Andrew Scott [5], The use of the tool
focuses on using flowcharts to develop visual
solutions to basic programming problems from which
syntactically correct program code is generated.
According to Carlisle M, Wilson T, Humphries J and
Hadfield M [9] Raptor is a tool for flow chart based
visual programming Environments was expanded for
the United State Air force Academy as introduction
and computing course. It is an MS Windows based
application. Westphal et al [11] define that without the
use of diagrams or flow charts, it is difficult for
beginners, even with pseudo code to communicate the
flow of a program., While flowcharts are not well
suited for large and complex programs.
III. INFOMERCIAL FLOWCHARTING
TOOLS
In the field of reverse engineering, code visual to
flowchart and Visutin [4, 8] are the most well known
and commonly used infomercial flowcharting tools.
Both tools are so powerful to support source code
visualization of several programming languages such
as: C, C++, C#, VB, Java, PL/ SQL and much more.
But, they also share the some limitations.
The underlying operational principle of both tools is
identical. They rely on the system user to define the
physical location of the target source code to analyse
and visualize. However, they differ in the way they
present their output and how they integrate with other
external systems such as: VISIO and MS Word [4, 8].
In that, Visustin seems to show more powerful
integration with external systems.
A. Code Visual to Flowchart
ISSN: 2231-5381
This system is a commercial product, Code Visual to
Flowchart (CVF) by Fatesoft. With the aim of aiding
programmers understand and document source code,
CVF converts program codes into flowcharts. The
flowchart view auto up-dates representing the program
visually as each line of code is entered into CVF text
editor [4]. CVF presents its flowcharts and code side
by side which are synchronized via highlighting.
Clicking a line of code will cause a relevant flowchart
component to highlight and vice versa. This shows
how the flowchart and code relate to one another and
is a useful indicator. CVF can be used to introduce its
flowcharts to Microsoft Office application including
Visio. So it is really a useful documentation tool.
Code Visual to Flow chart is designed to visualize
procedural code of any complexity. Code Visual to
Flow Chart works even with true spaghetti code and
unstructured jumps. It works best with executable
code, but it can also consume non-executable
declarations. For the best results, consider removing
the non-procedural parts, as they sometimes result in
clutter in the diagram. You can visualize an entire
source code file, a single class, a single procedure or
just a part of it.
If the code is long and the flow chart large, it often
makes sense to remove some code and focus on the
crucial points of the algorithm. Code Visual to Flow
Chart works at the statement level. It doesn’t care
about the internal parts of complex statements, such as
the Booleans (and , or, &&, ||) in an if statement.
By using Code Visual to Flow Chart Converter,
programmers can easy access to get project overview,
during the process of programming, programmers can
preview their changed code structures at all times.
Categories to generate flow chart in CVF:
1. Generate flow chart for all code.
2. Generate flow chart without Comment.
3. Generate flow chart for only comment.
4. Generate flow chart for small graphic.
5. Generate flow chart for big graphic.
Two types of flow chart is generated;
1. Represent all codes in the program i.e., flow
chart-1[1-3].
2. Represent only terminologies used in the
program i.e., flow chart-2[3-4]
Individual flow chart can be drawn for larger
programs. Division of flow chart according to
following category:
1. Class: It describes the main program.
2. Function: It describe the following in the
Program
Function
Procedure
http://www.ijettjournal.org
Page 66
International Journal of Engineering Trends and Technology (IJETT) – Volume 26 Number 2- August 2015
Constructor
Destructor
For Export flow chart to:
Image only support BMP and PNG format.
Word, Excel, Power Point it support MS
Word, MS Excel, MS Power Point2000/2002/2003.
V7 works both interactively and bulk mode. When
using it interactively, you just load your code and
immediately view it as a flow chart. Flow charts are a
helpful tool in software development, maintenance
and evolution. They can be used in new development,
restructuring and re- engineering various projects.
Figure 1: CVF Application Window
6.2.2 Visustin V7 Flow Chart Generator
Aivosto
has
released
Visustin
v7,
an
automated flowcharting program. Visustin is a flow
chart generator that converts source code to flow
charts. The new Visustin v7 creates flow charts
from 43 programming languages .Flow chart software
to reverse engineer code, view flow diagrams, create
Visio flow charts, debug ,understand and improve
algorithms[8]. Flow charts show the logic in the code:
the decisions taken, the loops iterated.
The most accurate documentation of any software
application is its source code. Understanding source
code is notoriously difficult, however. Interpreting
source code requires in-depth knowledge of
programming. Reading raw code is prone to errors
even when done by expert developers. This is where
flow charts come to help. Flow charts display code in
a natural diagram format. They convey all the
information in the source code in a human-friendly
visual way. Flow charts are a super-fast method to see
the logic in a piece of code. They are an extremely
powerful tool for understanding what a program really
does.
A program performs its logic with decisions, that is
conditional statements such as "if" and "else". In a
flow chart these decision points are instantly visible.
Each decision diamond clearly displays the conditions
of the decision. It's easy to follow the alternative paths
running from each decision forward. Understanding
the decisions plays a key role in understanding what a
program does.
ISSN: 2231-5381
Figure 2: V7 Application Window
IV. REVIEW OF SUPPORTING
PROGRAMMING ENVIRONMENTS
A program is a set of instructions that tells a computer
what to do in order to come up with a solution to a
particular problem. Programs are written in a language
that computers can understand, known as
programming language. Each programming language
has its own syntax, which consists of a set of rules that
dictate how words and symbols can be put together to
form a program. There are hundreds of different
programming languages, each with their own logic
and syntax. Visustin and code visual to flowchart
both tools generates flow charts from code written in
any of C, C++, C#, Java, PL/SQL, JSP ,PHP and
many more programming languages. Some of the
language description stated below:
1) C/C++
C is a general purpose programming language with a
long history. C is used for many different types of
software, but it is particularly popular for system
software, such as operating systems, device drivers
and telecommunications applications. C is widely used
because it runs very fast. It can also access a computer
system's low level functions; this means it is closer to
the hardware than some other programming
http://www.ijettjournal.org
Page 67
International Journal of Engineering Trends and Technology (IJETT) – Volume 26 Number 2- August 2015
languages. C has become an official standard of the
American National Standards Institute, or ANSI.
Many other programming languages borrow syntax
from C.
C++ is a high-level programming language that builds
on its predecessor C by adding object-oriented
features to it. C++ is very versatile and can be used for
many different applications. C++ is also an official
ANSI standard. C++ is used widely for applications
that rely more heavily on a graphical user interface, or
GUI. For example, many utility programs and device
drivers are written in C, while applications software
with many user dialogs are written in C++ [15]. The
name C++ represents the evolution of the C language
because the two plus symbols represent the increment
operator in C. C support covers ANSI C and ISO C99.
C++ support covers C++98 and Microsoft Visual C++
extensions. Microsoft support is current up to Visual
C++ 2010. C++/CLI is supported. Visustin fully
supports C/C++ digraph and trigraph sequences: <%
%> <: :> %: %:%: ??= ??/ ??' ??( ??)
??! ??< ??> ??- Inlined assembler instructions
need to be charted separately. To flowchart assembly
language code embedded in C/C++ files, process it
in assembler mode.
2) JAVA
Java is Oracle’s object-oriented programming
language. One of the main advantages of Java is the
“Write Once Run Anywhere” concept, allowing for
Java programs to be ported to any platform that has
JVM support (in theory, if not always in practice).
There are a variety of IDEs that support Java, such as
NetBeans which has a GUI builder for the Swing
toolkit or Eclipse which has a rich variety of plugins
to support testing, version control and GUI building
[14].
V. COMPARATIVE ANALYSIS AND
DISCUSSION
Unfortunately, both tools concentrate on flowcharting
program visualization and ignore the other useful
diagrams .
TABLE 1: COMPARISON OF TOOLS
ATTRIBUTES
CVF
V7 TOOL[8]
Declaration
Concept of Classes
Symbol Used
defined
in
function (In C
programming).
& Main Method
defined
in
procedure
(In
JAVA
programming).
No concept of
classes
is
defined.
Does
not show the
class
in
the
output.
Notations
are
different to V7 to
flow chart a
same program.
Synchronization
Between Source
Code and Flow
Chart
Synchronization
between the code
and flowchart.
Highlighting
Identification
Language
It provides.
Does
Identify.
of
not
and
Call.
Procedure
Always show the
class
in
the
output.
Flow
chart the each
and every line of
source code.
Notations
are
different to CVF
tool to flow chart
a same program.
Always use the
decision symbol
for conditions in
the
program.
Show the class in
the output.
No
Synchronization
between the code
and
flowchart
and vice versa.
It does not.
Does
Identify.
not
LIMITATIONS OF CVF/V7 TOOL
This does not really minimize the overhead of syntax.
So the programming activity does not really focus on
problem solving. This code allows the flowchart to
program visualization, reducing poor programming
habits and removing of programs without careful
selection. Its inability to construct programs via
flowcharts, its lack of execution features and its lack
of syntax error checking leaves CVF as a poor tool. It
cannot provide a model of execution promotes a poor
image to programming and fails to solve syntactic
overheads of programs [4]. It is thus unsuitable for
novices. Numerous syntax is unsupported or only
limited support is provided. The chart may display a
normal statement, not a branch or a jump. Visustin
works at the statement level. The internal structure of
complex expressions is not visualized. The conditional
expression :? is not split, nor is any short-circuited
logic such as && or ||.
TOOL[4]
Output
Generation
Main
Function
Two flow charts
are generated for
a program for
supported
languages.
Main
ISSN: 2231-5381
method
The single flow
chart
is
generated for a
program
for
supported
languages.
Support Function
1.
Identification of Programming
before generating the flow chart.
Language
If we put a program in any programming language,
then v7 tool generate its corresponding flow chart
and for the same program, if we select a different
programming language, then it will also create flow
http://www.ijettjournal.org
Page 68
International Journal of Engineering Trends and Technology (IJETT) – Volume 26 Number 2- August 2015
chart without showing any notification or error
message regarding programming language.
Example:
Input->source code(C code)->select language
C->create flow chart ->Output
Input->source code(C code)->select language
JAVA->create flow chart ->Output
Input->source code(C code)->select language
.NET->create flow chart ->Output
Propose:
Input->source code(C code)->select language
C->create flow chart ->Output
Input->source code(C code)->select language
JAVA-> Display Error message ->Output
2.
Does not display any kind of notification
or message for the occurrence of the error
in the given source code:
Both tools do not show any notification or
error message, if any syntax or semantic error
occurs in source code. It only generates the
flow chart either source code correct or
incorrect.
Propose:
Highlight the incorrect code in the source
code.
3.
Standard Symbols are not use for flow
charting:
Both tools use a different notation for flow
charting the source code.
Propose:
Already defined that is basic flowcharting
notations are used.
4.
No synchronization between source code
and flow charting:
This will lead to problems to understand the
flowchart and its corresponding source code
simultaneously.
Propose:
If we write a single statement of code, then
the tool will generate its corresponding chart.
5.
No difference between the flowcharting of
different language.
Propose:
Fix the color for each language.
6.
Lack of understanding in visualization of
flow charts because the tool do not
generate colorful flow charts.
Propose:
Colored flowchart should be generated.
7.
Both tools do not generate multiple
diagram.
Propose:
Support more useful diagrams.
8.
Operating System Limitation in V7 tool.
Propose:
Support More Operating Systems.
FEATURES TO BE ADDED
Following features would be added according to the
proposed concept and tool will design for ease of use:
1) Drag and Drop
2) Conversion of one language to another.
3) Perform compilation and decompilation both
i.e., Generate Source code from Flowchart
and flowchart to source code.
4) Provide algorithm development through
number of inputs and outputs.
5) The
tool
development
environment
minimizes the amount of syntax you must
learn to write correct program instructions.
6) The tool development environment is visual
so that program can be executed one symbol
at a time. This will help novices follow the
flow of instruction execution in programs.
7) Tool will generate error messages to be more
readily understandable by beginning
programmers.
Our goal is to present a concept that minimizes the
number of limitations present in a existing tools.
These objectives require commercial programming
language such as C++ or Java and infomercial
flowcharting tools.
PROPOSED CONCEPT
A concept that proposes a tool that recovers all above
mentioned limitations and also provides the feathers
stated above. For this we can also propose an
algorithm that generates an editor or plug-in that
recovers limitations of the tool and provides new
features. The propose algorithm generate the TOOL
that is the combination of the following stated below:
TOOL= TEXT EDITOR +DIAGRAM EDITOR +
DIAGRAM CREATOR
ISSN: 2231-5381
http://www.ijettjournal.org
Page 69
International Journal of Engineering Trends and Technology (IJETT) – Volume 26 Number 2- August 2015
1.
Examine the source code/Flow chart given as
an input to the tool.
Sometimes source code/flowchart is available for a
reverse engineer and sometimes it is not. Reverse
engineering approaches involves examine source
code. Sometimes only binary code is available, but
if you decompile a binary to get source code and
then study the code. Reverse engineering
approaches is typically very effective in finding
programming errors and implementation errors in
software. There are two types of analysis tools,
those that require source code and those that
automatically decompile the binary code and
continue from there. These tools include source
code-related problems and issues commonly
encountered in Java, C, and C++, does require
source code.
2.
Verification of the source code/flowchart &
Identify the Programming Language.
Reverse engineering approaches involves analysing
and understanding given source code/flowchart.
Program failures can be analysed to determine
whether errors exist in the target software. Some
other reverse engineering approaches refers to
analysing a running program by probing it with
various inputs. This kind of approaches requires
only a running program and does not make use of
source code analysis of any kind.
3.
If the input is in textual format perform
compilation i.e., software engineering.
A compiler is a tool that converts machine-readable
code into assembly language. Assembly language is
a human-readable form of machine. Compiler
reveals which machine instructions are being used
in the code. Machine code is usually specific to a
given hardware architecture. Thus, Compilers are
written expressly for the target hardware
architecture.
4.
If the input is in graphical format perform
decompilation i.e., Reverse engineering.
A decompiler is a reverse engineering tool that
converts assembly code or machine code into source
code in a higher level language such as C/C++, JAVA.
Decompilers also exist to transform intermediate
languages such as Java byte code and Microsoft
Common Runtime Language (CRL) into source code
such as Java. These tools are extremely helpful in
determining higher level logic such as loops, switches,
and if-then statements.
ISSN: 2231-5381
Figure 3: Conceptual View
A good compiler/ decompiler pair can be used to run
its own collective output back into the same binary.
VI. CONCLUSION AND FUTURE WORK
After analysing some specific reverse engineering
flow charting tools, it has been concluded that the
proposed concept for flowcharting algorithm aims to
the overcome the burden of understanding and
maintaining the existing legacy systems by
implementing various features. We have compared
the results of two different tools i.e., CVF and V7
that generate flow chart from source code. We also
find limitation and benefit of individual tools.
Finally, applying flowcharting algorithm to several
legacy systems will result in building better
flowcharts to understand the system and it will be
helpful in software development projects and will
provides a clear view of Flow Chart. However,
further development is needed to extend tool for the
flowcharting algorithm.
There is no single tool that could be declared as the
best of our evaluation. The reverse engineering tools
evaluated are all quite different with varying strengths
and weaknesses. They all provide good reverse
engineering capabilities in different usage contexts.
The propose flowcharting algorithm concept raises the
flag for an urgent need for a new source code
visualization tool that overcome the major limitations
of the most well known flowcharting tools.
In near future one can proposed a flow charting
algorithm for structured/unstructured flowchart. The
algorithm can be used to generate flowchart from
source code and vice versa. It will also provide the
various algorithm developments when number of
input/output is given. Using the Proposed algorithm
one can develop a new flowcharting tool with
extended features and many advantages. As the field
matures, each new feature can be elaborated with
more fine-grained precision.
http://www.ijettjournal.org
Page 70
International Journal of Engineering Trends and Technology (IJETT) – Volume 26 Number 2- August 2015
REFERENCES
[`1] Schneider, M. and J. Gersting (1995), An Invitation to
Computer Science, West Publishing Company, New York, NY, p. 9
[2] International Journal of Computer Science & Information
Technology (IJCSIT) Vol 6, No 1, February 2014 Shape-Based
Plagiarism Detection for Flowchart Figures in Texts Senosy
Arrish, Fadhil Noer Afif, Ahmadu Maidorawa and Naomie Salim
[3] B. G. Vasudevan, et al., "Flowchart knowledge extraction on
image processing," in IEEE International Joint Conference on
Neural Networks, 2008. IJCNN 2008. (IEEE World Congress on
Computational Intelligence). Hong Kong, 2008, pp. 4075-4082.
[4] FATESOFT (2009),Code Visual to Flowchart, FateSoft, Eden
Prairie
NM
USA,
[Accessed
29/10/2009]
http://www.fatesoft.com/s2f/.
[5] Andrew Scott, Mike Watkins and Duncan McPhee.,(2010), ELearning For Novice Programmers, A Dynamic Visualisation and
Problem
Solving
Tool,
http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4529966
[6] I. Nassi and B. Shneiderman, “Flowchart Techniques for
Structured Programming,” ACM SIGPLAN Notices, Vol. 8, No. 8,
1973, pp. 12-26. doi:10.1145/953349.953350
[7] J. F. Gimpel, “Contour: A Method of Preparing Struc-tured
Flowcharts,” ACM SIGPLAN Notices, Vol. 15, No. 10, 1980, pp.
35-41.
[8] Aivosto, (2003). Visustin Flow Chart Generator [online].
Aivosto.com. Available from: http://www.aivosto.com/visustin.html
[Accessed 21-5-2005].
[9] Carlisle M, Wilson T, Humphries, J and Hadfield, M, 2004,
RAPTOR: Introducing Programming To Non-Majors With
Flowcharts, Journal of Computing Sciences in Colleges, Consortium
for Computing Sciences in Colleges, University of Central Missouri,
USA pp: 52 – 60.
[10] Nivedita Tiwari, Lalji Prasad, “ A Comparative Study: Reverse
Engineering Flowcharting tools” IJITE, Vol. 7, No. 1, 2015.
[11] Westphal B, Harris F and Fadali M, 2003,Graphical
Programming: A Vehicle for Teaching Computer Problem Solving,
33rd ASEE/IEEE Frontiers in Education Conference, IEEE,
Boulder Colorado, pp: 19-23
[12] Danial Hooshyar , Ma.en T. Alrashdan , Masih Mikhak :
Flowchart-based Programming Environments Aimed at Novices.
[13] Phillips, C., Mehandjiska, D., Griffin, D., Choi, M.D., Page, D.
(1998). The Usability Component of a Framework for the
Evaluation of OO CASE Tools, Proceedings of the International
Conference of Software Engineering: Education & Practice 1998,
pp. 134-141
[14] W. D. Pauw, E. Jensen, N. Mitchell, G. Sevitsky, J. M.
Vlissides, and J. Yang, “Visualizing the execution of java
programs,” in Revised Lectures on Software Visualization,
International Seminar. London, UK: Springer-Verlag, 2001, pp.
151–162.
[15] D. B. Lange and Y. Nakamura, “Program explorer: a program
visualizer for c++,” in COOTS’95: Proceedings of the USENIX
Conference on Object-Oriented Technologies on USENIX
Conference on Object-Oriented Technologies (COOTS). Berkeley,
CA, USA: USENIX Association, 1995, pp. 4–4.
ISSN: 2231-5381
http://www.ijettjournal.org
Page 71
Download